]> git.lizzy.rs Git - rust.git/blob - tests/codegen/pic-relocation-model.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / codegen / pic-relocation-model.rs
1 // compile-flags: -C relocation-model=pic -Copt-level=0
2
3 #![crate_type = "rlib"]
4
5 // CHECK: define i8 @call_foreign_fn()
6 #[no_mangle]
7 pub fn call_foreign_fn() -> u8 {
8     unsafe {
9         foreign_fn()
10     }
11 }
12
13 // (Allow but do not require `zeroext` here, because it is not worth effort to
14 // spell out which targets have it and which ones do not; see rust#97800.)
15
16 // CHECK: declare{{( zeroext)?}} i8 @foreign_fn()
17 extern "C" {fn foreign_fn() -> u8;}
18
19 // CHECK: !{i32 {{[78]}}, !"PIC Level", i32 2}