diff --git a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java
new file mode 100644
index 0000000..8e74901
--- /dev/null
+++ b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java
@@ -0,0 +1,354 @@
+// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package com.android.tools.r8.desugar.nestaccesscontrol;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assume.assumeTrue;
+
+import com.android.tools.r8.TestParameters;
+import com.android.tools.r8.utils.AndroidApiLevel;
+import com.android.tools.r8.utils.StringUtils;
+import com.android.tools.r8.utils.codeinspector.ClassSubject;
+import com.android.tools.r8.utils.codeinspector.CodeInspector;
+import com.android.tools.r8.utils.codeinspector.TypeSubject;
+import com.google.common.collect.ImmutableList;
+import java.util.List;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+@RunWith(Parameterized.class)
+public class NestAttributesInDexShrinkingTest extends NestAttributesInDexTestBase
+    implements Opcodes {
+
+  @Parameter() public TestParameters parameters;
+
+  @Parameters(name = "{0}")
+  public static List<Object[]> data() {
+    return buildParameters(
+        getTestParameters().withAllRuntimes().withAllApiLevelsAlsoForCf().build());
+  }
+
+  private static final String EXPECTED_OUTPUT = StringUtils.lines("Hello, world!");
+
+  @Test
+  public void testRuntime() throws Exception {
+    assumeTrue(
+        parameters.isCfRuntime()
+            && isRuntimeWithNestSupport(parameters.asCfRuntime())
+            && parameters.getApiLevel().isEqualTo(AndroidApiLevel.B));
+    testForJvm()
+        .addProgramClassFileData(
+            dumpHost(ACC_PRIVATE), dumpMember1(ACC_PRIVATE), dumpMember2(ACC_PRIVATE))
+        .run(parameters.getRuntime(), "Host")
+        .assertSuccessWithOutput(EXPECTED_OUTPUT);
+  }
+
+  private void inspect(CodeInspector inspector, boolean expectNestAttributes) {
+    ClassSubject host = inspector.clazz("Host");
+    ClassSubject member1 = inspector.clazz("Host$Member1");
+    ClassSubject member2 = inspector.clazz("Host$Member2");
+    if (expectNestAttributes) {
+      assertEquals(
+          ImmutableList.of(member2.asTypeSubject(), member1.asTypeSubject()),
+          host.getFinalNestMembersAttribute());
+    } else {
+      assertEquals(0, host.getFinalNestMembersAttribute().size());
+    }
+    TypeSubject expectedNestHostAttribute = expectNestAttributes ? host.asTypeSubject() : null;
+    assertEquals(expectedNestHostAttribute, member1.getFinalNestHostAttribute());
+    assertEquals(expectedNestHostAttribute, member2.getFinalNestHostAttribute());
+  }
+
+  private void expectNestAttributes(CodeInspector inspector) {
+    if (parameters.isCfRuntime()) {
+      inspect(inspector, true);
+    } else {
+      // TODO(b/236125275): DEX should also have the nest attributes.
+      expectNoNestAttributes(inspector);
+    }
+  }
+
+  private void expectNoNestAttributes(CodeInspector inspector) {
+    inspect(inspector, false);
+  }
+
+  @Test
+  public void testR8() throws Exception {
+    assumeTrue(parameters.isDexRuntime() || isRuntimeWithNestSupport(parameters.asCfRuntime()));
+    // TODO(b/247047415): Update test when a DEX VM natively supporting nests is added.
+    assertFalse(parameters.getApiLevel().getLevel() > 33);
+    testForR8(parameters.getBackend())
+        .addProgramClassFileData(
+            dumpHost(ACC_PRIVATE), dumpMember1(ACC_PRIVATE), dumpMember2(ACC_PRIVATE))
+        .addKeepMainRule("Host")
+        .setMinApi(parameters.getApiLevel())
+        .addOptionsModification(options -> options.emitNestAnnotationsInDex = true)
+        .compile()
+        .inspect(inspector -> assertEquals(1, inspector.allClasses().size()))
+        .run(parameters.getRuntime(), "Host")
+        .assertSuccessWithOutput(EXPECTED_OUTPUT);
+  }
+
+  @Test
+  public void testR8KeepHostWithPrivateMembers() throws Exception {
+    assumeTrue(parameters.isDexRuntime() || isRuntimeWithNestSupport(parameters.asCfRuntime()));
+    // TODO(b/247047415): Update test when a DEX VM natively supporting nests is added.
+    assertFalse(parameters.getApiLevel().getLevel() > 33);
+    testForR8(parameters.getBackend())
+        .addProgramClassFileData(
+            dumpHost(ACC_PRIVATE), dumpMember1(ACC_PRIVATE), dumpMember2(ACC_PRIVATE))
+        .setMinApi(parameters.getApiLevel())
+        .addOptionsModification(options -> options.emitNestAnnotationsInDex = true)
+        .addKeepMainRule("Host")
+        .addKeepClassAndMembersRules("Host", "Host$Member1", "Host$Member2")
+        .compile()
+        .inspect(this::expectNestAttributes)
+        .run(parameters.getRuntime(), "Host")
+        .applyIf(
+            parameters.isCfRuntime(),
+            r -> r.assertSuccessWithOutput(EXPECTED_OUTPUT),
+            r -> r.assertFailureWithErrorThatThrows(IllegalAccessError.class));
+  }
+
+  @Test
+  public void testR8KeepHostWithPublicMembers() throws Exception {
+    assumeTrue(parameters.isDexRuntime() || isRuntimeWithNestSupport(parameters.asCfRuntime()));
+    // TODO(b/247047415): Update test when a DEX VM natively supporting nests is added.
+    assertFalse(parameters.getApiLevel().getLevel() > 33);
+    testForR8(parameters.getBackend())
+        .addProgramClassFileData(
+            dumpHost(ACC_PUBLIC), dumpMember1(ACC_PUBLIC), dumpMember2(ACC_PUBLIC))
+        .setMinApi(parameters.getApiLevel())
+        .addOptionsModification(options -> options.emitNestAnnotationsInDex = true)
+        .addKeepMainRule("Host")
+        .addKeepClassAndMembersRules("Host", "Host$Member1", "Host$Member2")
+        .compile()
+        .inspect(this::expectNoNestAttributes)
+        .run(parameters.getRuntime(), "Host")
+        .assertSuccessWithOutput(EXPECTED_OUTPUT);
+  }
+
+  /*
+    Dump of:
+
+    public class Host {
+      public static void main(String[] args) {
+        new Host().h1();
+        System.out.println();
+      }
+
+      static class Member1 {
+        private void m(Host host) {  // private or public
+          host.h2("Hello");
+        }
+      }
+
+      static class Member2 {
+        private void m(Host host) {  // private or public
+          host.h2(", world!");
+        }
+      }
+
+      private void h1() {  // private or public
+        new Member1().m(this);
+        new Member2().m(this);
+      }
+
+      private void h2(String message) {  // private or public
+        System.out.print(message);
+      }
+    }
+
+    compiled with `-target 11`. Not a transformer here, as transforming the javac post nest
+    access methods is not feasible.
+  */
+
+  public static byte[] dumpHost(int methodAccess) throws Exception {
+    assert methodAccess == ACC_PUBLIC || methodAccess == ACC_PRIVATE;
+
+    ClassWriter classWriter = new ClassWriter(0);
+    MethodVisitor methodVisitor;
+
+    classWriter.visit(V11, ACC_PUBLIC | ACC_SUPER, "Host", null, "java/lang/Object", null);
+    classWriter.visitSource("Host.java", null);
+    classWriter.visitNestMember("Host$Member2");
+    classWriter.visitNestMember("Host$Member1");
+    classWriter.visitInnerClass("Host$Member2", "Host", "Member2", ACC_STATIC);
+    classWriter.visitInnerClass("Host$Member1", "Host", "Member1", ACC_STATIC);
+    {
+      methodVisitor = classWriter.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(1, label0);
+      methodVisitor.visitVarInsn(ALOAD, 0);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(1, 1);
+      methodVisitor.visitEnd();
+    }
+    {
+      methodVisitor =
+          classWriter.visitMethod(
+              ACC_PUBLIC | ACC_STATIC, "main", "([Ljava/lang/String;)V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(3, label0);
+      methodVisitor.visitTypeInsn(NEW, "Host");
+      methodVisitor.visitInsn(DUP);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "Host", "<init>", "()V", false);
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "Host", "h1", "()V", false);
+      Label label1 = new Label();
+      methodVisitor.visitLabel(label1);
+      methodVisitor.visitLineNumber(4, label1);
+      methodVisitor.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "()V", false);
+      Label label2 = new Label();
+      methodVisitor.visitLabel(label2);
+      methodVisitor.visitLineNumber(5, label2);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(2, 1);
+      methodVisitor.visitEnd();
+    }
+    {
+      methodVisitor = classWriter.visitMethod(methodAccess, "h1", "()V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(18, label0);
+      methodVisitor.visitTypeInsn(NEW, "Host$Member1");
+      methodVisitor.visitInsn(DUP);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "Host$Member1", "<init>", "()V", false);
+      methodVisitor.visitVarInsn(ALOAD, 0);
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "Host$Member1", "m", "(LHost;)V", false);
+      Label label1 = new Label();
+      methodVisitor.visitLabel(label1);
+      methodVisitor.visitLineNumber(19, label1);
+      methodVisitor.visitTypeInsn(NEW, "Host$Member2");
+      methodVisitor.visitInsn(DUP);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "Host$Member2", "<init>", "()V", false);
+      methodVisitor.visitVarInsn(ALOAD, 0);
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "Host$Member2", "m", "(LHost;)V", false);
+      Label label2 = new Label();
+      methodVisitor.visitLabel(label2);
+      methodVisitor.visitLineNumber(20, label2);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(2, 1);
+      methodVisitor.visitEnd();
+    }
+    {
+      methodVisitor =
+          classWriter.visitMethod(methodAccess, "h2", "(Ljava/lang/String;)V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(23, label0);
+      methodVisitor.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
+      methodVisitor.visitVarInsn(ALOAD, 1);
+      methodVisitor.visitMethodInsn(
+          INVOKEVIRTUAL, "java/io/PrintStream", "print", "(Ljava/lang/String;)V", false);
+      Label label1 = new Label();
+      methodVisitor.visitLabel(label1);
+      methodVisitor.visitLineNumber(24, label1);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(2, 2);
+      methodVisitor.visitEnd();
+    }
+    classWriter.visitEnd();
+
+    return classWriter.toByteArray();
+  }
+
+  public static byte[] dumpMember1(int methodAccess) throws Exception {
+    assert methodAccess == ACC_PUBLIC || methodAccess == ACC_PRIVATE;
+
+    ClassWriter classWriter = new ClassWriter(0);
+    MethodVisitor methodVisitor;
+
+    classWriter.visit(V11, ACC_SUPER, "Host$Member1", null, "java/lang/Object", null);
+    classWriter.visitSource("Host.java", null);
+    classWriter.visitNestHost("Host");
+    classWriter.visitInnerClass("Host$Member1", "Host", "Member1", ACC_STATIC);
+    {
+      methodVisitor = classWriter.visitMethod(0, "<init>", "()V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(7, label0);
+      methodVisitor.visitVarInsn(ALOAD, 0);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(1, 1);
+      methodVisitor.visitEnd();
+    }
+    {
+      methodVisitor = classWriter.visitMethod(methodAccess, "m", "(LHost;)V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(9, label0);
+      methodVisitor.visitVarInsn(ALOAD, 1);
+      methodVisitor.visitLdcInsn("Hello");
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "Host", "h2", "(Ljava/lang/String;)V", false);
+      Label label1 = new Label();
+      methodVisitor.visitLabel(label1);
+      methodVisitor.visitLineNumber(10, label1);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(2, 2);
+      methodVisitor.visitEnd();
+    }
+    classWriter.visitEnd();
+
+    return classWriter.toByteArray();
+  }
+
+  public static byte[] dumpMember2(int methodAccess) throws Exception {
+    assert methodAccess == ACC_PUBLIC || methodAccess == ACC_PRIVATE;
+
+    ClassWriter classWriter = new ClassWriter(0);
+    MethodVisitor methodVisitor;
+
+    classWriter.visit(V11, ACC_SUPER, "Host$Member2", null, "java/lang/Object", null);
+    classWriter.visitSource("Host.java", null);
+    classWriter.visitNestHost("Host");
+    classWriter.visitInnerClass("Host$Member2", "Host", "Member2", ACC_STATIC);
+    {
+      methodVisitor = classWriter.visitMethod(0, "<init>", "()V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(13, label0);
+      methodVisitor.visitVarInsn(ALOAD, 0);
+      methodVisitor.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(1, 1);
+      methodVisitor.visitEnd();
+    }
+    {
+      methodVisitor = classWriter.visitMethod(methodAccess, "m", "(LHost;)V", null, null);
+      methodVisitor.visitCode();
+      Label label0 = new Label();
+      methodVisitor.visitLabel(label0);
+      methodVisitor.visitLineNumber(14, label0);
+      methodVisitor.visitVarInsn(ALOAD, 1);
+      methodVisitor.visitLdcInsn(", world!");
+      methodVisitor.visitMethodInsn(INVOKEVIRTUAL, "Host", "h2", "(Ljava/lang/String;)V", false);
+      methodVisitor.visitInsn(RETURN);
+      methodVisitor.visitMaxs(2, 2);
+      methodVisitor.visitEnd();
+    }
+    classWriter.visitEnd();
+
+    return classWriter.toByteArray();
+  }
+}
diff --git a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTest.java b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTest.java
index a64d07c..25f211f 100644
--- a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTest.java
+++ b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTest.java
@@ -9,13 +9,9 @@
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeTrue;
 
-import com.android.tools.r8.TestBase;
 import com.android.tools.r8.TestParameters;
 import com.android.tools.r8.TestRunResult;
-import com.android.tools.r8.TestRuntime;
-import com.android.tools.r8.TestRuntime.CfRuntime;
 import com.android.tools.r8.TestRuntime.CfVm;
-import com.android.tools.r8.TestRuntime.DexRuntime;
 import com.android.tools.r8.desugar.nestaccesscontrol.NestAttributesInDexTest.Host.Member1;
 import com.android.tools.r8.desugar.nestaccesscontrol.NestAttributesInDexTest.Host.Member2;
 import com.android.tools.r8.transformers.ClassFileTransformer;
@@ -40,7 +36,7 @@
 import org.objectweb.asm.Opcodes;
 
 @RunWith(Parameterized.class)
-public class NestAttributesInDexTest extends TestBase {
+public class NestAttributesInDexTest extends NestAttributesInDexTestBase {
 
   @Parameter() public TestParameters parameters;
 
@@ -64,23 +60,6 @@
           "false", "false", "true", "false", "false", "false", "false", "false", "true", "false",
           "false", "true", "true", "true");
 
-  private boolean isRuntimeWithNestSupport(TestRuntime runtime) {
-    if (runtime.isCf()) {
-      return isRuntimeWithNestSupport(runtime.asCf());
-    } else {
-      return isRuntimeWithNestSupport(runtime.asDex());
-    }
-  }
-
-  private boolean isRuntimeWithNestSupport(CfRuntime runtime) {
-    return runtime.isNewerThanOrEqual(CfVm.JDK11);
-  }
-
-  private boolean isRuntimeWithNestSupport(DexRuntime runtime) {
-    // No Art versions have support for nest attributes yet.
-    return false;
-  }
-
   private void checkResult(TestRunResult<?> result) {
     if (isRuntimeWithNestSupport(parameters.getRuntime())) {
       result.assertSuccessWithOutput(EXPECTED_OUTPUT);
diff --git a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTestBase.java b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTestBase.java
new file mode 100644
index 0000000..9f67110
--- /dev/null
+++ b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexTestBase.java
@@ -0,0 +1,33 @@
+// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package com.android.tools.r8.desugar.nestaccesscontrol;
+
+import com.android.tools.r8.TestBase;
+import com.android.tools.r8.TestRuntime;
+import com.android.tools.r8.TestRuntime.CfRuntime;
+import com.android.tools.r8.TestRuntime.CfVm;
+import com.android.tools.r8.TestRuntime.DexRuntime;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+public abstract class NestAttributesInDexTestBase extends TestBase {
+
+  protected boolean isRuntimeWithNestSupport(TestRuntime runtime) {
+    if (runtime.isCf()) {
+      return isRuntimeWithNestSupport(runtime.asCf());
+    } else {
+      return isRuntimeWithNestSupport(runtime.asDex());
+    }
+  }
+
+  protected boolean isRuntimeWithNestSupport(CfRuntime runtime) {
+    return runtime.isNewerThanOrEqual(CfVm.JDK11);
+  }
+
+  protected boolean isRuntimeWithNestSupport(DexRuntime runtime) {
+    // No Art versions have support for nest attributes yet.
+    return false;
+  }
+}
