[PATCH] D110589: [IntelJITListener] Generalize JIT listener test

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 14:14:11 PDT 2021


andrew.w.kaylor created this revision.
andrew.w.kaylor added reviewers: lhames, bwyma, h-vetinari.
andrew.w.kaylor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change generalizes the checks to allow JIT notification of method load events to pass the test in any order. The order in which method load events are reported doesn't seem to be non-deterministic, but it isn't necessarily stable across versions. This change avoids fragility in the test.

Note that this test is only run if -DLLVM_USE_INTEL_JITEVENTS=ON is used in the CMake configuration.

This address Bugzilla 51859.


https://reviews.llvm.org/D110589

Files:
  llvm/test/JitListener/multiple.ll


Index: llvm/test/JitListener/multiple.ll
===================================================================
--- llvm/test/JitListener/multiple.ll
+++ llvm/test/JitListener/multiple.ll
@@ -1,5 +1,9 @@
 ; Verify the behavior of the IntelJITEventListener.
-; RUN: llvm-jitlistener %s | FileCheck %s
+; As a workaround to avoid problems with list ordering in the notification
+; we run the test three times.
+; RUN: llvm-jitlistener %s | FileCheck --check-prefixes=CHECK-ALL,CHECK-FOO %s
+; RUN: llvm-jitlistener %s | FileCheck --check-prefixes=CHECK-ALL,CHECK-BAR %s
+; RUN: llvm-jitlistener %s | FileCheck --check-prefixes=CHECK-ALL,CHECK-FUBAR %s
 
 ; This test was created using the following file:
 ;
@@ -26,26 +30,26 @@
 ; 21: }
 ;
 
-; CHECK: Method load [1]: bar, Size = {{[0-9]+}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
-
-; CHECK: Method load [2]: foo, Size = {{[0-9]+}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
-
-; CHECK: Method load [3]: fubar, Size = {{[0-9]+}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
-; CHECK:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
-
-; CHECK: Method unload [1]
-; CHECK: Method unload [2]
-; CHECK: Method unload [3]
+; CHECK-BAR: Method load [{{[123]}}]: bar, Size = {{[0-9]+}}
+; CHECK-BAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
+; CHECK-BAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
+; CHECK-BAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
+; CHECK-BAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
+
+; CHECK-FOO: Method load [{{[123]}}]: foo, Size = {{[0-9]+}}
+; CHECK-FOO-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
+; CHECK-FOO-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
+
+; CHECK-FUBAR: Method load [{{[123]}}]: fubar, Size = {{[0-9]+}}
+; CHECK-FUBAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
+; CHECK-FUBAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
+; CHECK-FUBAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
+; CHECK-FUBAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
+; CHECK-FUBAR-NEXT:   Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
+
+; CHECK-ALL: Method unload [1]
+; CHECK-ALL: Method unload [2]
+; CHECK-ALL: Method unload [3]
 
 ; ModuleID = 'multiple.c'
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110589.375402.patch
Type: text/x-patch
Size: 2939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210927/0ea02658/attachment.bin>


More information about the llvm-commits mailing list