]> git.lizzy.rs Git - rust.git/blob - tests/codegen/no-plt.rs
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / 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:{{.*}}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"