about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-13 01:00:17 +0000
committerbors <bors@rust-lang.org>2024-11-13 01:00:17 +0000
commit242f20dc1e95ca8def0ff436d7c844811ae7ac25 (patch)
treea9fa164ffed7bd2076109efa63e9d21c12ea706e /tests
parentb420d923cff05f51eb43f607f5d8dce827eeba97 (diff)
parentd83de7e0c59efeea72088e732f554639276d6f4b (diff)
downloadrust-242f20dc1e95ca8def0ff436d7c844811ae7ac25.tar.gz
rust-242f20dc1e95ca8def0ff436d7c844811ae7ac25.zip
Auto merge of #132972 - matthiaskrgr:rollup-456osr7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #132702 (CFI: Append debug location to CFI blocks)
 - #132851 (Update the doc comment of `ASCII_CASE_MASK`)
 - #132948 (stabilize const_unicode_case_lookup)
 - #132950 (Use GNU ld on m68k-unknown-linux-gnu)
 - #132962 (triagebot: add codegen reviewers)
 - #132966 (stabilize const_option_ext)
 - #132970 (Add tracking issue number to unsigned_nonzero_div_ceil feature)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs b/tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs
new file mode 100644
index 00000000000..df65960dfe0
--- /dev/null
+++ b/tests/codegen/sanitizer/cfi/dbg-location-on-cfi-blocks.rs
@@ -0,0 +1,19 @@
+// Verifies that the parent block's debug information are assigned to the inserted cfi block.
+//
+//@ needs-sanitizer-cfi
+//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static -Cdebuginfo=1
+
+#![crate_type = "lib"]
+
+pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 {
+    // CHECK-LABEL: define{{.*}}foo{{.*}}!dbg !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}}
+    // CHECK:       start:
+    // CHECK:       [[TT:%.+]] = call i1 @llvm.type.test(ptr {{%f|%0}}, metadata !"{{[[:print:]]+}}"), !dbg !{{[0-9]+}}
+    // CHECK-NEXT:  br i1 [[TT]], label %type_test.pass, label %type_test.fail, !dbg !{{[0-9]+}}
+    // CHECK:       type_test.pass:                                   ; preds = %start
+    // CHECK-NEXT:  {{%.+}} = call i32 %f(i32{{.*}} %arg), !dbg !{{[0-9]+}}
+    // CHECK:       type_test.fail:                                   ; preds = %start
+    // CHECK-NEXT:  call void @llvm.trap(), !dbg !{{[0-9]+}}
+    // CHECK-NEXT:  unreachable, !dbg !{{[0-9]+}}
+    f(arg)
+}