Ensure bitcode encoding of instructions and their operands stays stable.
[oota-llvm.git] / test / Bitcode / bitwiseInstructions.3.2.ll
1 ; RUN:  llvm-dis < %s.bc| FileCheck %s\r
2 \r
3 ; bitwiseOperations.3.2.ll.bc was generated by passing this file to llvm-as-3.2.\r
4 ; The test checks that LLVM does not misread bitwise instructions from\r
5 ; older bitcode files.\r
6 \r
7 define void @shl(i8 %x1){\r
8 entry:\r
9 ; CHECK: %res1 = shl i8 %x1, %x1\r
10   %res1 = shl i8 %x1, %x1\r
11   \r
12 ; CHECK: %res2 = shl nuw i8 %x1, %x1\r
13   %res2 = shl nuw i8 %x1, %x1\r
14   \r
15 ; CHECK: %res3 = shl nsw i8 %x1, %x1\r
16   %res3 = shl nsw i8 %x1, %x1\r
17 \r
18 ; CHECK: %res4 = shl nuw nsw i8 %x1, %x1\r
19   %res4 = shl nuw nsw i8 %x1, %x1\r
20   \r
21   ret void\r
22 }\r
23 \r
24 define void @lshr(i8 %x1){\r
25 entry:\r
26 ; CHECK: %res1 = lshr i8 %x1, %x1\r
27   %res1 = lshr i8 %x1, %x1\r
28   \r
29 ; CHECK: %res2 = lshr exact i8 %x1, %x1\r
30   %res2 = lshr exact i8 %x1, %x1\r
31   \r
32   ret void\r
33 }\r
34 \r
35 define void @ashr(i8 %x1){\r
36 entry:\r
37 ; CHECK: %res1 = ashr i8 %x1, %x1\r
38   %res1 = ashr i8 %x1, %x1\r
39 \r
40 ; CHECK-NEXT: %res2 = ashr exact i8 %x1, %x1\r
41   %res2 = ashr exact i8 %x1, %x1\r
42 \r
43   ret void\r
44 }\r
45 \r
46 define void @and(i8 %x1){\r
47 entry:\r
48 ; CHECK: %res1 = and i8 %x1, %x1\r
49   %res1 = and i8 %x1, %x1\r
50   \r
51   ret void\r
52 }\r
53 \r
54 define void @or(i8 %x1){\r
55 entry:\r
56 ; CHECK: %res1 = or i8 %x1, %x1\r
57   %res1 = or i8 %x1, %x1\r
58   \r
59   ret void\r
60 }\r
61 \r
62 define void @xor(i8 %x1){\r
63 entry:\r
64 ; CHECK: %res1 = xor i8 %x1, %x1\r
65   %res1 = xor i8 %x1, %x1\r
66   \r
67   ret void\r
68 }