diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 13:54:16 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 13:54:16 -0800 |
commit | 8fa566b01a5dea37d0d73e503ed29e4af39687ca (patch) | |
tree | bcb199a0c8dce88c83b87ab7ce834fc3a95dbd2d /tests | |
parent | c3af81d6df7de206890b5f1a9f9e67bb7a02d1aa (diff) |
support ptrtoint into i64 in i64 mode 1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cases/ptrtoi64.ll | 25 | ||||
-rw-r--r-- | tests/cases/ptrtoi64.txt | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/cases/ptrtoi64.ll b/tests/cases/ptrtoi64.ll new file mode 100644 index 00000000..a820efc4 --- /dev/null +++ b/tests/cases/ptrtoi64.ll @@ -0,0 +1,25 @@ +; pointer to i64, then to i32 + +; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' +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] + +; [#uses=1] +declare i32 @puts(i8*) + +declare i32 @printf(i8* noalias, ...) nounwind + +; [#uses=0] +define i32 @main() { +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*] + %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] + ret i32 0 +} diff --git a/tests/cases/ptrtoi64.txt b/tests/cases/ptrtoi64.txt new file mode 100644 index 00000000..6e1c004a --- /dev/null +++ b/tests/cases/ptrtoi64.txt @@ -0,0 +1 @@ +*512* |