[compiler-rt] Relax CHECK-NEXT to CHECK for RISC-V (PR #157039)

Jan André Reuter via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 05:19:36 PDT 2025


================
@@ -26,6 +26,31 @@ void test_handler(int32_t fid, XRayEntryType type) {
 int main() {
   __xray_set_handler(test_handler);
   always_instrument();
+#if defined(__riscv)
+  // RISC-V has looser execution ordering; relax CHECK-NEXT to CHECK
+  // CHECK: always instrumented called
+  auto status = __xray_patch();
+  printf("patching status: %d\n", static_cast<int32_t>(status));
+  // CHECK-NEXT: patching status: 1
+  always_instrument();
+  // CHECK: called: {{.*}}, type=0
+  // CHECK: always instrumented called
+  // CHECK: called: {{.*}}, type=1
----------------
Thyre wrote:

This looks weird.
While a looser execution ordering is a valid argument, we should always get the function entry before the function exit. Otherwise, tools relying on a proper sequencing will run into all sorts of issues.

If this is actually not the case, this looks like a bug for me that one would need to take a look at. Unfortunately, I'm not experienced with the XRay internals at all.

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


More information about the llvm-commits mailing list