2 // assembly-output: emit-asm
3 // [x64] compile-flags: --target x86_64-unknown-linux-gnu -Crelocation-model=pie
4 // [x64] needs-llvm-components: x86
7 #![feature(no_core, lang_items)]
16 // CHECK-LABEL: call_other_fn:
17 // With PIE local functions are called "directly".
18 // CHECK: {{(jmp|callq)}} other_fn
20 pub fn call_other_fn() -> u8 {
26 // CHECK-LABEL: other_fn:
27 // External functions are still called through GOT, since we don't know if the symbol
28 // is defined in the binary or in the shared library.
29 // CHECK: callq *foreign_fn@GOTPCREL(%rip)
32 pub fn other_fn() -> u8 {
38 extern "C" {fn foreign_fn() -> u8;}