PR4737: Fix a nasty bug in load narrowing with non-power-of-two types.
[oota-llvm.git] / test / CodeGen / X86 / 2009-08-19-LoadNarrowingMiscompile.ll
1 ; RUN: llvm-as < %s | llc -march=x86 | FileCheck %s
2
3 @a = external global i96, align 4
4 @b = external global i64, align 8
5
6 define void @c() nounwind {
7 ; CHECK: movl a+8, %eax
8   %srcval1 = load i96* @a, align 4
9   %sroa.store.elt2 = lshr i96 %srcval1, 64
10   %tmp = trunc i96 %sroa.store.elt2 to i64
11 ; CHECK: movl %eax, b
12 ; CHECK: movl $0, b+4
13   store i64 %tmp, i64* @b, align 8
14   ret void
15 }