Merging r261039:
[oota-llvm.git] / test / CodeGen / X86 / rrlist-livereg-corrutpion.ll
1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3 ; CHECK-LABEL: test
4 define i64 @test(i64 %a, i256 %b, i1 %c) {
5   %u = zext i64 %a to i256
6   %s = add i256 %u, 1
7   %o = trunc i256 %s to i1
8   %j = add i256 %s, 1
9   %i = icmp ule i64 %a, 1
10   %f = select i1 %o, i256 undef, i256 %j
11   %d = select i1 %i, i256 %f, i256 1
12   %e = add i256 %b, 1
13   %n = select i1 %c, i256 %e, i256 %b
14   %m = trunc i256 %n to i64
15   %h = add i64 %m, 1
16   %r = zext i64 %h to i256
17   %v = lshr i256 %d, %r
18   %t = trunc i256 %v to i1
19   %q = shl i256 1, %r
20   %p = and i256 %d, %q
21   %w = icmp ule i256 %n, 1
22   %y = select i1 %t, i256 undef, i256 %p
23   %x = select i1 %w, i256 %y, i256 %d
24   %z = trunc i256 %x to i64
25   ret i64 %z
26 }