[compiler-rt] [ctx_profile] Integration test (PR #92456)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 17:01:45 PDT 2024


================
@@ -20,41 +20,70 @@ extern "C" bool __llvm_ctx_profile_fetch(void *Data,
                                                         const ContextNode &));
 
 extern "C" {
-__attribute__((noinline)) void someFunction() { printf("check 2\n"); }
+__attribute__((noinline)) void someFunction(int I) {
+  if (I % 2)
+    printf("check odd\n");
+  else
+    printf("check even\n");
+}
 
 // block inlining because the pre-inliner otherwise will inline this - it's
 // too small.
 __attribute__((noinline)) void the_root() {
   printf("check 1\n");
-  someFunction();
-  someFunction();
+  someFunction(1);
+#pragma nounroll
+  for (auto I = 0; I < 2; ++I) {
+    someFunction(I);
+  }
 }
 }
 
 // Make sure the program actually ran correctly.
 // CHECK: check 1
-// CHECK: check 2
-// CHECK: check 2
+// CHECK: check odd
+// CHECK: check even
----------------
mtrofin wrote:

yup, tightened it.

https://github.com/llvm/llvm-project/pull/92456


More information about the llvm-commits mailing list