From a8fd0b699af4be33ce990c25d3e164d7d391ca25 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Mon, 30 Oct 2017 22:11:00 +0100 Subject: Add test case for constant vector init --- test/Concrete/ConstantInit.ll | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/Concrete/ConstantInit.ll diff --git a/test/Concrete/ConstantInit.ll b/test/Concrete/ConstantInit.ll new file mode 100644 index 00000000..161069df --- /dev/null +++ b/test/Concrete/ConstantInit.ll @@ -0,0 +1,26 @@ +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s + +%struct.dirent = type { i64, i64, i16, i8, [256 x i8] } +declare void @print_i64(i64) + +define i32 @main() { +entry: + %a = alloca %struct.dirent + %tmp1 = getelementptr %struct.dirent* %a, i32 0 + %tmp2 = bitcast %struct.dirent* %tmp1 to <2 x i64>* + ; Initialize with constant vector + store <2 x i64> , <2 x i64>* %tmp2, align 8 + br label %exit +exit: + ; Print first initialized element + %idx = getelementptr %struct.dirent* %a, i32 0, i32 0 + %val = load i64* %idx + call void @print_i64(i64 %val) + + ; Print second initialized element + %idx2 = getelementptr %struct.dirent* %a, i32 0, i32 1 + %val2 = load i64* %idx2 + call void @print_i64(i64 %val2) + + ret i32 0 +} -- cgit 1.4.1