]> git.lizzy.rs Git - rust.git/blob - tests/codegen/global_asm_x2.rs
Rollup merge of #107756 - RalfJung:miri-out-of-addresses, r=oli-obk
[rust.git] / tests / codegen / global_asm_x2.rs
1 // ignore-aarch64
2 // ignore-aarch64_be
3 // ignore-arm
4 // ignore-armeb
5 // ignore-avr
6 // ignore-bpfel
7 // ignore-bpfeb
8 // ignore-hexagon
9 // ignore-mips
10 // ignore-mips64
11 // ignore-msp430
12 // ignore-powerpc64
13 // ignore-powerpc64le
14 // ignore-powerpc
15 // ignore-r600
16 // ignore-amdgcn
17 // ignore-sparc
18 // ignore-sparcv9
19 // ignore-sparcel
20 // ignore-s390x
21 // ignore-tce
22 // ignore-thumb
23 // ignore-thumbeb
24 // ignore-xcore
25 // ignore-nvptx
26 // ignore-nvptx64
27 // ignore-le32
28 // ignore-le64
29 // ignore-amdil
30 // ignore-amdil64
31 // ignore-hsail
32 // ignore-hsail64
33 // ignore-spir
34 // ignore-spir64
35 // ignore-kalimba
36 // ignore-shave
37 // ignore-wasm32
38 // ignore-wasm64
39 // ignore-emscripten
40 // compile-flags: -C no-prepopulate-passes
41
42 #![crate_type = "lib"]
43 #![no_std]
44
45 use core::arch::global_asm;
46
47 // CHECK-LABEL: foo
48 // CHECK: module asm
49 // CHECK: module asm "{{[[:space:]]+}}jmp baz"
50 // any other global_asm will be appended to this first block, so:
51 // CHECK-LABEL: bar
52 // CHECK: module asm "{{[[:space:]]+}}jmp quux"
53 global_asm!(
54     r#"
55     .global foo
56 foo:
57     jmp baz
58 "#
59 );
60
61 extern "C" {
62     fn foo();
63 }
64
65 // CHECK-LABEL: @baz
66 #[no_mangle]
67 pub unsafe extern "C" fn baz() {}
68
69 // no checks here; this has been appended to the first occurrence
70 global_asm!(
71     r#"
72     .global bar
73 bar:
74     jmp quux
75 "#
76 );
77
78 extern "C" {
79     fn bar();
80 }
81
82 #[no_mangle]
83 pub unsafe extern "C" fn quux() {}