]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/global_asm.rs
Rollup merge of #49188 - memoryleak47:macro_use_doctest, r=QuietMisdreavus
[rust.git] / src / test / codegen / global_asm.rs
1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-aarch64
12 // ignore-aarch64_be
13 // ignore-arm
14 // ignore-armeb
15 // ignore-avr
16 // ignore-bpfel
17 // ignore-bpfeb
18 // ignore-hexagon
19 // ignore-mips
20 // ignore-mips64
21 // ignore-msp430
22 // ignore-powerpc64
23 // ignore-powerpc64le
24 // ignore-powerpc
25 // ignore-r600
26 // ignore-amdgcn
27 // ignore-sparc
28 // ignore-sparcv9
29 // ignore-sparcel
30 // ignore-s390x
31 // ignore-tce
32 // ignore-thumb
33 // ignore-thumbeb
34 // ignore-xcore
35 // ignore-nvptx
36 // ignore-nvptx64
37 // ignore-le32
38 // ignore-le64
39 // ignore-amdil
40 // ignore-amdil64
41 // ignore-hsail
42 // ignore-hsail64
43 // ignore-spir
44 // ignore-spir64
45 // ignore-kalimba
46 // ignore-shave
47 // ignore-wasm32
48 // ignore-wasm64
49 // ignore-emscripten
50 // compile-flags: -C no-prepopulate-passes
51
52 #![feature(global_asm)]
53 #![crate_type = "lib"]
54
55 // CHECK-LABEL: foo
56 // CHECK: module asm
57 // this regex will capture the correct unconditional branch inst.
58 // CHECK: module asm "{{[[:space:]]+}}jmp baz"
59 global_asm!(r#"
60     .global foo
61 foo:
62     jmp baz
63 "#);
64
65 extern "C" {
66     fn foo();
67 }
68
69 // CHECK-LABEL: @baz
70 #[no_mangle]
71 pub unsafe extern "C" fn baz() {}