Rollup merge of #75224 - Aaron1011:fix/function-arguments-naked, r=Amanieu

Don't call a function in function-arguments-naked.rs

Fixes #75096

It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the `#break` directive works fine without
anything in the function body.
This commit is contained in:
Yuki Okushi 2020-08-08 11:36:02 +09:00 committed by GitHub
commit f5d2ffd7fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,9 @@
// We have to ignore android because of this issue:
// https://github.com/rust-lang/rust/issues/74847
// ignore-android
//
// We need to use inline assembly, so just use one platform
// only-x86_64
// compile-flags:-g
@ -24,6 +27,7 @@
// lldb-command:continue
#![feature(asm)]
#![feature(naked_functions)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
@ -33,8 +37,6 @@ fn main() {
}
#[naked]
fn naked(x: usize, y: usize) {
zzz(); // #break
extern "C" fn naked(x: usize, y: usize) {
unsafe { asm!("ret"); } // #break
}
fn zzz() { () }