[X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext
[oota-llvm.git] / test / CodeGen / X86 / TruncAssertZext.ll
1 ; RUN: llc < %s -O2 -march=x86-64 | FileCheck %s\r
2 ; Checks that a zeroing mov is inserted for the trunc/zext pair even when\r
3 ; the source of the zext is an AssertSext node\r
4 ; PR20494\r
5 \r
6 define i64 @main(i64 %a) { \r
7 ; CHECK-LABEL: main\r
8 ; CHECK: movl %e{{..}}, %eax\r
9 ; CHECK: ret\r
10   %or = or i64 %a, -2\r
11   %trunc = trunc i64 %or to i32\r
12   br label %l\r
13 l:\r
14   %ext = zext i32 %trunc to i64\r
15   ret i64 %ext\r
16 }\r