llvm-6502/test/Bitcode/use-list-order.ll
Duncan P. N. Exon Smith 2602b66b91 Move -verify-use-list-order into llvm-uselistorder
Ugh.  Turns out not even transformation passes link in how to read IR.
I sincerely believe the buildbots will finally agree with my system
after this though.  (I don't really understand why all of this has been
working on my system, but not on all the buildbots.)

Create a new tool called llvm-uselistorder to use for verifying use-list
order.  For now, just dump everything from the (now defunct)
-verify-use-list-order pass into the tool.

This might be a better way to test use-list order anyway.

Part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213957 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25 17:13:03 +00:00

84 lines
1.3 KiB
LLVM

; RUN: llvm-uselistorder < %s -preserve-bc-use-list-order
; XFAIL: *
@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)
define i64 @f(i64 %f) {
entry:
%sum = add i64 %f, 0
ret i64 %sum
}
define i64 @g(i64 %g) {
entry:
%sum = add i64 %g, 0
ret i64 %sum
}
define i64 @h(i64 %h) {
entry:
%sum = add i64 %h, 0
ret i64 %sum
}
define i64 @i(i64 %i) {
entry:
%sum = add i64 %i, 1
ret i64 %sum
}
define i64 @j(i64 %j) {
entry:
%sum = add i64 %j, 1
ret i64 %sum
}
define i64 @k(i64 %k) {
entry:
%sum = add i64 %k, 1
ret i64 %sum
}
define i64 @l(i64 %l) {
entry:
%sum = add i64 %l, 1
ret i64 %sum
}
define i1 @loadb() {
entry:
%b = load i1* @b
ret i1 %b
}
define i1 @loada() {
entry:
%a = load i1* getelementptr ([4 x i1]* @a, i64 0, i64 2)
ret i1 %a
}
define i32 @f32(i32 %a, i32 %b, i32 %c, i32 %d) {
entry:
br label %first
second:
%eh = mul i32 %e, %h
%sum = add i32 %eh, %ef
br label %exit
exit:
%product = phi i32 [%ef, %first], [%sum, %second]
ret i32 %product
first:
%e = add i32 %a, 7
%f = add i32 %b, 7
%g = add i32 %c, 8
%h = add i32 %d, 8
%ef = mul i32 %e, %f
%gh = mul i32 %g, %h
%gotosecond = icmp slt i32 %gh, -9
br i1 %gotosecond, label %second, label %exit
}