Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a8f8c65

Browse files
committedDec 1, 2024
fix the naked-asan test
we get these declarations ``` ; opt level 0 declare x86_intrcc void @page_fault_handler(ptr byval([8 x i8]) align 8, i64) unnamed_addr #1 ; opt level > 0 declare x86_intrcc void @page_fault_handler(ptr noalias nocapture noundef byval([8 x i8]) align 8 dereferenceable(8), i64 noundef) unnamed_addr #1 ``` The space after `i64` in the original regex made the regex not match for opt level 0. Removing the space fixes the issue. ``` declare x86_intrcc void @page_fault_handler(ptr {{.*}}, i64 {{.*}}){{.*}}#[[ATTRS:[0-9]+]] ```
1 parent cf738f6 commit a8f8c65

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎tests/codegen/naked-asan.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ pub fn caller() {
1212
page_fault_handler(1, 2);
1313
}
1414

15-
// CHECK: declare x86_intrcc void @page_fault_handler(ptr {{.*}}, i64 {{.*}}){{.*}}#[[ATTRS:[0-9]+]]
15+
// CHECK: declare x86_intrcc void @page_fault_handler(ptr {{.*}}, i64{{.*}}){{.*}}#[[ATTRS:[0-9]+]]
1616
// CHECK-NOT: memcpy
1717
#[naked]
1818
#[no_mangle]
1919
pub extern "x86-interrupt" fn page_fault_handler(_: u64, _: u64) {
20-
unsafe {
21-
core::arch::naked_asm!("ud2");
22-
}
20+
unsafe { core::arch::naked_asm!("ud2") };
2321
}
2422

2523
// CHECK: #[[ATTRS]] =

0 commit comments

Comments
 (0)
Please sign in to comment.