summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll
blob: 97020c59c7cab048159ffcd9d142f0fceff565a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 34

int %test(int %X) {
	; Do not fold into shr X, 34, as this uses undefined behavior!
	%Y = shr int %X, ubyte 17
	%Z = shr int %Y, ubyte 17
	ret int %Z
}

int %test2(int %X) {
	; Do not fold into shl X, 34, as this uses undefined behavior!
	%Y = shl int %X, ubyte 17
	%Z = shl int %Y, ubyte 17
	ret int %Z
}