diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-02 15:58:04 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-02 15:58:04 -0800 |
commit | cea99540f38100f56bd99a295ec8b1c8e2c7c7ae (patch) | |
tree | c542a498b22ab64ea75bebe713a6ad7a1be8db4a /tests | |
parent | 3c7497c5809566cce3105e641144f86d231cd4db (diff) |
add test for phi with unreachable source with a 64-bit value
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cases/phinonreachable64.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/cases/phinonreachable64.ll b/tests/cases/phinonreachable64.ll new file mode 100644 index 00000000..41aac5f0 --- /dev/null +++ b/tests/cases/phinonreachable64.ll @@ -0,0 +1,26 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +define i32 @main() { +_entry: + %retval = alloca i32, align 4 + %a12 = zext i1 1 to i64 + br label %_phinode + +_nonreachable: + %b = zext i32 -1 to i64 + br label %_phinode + +_phinode: + %a14 = phi i64 [ %a12, %_entry ], [ %b, %_nonreachable ] + %a14s = trunc i64 %a14 to i32 + %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) + ret i32 %a14s +} + +; [#uses=1] +declare i32 @printf(i8*, ...) + |