From 7eaa535d4d58620df9f754e5a778e21813bcc856 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 23 Feb 2004 20:24:16 +0000 Subject: [PATCH] Test for the other way also llvm-svn: 11767 --- .../InstCombine/2004-02-23-ShiftShiftOverflow.ll | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/llvm/test/Regression/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll b/llvm/test/Regression/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll index 911a73f57c2a..97020c59c7ca 100644 --- a/llvm/test/Regression/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll +++ b/llvm/test/Regression/Transforms/InstCombine/2004-02-23-ShiftShiftOverflow.ll @@ -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 +} -- GitLab