1 ;; The same as index-const-prop-gvref.ll, except for PIE.
2 ; RUN: opt -module-summary %s -o %t1.bc
3 ; RUN: opt -module-summary %p/Inputs/index-const-prop-gvref.ll -o %t2.bc
4 ; RUN: llvm-lto2 run -save-temps %t2.bc -r=%t2.bc,b,pl -r=%t2.bc,a,pl \
5 ; RUN: %t1.bc -r=%t1.bc,main,plx -r=%t1.bc,a, -r=%t1.bc,b, -o %t3
6 ; RUN: llvm-dis %t3.2.3.import.bc -o - | FileCheck %s --check-prefix=DEST
8 ;; For PIE, keep dso_local for declarations to enable direct access.
9 ; DEST: @b = external dso_local global ptr
10 ; DEST-NEXT: @a = available_externally dso_local global i32 42, align 4
12 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
13 target triple = "x86_64-unknown-linux-gnu"
15 @a = external global i32
16 @b = external global ptr
19 %p = load ptr, ptr @b, align 8
20 store i32 33, ptr %p, align 4
21 %v = load i32, ptr @a, align 4
25 !llvm.module.flags = !{!0}
27 !0 = !{i32 7, !"PIE Level", i32 2}
28 !1 = !{i32 7, !"PIC Level", i32 2}