2 ;; LTO-generated relocatable files may reference _GLOBAL_OFFSET_TABLE_ while
3 ;; the IR does not mention _GLOBAL_OFFSET_TABLE_.
4 ;; Test that there is no spurious "undefined symbol" error.
6 ; RUN: rm -rf %t && mkdir %t && cd %t
7 ; RUN: llvm-as %s -o a.bc
8 ; RUN: ld.lld -pie a.bc -o a
9 ; RUN: llvm-nm a | FileCheck %s
11 ; CHECK: d _GLOBAL_OFFSET_TABLE_
13 target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128"
14 target triple = "i386-pc-linux-gnu"
18 define dso_local void @_start() {
21 %inc = add nsw i32 %0, 1
22 store i32 %inc, ptr @i
26 !llvm.module.flags = !{!0, !1}
28 !0 = !{i32 8, !"PIC Level", i32 2}
29 !1 = !{i32 7, !"PIE Level", i32 2}