summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2007-02-07 22:23:47 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2007-02-07 22:23:47 +0000
commit7914f46db195bb9a432fa925b63f7990d526a4df (patch)
treeeb5bde3a5e3c9397f0144d5dd7ae9040437a0c4e /test/Transforms/InstCombine/2007-02-07-PointerCast.ll
parentbd8251a9a6d4f90065b52e04d15120bc111e56aa (diff)
downloadllvm-7914f46db195bb9a432fa925b63f7990d526a4df.tar.gz
llvm-7914f46db195bb9a432fa925b63f7990d526a4df.tar.bz2
llvm-7914f46db195bb9a432fa925b63f7990d526a4df.tar.xz
This really only affects pointers in high memory, and only llvm 1.9, but make a regression for it anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/2007-02-07-PointerCast.ll')
-rw-r--r--test/Transforms/InstCombine/2007-02-07-PointerCast.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
new file mode 100644
index 0000000000..1f7f199c6b
--- /dev/null
+++ b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
@@ -0,0 +1,28 @@
+;RUN: llvm-upgrade < %s | llvm-as | opt -instcombine |llvm-dis |grep zext
+
+;Make sure the uint isn't removed.
+;instcombine in llvm 1.9 was dropping the uint cast which was causing a sign
+;extend
+;this only affected code with pointers in the high half of memory, so it wasn't
+;noticed much :)
+;compile a kernel though...
+
+target datalayout = "e-p:32:32"
+target endian = little
+target pointersize = 32
+
+%str = internal constant [6 x sbyte] c"%llx\0A\00"
+
+implementation ; Functions:
+
+declare int %printf(sbyte*, ...)
+
+int %main(int %x, sbyte** %a) {
+entry:
+ %tmp = getelementptr [6 x sbyte]* %str, int 0, uint 0
+ %tmp1 = load sbyte** %a
+ %tmp2 = cast sbyte* %tmp1 to uint ; <uint> [#uses=1]
+ %tmp3 = cast uint %tmp2 to long ; <long> [#uses=1]
+ %tmp = call int (sbyte*, ...)* %printf( sbyte* %tmp, long %tmp3 )
+ ret int 0
+}