--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java 2019-04-15 16:37:13.367254108 +0200 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java 2019-04-15 16:37:13.083253187 +0200 @@ -288,6 +288,8 @@ if (config.useG1GC) { barriers = graph.getNodes().filter(G1ReferentFieldReadBarrier.class).count() + graph.getNodes().filter(G1PreWriteBarrier.class).count() + graph.getNodes().filter(G1PostWriteBarrier.class).count(); + } else if (config.useEpsilonGC) { + barriers = expectedBarriers; } else { barriers = graph.getNodes().filter(SerialWriteBarrier.class).count(); } @@ -301,6 +303,12 @@ Assert.assertTrue(write.next() instanceof G1PostWriteBarrier); Assert.assertTrue(write.predecessor() instanceof G1PreWriteBarrier); } + } else if (config.useEpsilonGC) { + if (write.getBarrierType() != BarrierType.NONE && write.successors().count() > 0) { + // Membar can follow, so check there are no barriers from other collectors only + Assert.assertFalse(write.next() instanceof G1PostWriteBarrier); + Assert.assertFalse(write.next() instanceof SerialWriteBarrier); + } } else { if (write.getBarrierType() != BarrierType.NONE) { Assert.assertEquals(1, write.successors().count());