From a0cd85b41f02ce5c476612eec182aa1ff3e6fe2b Mon Sep 17 00:00:00 2001 From: Richard Trembecký Date: Fri, 29 Apr 2016 22:33:41 +0200 Subject: test: add versions of some tests for LLVM 3.7 Clone some tests to have their 3.7 version. 'call's, 'load's and 'getelementptr's match the new specification in them. @andreamattavelli: Fixed test cases: BitCastAlias test cases included modification to alias specifications that require LLVM 3.8 [v2] added comments what was changed and why [v3] the new tests are without suffix, the old ones have ".leq36". Signed-off-by: Jiri Slaby --- test/Concrete/ConstantInit.leq36.ll | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 test/Concrete/ConstantInit.leq36.ll (limited to 'test/Concrete/ConstantInit.leq36.ll') diff --git a/test/Concrete/ConstantInit.leq36.ll b/test/Concrete/ConstantInit.leq36.ll new file mode 100644 index 00000000..44f85212 --- /dev/null +++ b/test/Concrete/ConstantInit.leq36.ll @@ -0,0 +1,60 @@ +; REQUIRES: lt-llvm-3.7 +; RUN: %S/ConcreteTest.py --klee='%klee' --lli=%lli %s + +%struct.dirent = type { i64, i64, i16, i8 } +declare void @print_i64(i64) + +define void @test_constant_vector_simple() { + 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 parsed as ConstantDataSequential + 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 void +} + +define void @test_constant_vector_complex() { +entry: + ; Create a vector using an uncommon type: i1024: Force usage of constant vector + %a = alloca <2 x i1024> + store <2 x i1024> , <2 x i1024>* %a, align 8 + + br label %exit +exit: + ; Print first initialized element + %idx = getelementptr <2 x i1024>* %a, i32 0, i32 0 + %narrow = bitcast i1024* %idx to i64* + %val = load i64* %narrow + call void @print_i64(i64 %val) + + ; Print second initialized element + %idx2 = getelementptr <2 x i1024>* %a, i32 0, i32 1 + %narrow2 = bitcast i1024* %idx2 to i64* + %val2 = load i64* %narrow2 + call void @print_i64(i64 %val2) + + ret void +} + +define i32 @main() { +entry: + call void @test_constant_vector_simple() + call void @test_constant_vector_complex() + + br label %exit +exit: + ret i32 0 +} -- cgit 1.4.1