UseListOrder: Additional test coverage for r214242
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 23:15:49 +0000 (23:15 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 29 Jul 2014 23:15:49 +0000 (23:15 +0000)
r214242 was subtle enough it really deserves a targeted test with
comments.  This adds some global variables that trigger the relevant
code path.  Sorry this wasn't committed with the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214243 91177308-0d34-0410-b5e6-96231b3b80d8

test/Bitcode/use-list-order.ll

index ac7307b27114efab0f64d8a0b4f0fe0bdc4f7b9c..33cc13edb05ab7675a81a4e779199c125feffea1 100644 (file)
@@ -3,6 +3,20 @@
 @a = global [4 x i1] [i1 0, i1 1, i1 0, i1 1]
 @b = alias i1* getelementptr ([4 x i1]* @a, i64 0, i64 2)
 
+; Check use-list order of constants used by globals.
+@glob1 = global i5 7
+@glob2 = global i5 7
+@glob3 = global i5 7
+
+; Check use-list order between variables and aliases.
+@target = global i3 zeroinitializer
+@alias1 = alias i3* @target
+@alias2 = alias i3* @target
+@alias3 = alias i3* @target
+@var1 = global i3* @target
+@var2 = global i3* @target
+@var3 = global i3* @target
+
 define i64 @f(i64 %f) {
 entry:
   %sum = add i64 %f, 0