summaryrefslogtreecommitdiffstats
path: root/llvm/test/Assembler/ConstantExprNoFold.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-08 19:35:31 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-08 19:35:31 +0000
commit770fd82f390b14f0f245b33d19167ec32727c5d2 (patch)
treea5e93698fa0480071bda6fea2c7ff7d089fb0209 /llvm/test/Assembler/ConstantExprNoFold.ll
parent970ac60573da3cce98934d73f65285bbcbfb5ba3 (diff)
downloadbcm5719-llvm-770fd82f390b14f0f245b33d19167ec32727c5d2.tar.gz
bcm5719-llvm-770fd82f390b14f0f245b33d19167ec32727c5d2.zip
ConstantFold: Zero-sized globals might land on top of another global
A zero sized array is zero sized and might share its address with another global. llvm-svn: 223684
Diffstat (limited to 'llvm/test/Assembler/ConstantExprNoFold.ll')
-rw-r--r--llvm/test/Assembler/ConstantExprNoFold.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Assembler/ConstantExprNoFold.ll b/llvm/test/Assembler/ConstantExprNoFold.ll
index bed58c52ad9..83236d5793b 100644
--- a/llvm/test/Assembler/ConstantExprNoFold.ll
+++ b/llvm/test/Assembler/ConstantExprNoFold.ll
@@ -36,6 +36,12 @@ target datalayout = "p:32:32"
@F = global i1 icmp eq (i32* @weakany, i32* @glob)
@weakany = weak global i32 0
+; Empty globals might end up anywhere, even on top of another global.
+; CHECK: @empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2)
+@empty.1 = external global [0 x i8], align 1
+@empty.2 = external global [0 x i8], align 1
+@empty.cmp = global i1 icmp eq ([0 x i8]* @empty.1, [0 x i8]* @empty.2)
+
; Don't add an inbounds on @glob.a3, since it's not inbounds.
; CHECK: @glob.a3 = alias getelementptr (i32* @glob.a2, i32 1)
@glob = global i32 0
OpenPOWER on IntegriCloud