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