2017-11-03 08:10:19 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic \
|
2018-01-30 03:37:27 +08:00
|
|
|
; RUN: | FileCheck -check-prefix=X64 --check-prefix=PIC %s
|
2017-11-03 08:10:19 +08:00
|
|
|
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu \
|
2018-01-30 03:37:27 +08:00
|
|
|
; RUN: | FileCheck -check-prefix=X64 --check-prefix=STATIC %s
|
2017-11-03 08:10:19 +08:00
|
|
|
|
2018-01-30 03:37:27 +08:00
|
|
|
define i32 @main() {
|
|
|
|
; X64: callq *foo@GOTPCREL(%rip)
|
|
|
|
; PIC: callq bar@PLT
|
|
|
|
; STATIC: callq bar{{$}}
|
|
|
|
; X64: callq baz
|
2017-11-03 08:10:19 +08:00
|
|
|
|
|
|
|
%retval = alloca i32, align 4
|
|
|
|
store i32 0, i32* %retval, align 4
|
2018-01-30 03:37:27 +08:00
|
|
|
%call1 = call i32 @foo()
|
|
|
|
%call2 = call i32 @bar()
|
|
|
|
%call3 = call i32 @baz()
|
2017-11-03 08:10:19 +08:00
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2018-01-30 03:37:27 +08:00
|
|
|
declare i32 @foo() nonlazybind
|
|
|
|
declare i32 @bar()
|
|
|
|
declare hidden i32 @baz() nonlazybind
|