@@ -12,13 +12,15 @@ declare ptr @llvm.call.preallocated.arg(token, i32)
12
12
@ConstPtr = constant i32 0 , align 4
13
13
@ConstWeakPtr = weak constant i32 0 , align 4
14
14
@ConstWeakODRPtr = weak_odr constant i32 0 , align 4
15
+ @ExtInitZeroInit = externally_initialized constant i32 zeroinitializer , align 4
15
16
16
17
;.
17
18
; CHECK: @str = private unnamed_addr addrspace(4) constant [1 x i8] zeroinitializer, align 1
18
19
; CHECK: @ConstAS3Ptr = addrspace(3) global i32 0, align 4
19
20
; CHECK: @ConstPtr = constant i32 0, align 4
20
21
; CHECK: @ConstWeakPtr = weak constant i32 0, align 4
21
22
; CHECK: @ConstWeakODRPtr = weak_odr constant i32 0, align 4
23
+ ; CHECK: @ExtInitZeroInit = externally_initialized constant i32 0, align 4
22
24
; CHECK: @S = external global %struct.X
23
25
; CHECK: @g = internal constant { [2 x ptr] } { [2 x ptr] [ptr @f1, ptr @f2] }
24
26
; CHECK: @x = external global i32
@@ -1652,6 +1654,23 @@ define i32 @readWeakOdrConst() {
1652
1654
ret i32 %l
1653
1655
}
1654
1656
1657
+ define i32 @readExtInitZeroInit () {
1658
+ ; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
1659
+ ; TUNIT-LABEL: define {{[^@]+}}@readExtInitZeroInit
1660
+ ; TUNIT-SAME: () #[[ATTR2]] {
1661
+ ; TUNIT-NEXT: [[L:%.*]] = load i32, ptr @ExtInitZeroInit, align 4
1662
+ ; TUNIT-NEXT: ret i32 [[L]]
1663
+ ;
1664
+ ; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
1665
+ ; CGSCC-LABEL: define {{[^@]+}}@readExtInitZeroInit
1666
+ ; CGSCC-SAME: () #[[ATTR1]] {
1667
+ ; CGSCC-NEXT: [[L:%.*]] = load i32, ptr @ExtInitZeroInit, align 4
1668
+ ; CGSCC-NEXT: ret i32 [[L]]
1669
+ ;
1670
+ %l = load i32 , ptr @ExtInitZeroInit
1671
+ ret i32 %l
1672
+ }
1673
+
1655
1674
;.
1656
1675
; TUNIT: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1657
1676
; TUNIT: attributes #[[ATTR1]] = { memory(readwrite, argmem: none) }
0 commit comments