1 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu -relocation-model=pic \
2 ; RUN: | FileCheck -check-prefix=X64 --check-prefix=PIC %s
3 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnu \
4 ; RUN: | FileCheck -check-prefix=X64 --check-prefix=STATIC %s
6 define i32 @fp_weakfunc() {
7 ; X64: weakfunc@GOTPCREL(%rip)
8 %s = select i1 icmp ne (ptr @weakfunc, ptr null), i32 1, i32 0
11 declare extern_weak i32 @weakfunc() nonlazybind
13 define void @memset_call(ptr nocapture %a, i8 %c, i32 %n) {
14 ; X64: callq *memset@GOTPCREL(%rip)
15 call void @llvm.memset.p0.i32(ptr %a, i8 %c, i32 %n, i1 false)
19 define void @memcpy_call(ptr nocapture %a, ptr nocapture readonly %b, i64 %n) {
20 ; X64: callq *memcpy@GOTPCREL(%rip)
21 call void @llvm.memcpy.p0.p0.i64(ptr %a, ptr %b, i64 %n, i32 1, i1 false)
26 ; X64: callq *foo@GOTPCREL(%rip)
28 ; STATIC: callq bar@PLT
31 %retval = alloca i32, align 4
32 store i32 0, ptr %retval, align 4
33 %call1 = call i32 @foo()
34 %call2 = call i32 @bar()
35 %call3 = call i32 @baz()
39 declare i32 @foo() nonlazybind
41 declare hidden i32 @baz() nonlazybind
42 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i32, i1)
43 declare void @llvm.memset.p0.i32(ptr nocapture, i8, i32, i1)
45 !llvm.module.flags = !{!1}
46 !1 = !{i32 7, !"RtLibUseGOT", i32 1}