Skip to content

Commit b023c81

Browse files
committed
test the new global asm output of naked functions
1 parent b589049 commit b023c81

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

tests/codegen/naked-fn/naked-functions.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@
66
#![feature(naked_functions)]
77
use std::arch::naked_asm;
88

9-
// CHECK: Function Attrs: naked
10-
// CHECK-NEXT: define{{.*}}void @naked_empty()
9+
// CHECK: module asm ".intel_syntax"
10+
// CHECK: .pushsection .text.naked_empty,\22ax\22, @progbits
11+
// CHECK: .balign 4"
12+
// CHECK: .globl naked_empty"
13+
// CHECK: .hidden naked_empty"
14+
// CHECK: .type naked_empty, @function"
15+
// CHECK-LABEL: naked_empty:
16+
// CHECK: ret
17+
// CHECK: .popsection
18+
// CHECK: .att_syntax
19+
1120
#[no_mangle]
1221
#[naked]
1322
pub unsafe extern "C" fn naked_empty() {
@@ -17,8 +26,19 @@ pub unsafe extern "C" fn naked_empty() {
1726
naked_asm!("ret");
1827
}
1928

20-
// CHECK: Function Attrs: naked
21-
// CHECK-NEXT: define{{.*}}i{{[0-9]+}} @naked_with_args_and_return(i64 %0, i64 %1)
29+
// CHECK: .intel_syntax
30+
// CHECK: .pushsection .text.naked_with_args_and_return,\22ax\22, @progbits
31+
// CHECK: .balign 4
32+
// CHECK: .globl naked_with_args_and_return
33+
// CHECK: .hidden naked_with_args_and_return
34+
// CHECK: .type naked_with_args_and_return, @function
35+
// CHECK-LABEL: naked_with_args_and_return:
36+
// CHECK: lea rax, [rdi + rsi]
37+
// CHECK: ret
38+
// CHECK: .size naked_with_args_and_return, . - naked_with_args_and_return
39+
// CHECK: .popsection
40+
// CHECK: .att_syntax
41+
2242
#[no_mangle]
2343
#[naked]
2444
pub unsafe extern "C" fn naked_with_args_and_return(a: isize, b: isize) -> isize {

0 commit comments

Comments
 (0)