30 lines · plain
1; REQUIRES: x862;; LTO-generated relocatable files may reference _GLOBAL_OFFSET_TABLE_ while3;; the IR does not mention _GLOBAL_OFFSET_TABLE_.4;; Test that there is no spurious "undefined symbol" error.5 6; RUN: rm -rf %t && mkdir %t && cd %t7; RUN: llvm-as %s -o a.bc8; RUN: ld.lld -pie a.bc -o a9; RUN: llvm-nm a | FileCheck %s10 11; CHECK: d _GLOBAL_OFFSET_TABLE_12 13target 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"14target triple = "i386-pc-linux-gnu"15 16@i = global i32 017 18define dso_local void @_start() {19entry:20 %0 = load i32, ptr @i21 %inc = add nsw i32 %0, 122 store i32 %inc, ptr @i23 ret void24}25 26!llvm.module.flags = !{!0, !1}27 28!0 = !{i32 8, !"PIC Level", i32 2}29!1 = !{i32 7, !"PIE Level", i32 2}30