xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/2011-12-08-DemandedBitsMiscompile.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=g4 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine void @test(i32* nocapture %x, i64* %xx, i32* %yp) nounwind uwtable ssp {
4*9880d681SAndroid Build Coastguard Workerentry:
5*9880d681SAndroid Build Coastguard Worker  %yy = load i32, i32* %yp
6*9880d681SAndroid Build Coastguard Worker  %y = add i32 %yy, 1
7*9880d681SAndroid Build Coastguard Worker  %z = zext i32 %y to i64
8*9880d681SAndroid Build Coastguard Worker  %z2 = shl i64 %z, 32
9*9880d681SAndroid Build Coastguard Worker  store i64 %z2, i64* %xx, align 4
10*9880d681SAndroid Build Coastguard Worker  ret void
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test:
13*9880d681SAndroid Build Coastguard Worker; CHECK: sldi {{.*}}, {{.*}}, 32
14*9880d681SAndroid Build Coastguard Worker; Note: it's okay if someday CodeGen gets smart enough to optimize out
15*9880d681SAndroid Build Coastguard Worker; the shift.
16*9880d681SAndroid Build Coastguard Worker}
17