]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/global_asm_x2.rs
Refactor away `inferred_obligations` from the trait selector
[rust.git] / src / test / codegen / global_asm_x2.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-mipsel
21 // ignore-mips64
22 // ignore-mips64el
23 // ignore-msp430
24 // ignore-powerpc64
25 // ignore-powerpc64le
26 // ignore-powerpc
27 // ignore-r600
28 // ignore-amdgcn
29 // ignore-sparc
30 // ignore-sparcv9
31 // ignore-sparcel
32 // ignore-s390x
33 // ignore-tce
34 // ignore-thumb
35 // ignore-thumbeb
36 // ignore-xcore
37 // ignore-nvptx
38 // ignore-nvptx64
39 // ignore-le32
40 // ignore-le64
41 // ignore-amdil
42 // ignore-amdil64
43 // ignore-hsail
44 // ignore-hsail64
45 // ignore-spir
46 // ignore-spir64
47 // ignore-kalimba
48 // ignore-shave
49 // ignore-wasm32
50 // ignore-wasm64
51 // ignore-emscripten
52 // compile-flags: -C no-prepopulate-passes
53
54 #![feature(global_asm)]
55 #![crate_type = "lib"]
56 #[no_std]
57
58 // CHECK-LABEL: foo
59 // CHECK: module asm
60 // CHECK: module asm "{{[[:space:]]+}}jmp baz"
61 // any other global_asm will be appended to this first block, so:
62 // CHECK-LABEL: bar
63 // CHECK: module asm "{{[[:space:]]+}}jmp quux"
64 global_asm!(r#"
65     .global foo
66 foo:
67     jmp baz
68 "#);
69
70 extern "C" {
71     fn foo();
72 }
73
74 // CHECK-LABEL: @baz
75 #[no_mangle]
76 pub unsafe extern "C" fn baz() {}
77
78 // no checks here; this has been appended to the first occurrence
79 global_asm!(r#"
80     .global bar
81 bar:
82     jmp quux
83 "#);
84
85 extern "C" {
86     fn bar();
87 }
88
89 #[no_mangle]
90 pub unsafe extern "C" fn quux() {}