1 ; RUN: opt < %s -sccp -S | FileCheck %s
3 ; CHECK-LABEL: shift_undef_64
4 define void @shift_undef_64(i64* %p) {
5 %r1 = lshr i64 -1, 4294967296 ; 2^32
6 ; CHECK: store i64 undef
9 %r2 = ashr i64 -1, 4294967297 ; 2^32 + 1
10 ; CHECK: store i64 undef
11 store i64 %r2, i64* %p
13 %r3 = shl i64 -1, 4294967298 ; 2^32 + 2
14 ; CHECK: store i64 undef
15 store i64 %r3, i64* %p
20 ; CHECK-LABEL: shift_undef_65
21 define void @shift_undef_65(i65* %p) {
22 %r1 = lshr i65 2, 18446744073709551617
23 ; CHECK: store i65 undef
24 store i65 %r1, i65* %p
26 %r2 = ashr i65 4, 18446744073709551617
27 ; CHECK: store i65 undef
28 store i65 %r2, i65* %p
30 %r3 = shl i65 1, 18446744073709551617
31 ; CHECK: store i65 undef
32 store i65 %r3, i65* %p
37 ; CHECK-LABEL: shift_undef_256
38 define void @shift_undef_256(i256* %p) {
39 %r1 = lshr i256 2, 18446744073709551617
40 ; CHECK: store i256 undef
41 store i256 %r1, i256* %p
43 %r2 = ashr i256 4, 18446744073709551618
44 ; CHECK: store i256 undef
45 store i256 %r2, i256* %p
47 %r3 = shl i256 1, 18446744073709551619
48 ; CHECK: store i256 undef
49 store i256 %r3, i256* %p
54 ; CHECK-LABEL: shift_undef_511
55 define void @shift_undef_511(i511* %p) {
56 %r1 = lshr i511 -1, 1208925819614629174706276 ; 2^80 + 100
57 ; CHECK: store i511 undef
58 store i511 %r1, i511* %p
60 %r2 = ashr i511 -2, 1208925819614629174706200
61 ; CHECK: store i511 undef
62 store i511 %r2, i511* %p
64 %r3 = shl i511 -3, 1208925819614629174706180
65 ; CHECK: store i511 undef
66 store i511 %r3, i511* %p