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 7 8;; For PIE, keep dso_local for declarations to enable direct access. 9; DEST: @b = external dso_local global i32* 10; DEST-NEXT: @a = available_externally dso_local global i32 42, align 4 11 12target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 13target triple = "x86_64-unknown-linux-gnu" 14 15@a = external global i32 16@b = external global i32* 17 18define i32 @main() { 19 %p = load i32*, i32** @b, align 8 20 store i32 33, i32* %p, align 4 21 %v = load i32, i32* @a, align 4 22 ret i32 %v 23} 24 25!llvm.module.flags = !{!0} 26 27!0 = !{i32 7, !"PIE Level", i32 2} 28!1 = !{i32 7, !"PIC Level", i32 2} 29