diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-29 14:30:09 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-29 14:33:58 -0800 |
commit | bf2b465c022dfafa47ab485a6d4dc666cf951f26 (patch) | |
tree | 9f376f540a14ad4b21b239a8c0b51bd70d57a982 /tests/cases | |
parent | 6fc5fed5b060a4397af2f1a1b7ee6a375949e4c9 (diff) |
add testcase for i96 shifts
Diffstat (limited to 'tests/cases')
-rw-r--r-- | tests/cases/i96shiftnon32_ta2.ll | 41 | ||||
-rw-r--r-- | tests/cases/i96shiftnon32_ta2.txt | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/cases/i96shiftnon32_ta2.ll b/tests/cases/i96shiftnon32_ta2.ll new file mode 100644 index 00000000..89f0d6d9 --- /dev/null +++ b/tests/cases/i96shiftnon32_ta2.ll @@ -0,0 +1,41 @@ +; ModuleID = '/tmp/tmpxFUbAg/test_emcc1.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 = "le32-unknown-nacl" + +%struct.c_s = type { i8, float, i32 } + +@.str = private unnamed_addr constant [12 x i8] c"RESULT: %d\0A\00", align 1 + +define internal fastcc void @f2(%struct.c_s* noalias nocapture sret %agg.result) nounwind { + %agg.result.1 = getelementptr inbounds %struct.c_s* %agg.result, i32 0, i32 1 + store float 0.000000e+00, float* %agg.result.1, align 4 + %agg.result.2 = getelementptr inbounds %struct.c_s* %agg.result, i32 0, i32 2 + store i32 43110, i32* %agg.result.2, align 4 + ret void +} + +define internal fastcc void @f1(%struct.c_s* nocapture %tp) nounwind { + %1 = alloca %struct.c_s, align 8 + call fastcc void @f2(%struct.c_s* sret %1) + %2 = bitcast %struct.c_s* %1 to i96* + %srcval1 = load i96* %2, align 8 + %3 = lshr i96 %srcval1, 4 + %4 = shl i96 %3, 2 + %5 = bitcast %struct.c_s* %tp to i96* + store i96 %4, i96* %5, align 4 + ret void +} + +define i32 @main() nounwind { + %t = alloca %struct.c_s, align 4 + %1 = getelementptr inbounds %struct.c_s* %t, i32 0, i32 1 + store float 1.000000e+00, float* %1, align 4 + call fastcc void @f1(%struct.c_s* %t) + %2 = getelementptr inbounds %struct.c_s* %t, i32 0, i32 2 + %3 = load i32* %2, align 4 + %4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 %3) nounwind + ret i32 0 +} + +declare i32 @printf(i8* nocapture, ...) nounwind + diff --git a/tests/cases/i96shiftnon32_ta2.txt b/tests/cases/i96shiftnon32_ta2.txt new file mode 100644 index 00000000..1e26a65f --- /dev/null +++ b/tests/cases/i96shiftnon32_ta2.txt @@ -0,0 +1 @@ +RESULT: 10777 |