Test for the other way also
authorChris Lattner <sabre@nondot.org>
Mon, 23 Feb 2004 20:24:16 +0000 (20:24 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 23 Feb 2004 20:24:16 +0000 (20:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11767 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll

index 911a73f57c2ae7ce0d91aa0ceeb88fdfeb73e7a1..97020c59c7cab048159ffcd9d142f0fceff565a3 100644 (file)
@@ -6,3 +6,10 @@ int %test(int %X) {
        %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
+}