1 // RUN: llvm-tblgen %s | FileCheck %s
5 // CHECK: shifted_b = 8
6 // CHECK: shifted_i = 8
10 int shifted_b = !shl(b, 2);
11 int shifted_i = !shl(i, 2);
14 class Int<int value> {
19 def int1022 : Int<1022>;
20 def int1024 : Int<1024>;
24 def v0a : Int<!sub(int1024.Value, int1024.Value)>;
28 def v0b : Int<!and(int1024.Value, 2048)>;
32 def v1 : Int<!and(1025, 1)>;
35 // CHECK: Value = 1019
36 def v1019 : Int<!sub(int1022.Value, 3)>;
39 // CHECK: Value = 1023
40 def v1023 : Int<!or(int1022.Value, 1)>;
42 def v1025 : Int<!add(int1024.Value, 1)>;
44 // CHECK: Value = 1025
48 def v12 : Int<!mul(4, 3)>;
54 // CHECK: Value = 2048
55 def v2048 : Int<!add(int1024.Value, int1024.Value)>;
58 // CHECK: Value = 3072
59 def v3072 : Int<!or(int1024.Value, v2048.Value)>;
67 def v4 : Int<!add(int2.Value, 1, v1.Value)>;
68 def v7 : Int<!or(v1.Value, int2.Value, v4.Value)>;
69 def v1a : Int<!and(v7.Value, 5, v1.Value)>;
73 def v84 : Int<!mul(v12.Value, v7.Value)>;
77 def v9 : Int<!xor(v7.Value, 0x0E)>;
81 def v924 : Int<!mul(v84.Value, 11)>;
85 def v925 : Int<!sub(v924.Value, -1)>;
89 def vneg : Int<!sub(v925.Value, 927)>;