Skip to content

Conversation

vitalybuka
Copy link
Collaborator

No description provided.

Created using spr 1.3.4
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 5, 2024

@llvm/pr-subscribers-clang

Author: Vitaly Buka (vitalybuka)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/87732.diff

1 Files Affected:

  • (modified) clang/test/CodeGen/remote-traps.c (+20-1)
diff --git a/clang/test/CodeGen/remote-traps.c b/clang/test/CodeGen/remote-traps.c
index b12c2c6e23b2d1..4be72ab0ea6eea 100644
--- a/clang/test/CodeGen/remote-traps.c
+++ b/clang/test/CodeGen/remote-traps.c
@@ -9,7 +9,7 @@
 // CHECK-NEXT:    [[TMP1:%.*]] = extractvalue { i32, i1 } [[TMP0]], 1, !nosanitize [[META2]]
 // CHECK-NEXT:    br i1 [[TMP1]], label [[TRAP:%.*]], label [[CONT:%.*]], !nosanitize [[META2]]
 // CHECK:       trap:
-// CHECK-NEXT:    tail call void @llvm.ubsantrap(i8 0) #[[ATTR3:[0-9]+]], !nosanitize [[META2]]
+// CHECK-NEXT:    tail call void @llvm.ubsantrap(i8 0) #[[ATTR5:[0-9]+]], !nosanitize [[META2]]
 // CHECK-NEXT:    unreachable, !nosanitize [[META2]]
 // CHECK:       cont:
 // CHECK-NEXT:    [[TMP2:%.*]] = extractvalue { i32, i1 } [[TMP0]], 0, !nosanitize [[META2]]
@@ -29,9 +29,28 @@ int test(int x) {
   return x + 123;
 }
 
+// CHECK-LABEL: define dso_local noundef i32 @test_runtime(
+// CHECK-SAME: ) local_unnamed_addr #[[ATTR3:[0-9]+]] {
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:    [[TMP0:%.*]] = tail call i1 @llvm.allow.runtime.check(metadata [[META3:![0-9]+]])
+// CHECK-NEXT:    [[CONV:%.*]] = zext i1 [[TMP0]] to i32
+// CHECK-NEXT:    ret i32 [[CONV]]
+//
+// REMOVE-LABEL: define dso_local noundef i32 @test_runtime(
+// REMOVE-SAME: ) local_unnamed_addr #[[ATTR0]] {
+// REMOVE-NEXT:  entry:
+// REMOVE-NEXT:    [[TMP0:%.*]] = tail call i1 @llvm.allow.runtime.check(metadata [[META3:![0-9]+]])
+// REMOVE-NEXT:    [[CONV:%.*]] = zext i1 [[TMP0]] to i32
+// REMOVE-NEXT:    ret i32 [[CONV]]
+//
+int test_runtime() {
+  return __builtin_allow_runtime_check("mycheck");
+}
 
 //.
 // CHECK: [[META2]] = !{}
+// CHECK: [[META3]] = !{!"mycheck"}
 //.
 // REMOVE: [[META2]] = !{}
+// REMOVE: [[META3]] = !{!"mycheck"}
 //.

@vitalybuka
Copy link
Collaborator Author

Not needed

@vitalybuka vitalybuka closed this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants