2020-11-24 18:00:00 -06:00
|
|
|
// compile-flags: -C no-prepopulate-passes
|
2016-03-21 15:13:50 -05:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
2016-08-23 22:36:37 -05:00
|
|
|
#![feature(naked_functions)]
|
2016-03-21 15:13:50 -05:00
|
|
|
|
2018-09-26 11:19:55 -05:00
|
|
|
// CHECK: Function Attrs: naked
|
2021-03-27 17:11:24 -05:00
|
|
|
// CHECK-NEXT: define{{.*}}void @naked_empty()
|
2016-03-21 15:13:50 -05:00
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
2017-10-30 12:18:00 -05:00
|
|
|
pub fn naked_empty() {
|
2017-03-08 12:08:09 -06:00
|
|
|
// CHECK-NEXT: {{.+}}:
|
|
|
|
// CHECK-NEXT: ret void
|
2016-03-21 15:13:50 -05:00
|
|
|
}
|
|
|
|
|
2018-09-26 11:19:55 -05:00
|
|
|
// CHECK: Function Attrs: naked
|
2016-03-21 15:13:50 -05:00
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
2021-03-27 17:11:24 -05:00
|
|
|
// CHECK-NEXT: define{{.*}}void @naked_with_args(i{{[0-9]+( %a)?}})
|
2017-10-30 12:18:00 -05:00
|
|
|
pub fn naked_with_args(a: isize) {
|
2017-03-08 12:08:09 -06:00
|
|
|
// CHECK-NEXT: {{.+}}:
|
|
|
|
// CHECK: ret void
|
2016-03-21 15:13:50 -05:00
|
|
|
}
|
|
|
|
|
2018-09-26 11:19:55 -05:00
|
|
|
// CHECK: Function Attrs: naked
|
2021-03-27 17:11:24 -05:00
|
|
|
// CHECK-NEXT: define{{.*}}i{{[0-9]+}} @naked_with_return()
|
2016-03-21 15:13:50 -05:00
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
2017-10-30 12:18:00 -05:00
|
|
|
pub fn naked_with_return() -> isize {
|
2017-03-08 12:08:09 -06:00
|
|
|
// CHECK-NEXT: {{.+}}:
|
|
|
|
// CHECK-NEXT: ret i{{[0-9]+}} 0
|
2016-03-21 15:13:50 -05:00
|
|
|
0
|
|
|
|
}
|
|
|
|
|
2018-09-26 11:19:55 -05:00
|
|
|
// CHECK: Function Attrs: naked
|
2021-03-27 17:11:24 -05:00
|
|
|
// CHECK-NEXT: define{{.*}}i{{[0-9]+}} @naked_with_args_and_return(i{{[0-9]+( %a)?}})
|
2016-03-21 15:13:50 -05:00
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
2017-10-30 12:18:00 -05:00
|
|
|
pub fn naked_with_args_and_return(a: isize) -> isize {
|
2017-03-08 12:08:09 -06:00
|
|
|
// CHECK-NEXT: {{.+}}:
|
2020-11-24 18:00:00 -06:00
|
|
|
// CHECK: ret i{{[0-9]+}} 0
|
|
|
|
0
|
2016-03-21 15:13:50 -05:00
|
|
|
}
|