Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenOpenCL / ext-int-shift.cl
blob3e6d170a70bd2e02fc166934344e4bcc61612f3f
1 // RUN: %clang_cc1 -triple x86_64-linux-pc -O3 -disable-llvm-passes %s -emit-llvm -o - | FileCheck %s
3 void Shifts(_BitInt(12) E, int i) {
4 E << 99;
5 // CHECK: shl i12 %{{.+}}, 3
7 77 << E;
8 // CHECK: %[[PROM:.+]] = zext i12 %{{.+}} to i32
9 // CHECK: %[[MASK:.+]] = and i32 %[[PROM]], 31
10 // CHECK: shl i32 77, %[[MASK]]
12 E << i;
13 // CHECK: %[[PROM:.+]] = trunc i32 %{{.+}} to i12
14 // CHECK: %[[MASK:.+]] = urem i12 %[[PROM]], 12
15 // CHECK: shl i12 %{{.+}}, %[[MASK]]
17 i << E;
18 // CHECK: %[[PROM:.+]] = zext i12 %{{.+}} to i32
19 // CHECK: %[[MASK:.+]] = and i32 %[[PROM]], 31
20 // CHECK: shl i32 %{{.+}}, %[[MASK]]