]>
Commit | Line | Data |
---|---|---|
cc61c64b | 1 | // ignore-aarch64 |
cc61c64b | 2 | // ignore-arm |
cc61c64b | 3 | // ignore-avr |
353b0b11 FG |
4 | // ignore-bpf |
5 | // ignore-bpf | |
cc61c64b XL |
6 | // ignore-hexagon |
7 | // ignore-mips | |
cc61c64b | 8 | // ignore-mips64 |
cc61c64b XL |
9 | // ignore-msp430 |
10 | // ignore-powerpc64 | |
cc61c64b | 11 | // ignore-powerpc |
cc61c64b | 12 | // ignore-sparc |
353b0b11 | 13 | // ignore-sparc64 |
cc61c64b | 14 | // ignore-s390x |
cc61c64b | 15 | // ignore-thumb |
cc61c64b | 16 | // ignore-nvptx64 |
353b0b11 | 17 | // ignore-spirv |
cc61c64b XL |
18 | // ignore-wasm32 |
19 | // ignore-wasm64 | |
20 | // ignore-emscripten | |
21 | // compile-flags: -C no-prepopulate-passes | |
22 | ||
cc61c64b | 23 | #![crate_type = "lib"] |
a2a8927a XL |
24 | #![no_std] |
25 | ||
26 | use core::arch::global_asm; | |
cc61c64b XL |
27 | |
28 | // CHECK-LABEL: foo | |
29 | // CHECK: module asm | |
30 | // CHECK: module asm "{{[[:space:]]+}}jmp baz" | |
31 | // any other global_asm will be appended to this first block, so: | |
32 | // CHECK-LABEL: bar | |
33 | // CHECK: module asm "{{[[:space:]]+}}jmp quux" | |
a2a8927a XL |
34 | global_asm!( |
35 | r#" | |
cc61c64b XL |
36 | .global foo |
37 | foo: | |
38 | jmp baz | |
a2a8927a XL |
39 | "# |
40 | ); | |
cc61c64b XL |
41 | |
42 | extern "C" { | |
43 | fn foo(); | |
44 | } | |
45 | ||
46 | // CHECK-LABEL: @baz | |
47 | #[no_mangle] | |
48 | pub unsafe extern "C" fn baz() {} | |
49 | ||
50 | // no checks here; this has been appended to the first occurrence | |
a2a8927a XL |
51 | global_asm!( |
52 | r#" | |
cc61c64b XL |
53 | .global bar |
54 | bar: | |
55 | jmp quux | |
a2a8927a XL |
56 | "# |
57 | ); | |
cc61c64b XL |
58 | |
59 | extern "C" { | |
60 | fn bar(); | |
61 | } | |
62 | ||
63 | #[no_mangle] | |
64 | pub unsafe extern "C" fn quux() {} |