aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-31 14:57:04 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-31 14:57:04 -0800
commiteceba2944f95058ecc432e016652ffdb09c46e6b (patch)
tree6d23119c9ee26bffcbfea8b979aa378ef0cf77e7 /tests
parent8fa566b01a5dea37d0d73e503ed29e4af39687ca (diff)
handle truncation inside ptrtoint when needed, and fix some potential bugs (add proper type to inline mathops with to at the end, and parseInt on bitsLeft in processMathops)
Diffstat (limited to 'tests')
-rw-r--r--tests/cases/ptrtoi64.ll8
-rw-r--r--tests/cases/ptrtoi64.txt2
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/cases/ptrtoi64.ll b/tests/cases/ptrtoi64.ll
index a820efc4..01e466fe 100644
--- a/tests/cases/ptrtoi64.ll
+++ b/tests/cases/ptrtoi64.ll
@@ -4,7 +4,7 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"
-@.str2 = private constant [6 x i8] c"*%d*\0A\00", align 1 ; [#uses=1]
+@.str2 = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1]
; [#uses=1]
declare i32 @puts(i8*)
@@ -17,9 +17,11 @@ entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- %sz.i7 = inttoptr i32 512 to i32* ; [#uses=1 type=i32*]
+ %sz.i7 = inttoptr i32 400 to i32* ; [#uses=1 type=i32*]
%10 = ptrtoint i32* %sz.i7 to i64, !dbg !8557 ; [#uses=1 type=i64] [debug line = 99:3]
%conv5 = trunc i64 %10 to i32, !dbg !8557 ; [#uses=1 type=i32] [debug line = 99:3]
- %55 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i32 %conv5) ; [#uses=0]
+ %11 = ptrtoint i32* %sz.i7 to i8, !dbg !8557 ; [#uses=1 type=i64] [debug line = 99:3]
+ %conv6 = zext i8 %11 to i32, !dbg !8557 ; [#uses=1 type=i32] [debug line = 99:3]
+ %55 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str2, i32 0, i32 0), i32 %conv5, i32 %conv6) ; [#uses=0]
ret i32 0
}
diff --git a/tests/cases/ptrtoi64.txt b/tests/cases/ptrtoi64.txt
index 6e1c004a..605caba1 100644
--- a/tests/cases/ptrtoi64.txt
+++ b/tests/cases/ptrtoi64.txt
@@ -1 +1 @@
-*512*
+*400,144*