]> git.proxmox.com Git - rustc.git/blob - src/test/codegen/no-plt.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / codegen / no-plt.rs
1 // compile-flags: -C relocation-model=pic -Z plt=no
2
3 #![crate_type = "lib"]
4
5 // We need a function which is normally called through the PLT.
6 extern "C" {
7 // CHECK: Function Attrs: nounwind nonlazybind
8 fn getenv(name: *const u8) -> *mut u8;
9 }
10
11 // Ensure the function gets referenced.
12 pub unsafe fn call_through_plt() -> *mut u8 {
13 getenv(b"\0".as_ptr())
14 }
15
16 // Ensure intrinsics also skip the PLT
17 // CHECK: !"RtLibUseGOT"