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/Feature/ConstantArray.ll | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'test/Feature/ConstantArray.ll') diff --git a/test/Feature/ConstantArray.ll b/test/Feature/ConstantArray.ll index 161b2a16..195b4cb0 100644 --- a/test/Feature/ConstantArray.ll +++ b/test/Feature/ConstantArray.ll @@ -1,3 +1,7 @@ +; LLVM 3.7 requires a type as the first argument to 'getelementptr' +; LLVM 3.7 requires a type as the first argument to 'load' +; LLVM 3.7 no longer accepts '*' with a 'call' +; REQUIRES: geq-llvm-3.7 ; RUN: llvm-as %s -f -o %t1.bc ; RUN: rm -rf %t.klee-out ; RUN: %klee --output-dir=%t.klee-out -disable-opt %t1.bc 2>&1 | FileCheck %s @@ -13,22 +17,22 @@ declare void @klee_print_expr(i8*, ...) define i32 @main() { entry: %a = alloca %struct.dirent - %tmp1 = getelementptr %struct.dirent* %a, i32 0 + %tmp1 = getelementptr %struct.dirent, %struct.dirent* %a, i32 0 %tmp2 = bitcast %struct.dirent* %tmp1 to <2 x i32>* ; Initialize with constant vector store <2 x i32> , <2 x i32>* %tmp2 br label %exit exit: ; Print first initialized element - %idx = getelementptr %struct.dirent* %a, i32 0, i32 0 - %val = load i32* %idx - call void(i8*, ...)* @klee_print_expr(i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0), i32 %val) + %idx = getelementptr %struct.dirent, %struct.dirent* %a, i32 0, i32 0 + %val = load i32, i32* %idx + call void(i8*, ...) @klee_print_expr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i32 %val) ; CHECK: 0:42 ; Print second initialized element - %idx2 = getelementptr %struct.dirent* %a, i32 0, i32 1 - %val2 = load i32* %idx2 - call void(i8*, ...)* @klee_print_expr(i8* getelementptr inbounds ([2 x i8]* @.str2, i32 0, i32 0), i32 %val2) + %idx2 = getelementptr %struct.dirent, %struct.dirent* %a, i32 0, i32 1 + %val2 = load i32, i32* %idx2 + call void(i8*, ...) @klee_print_expr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str2, i32 0, i32 0), i32 %val2) ; CHECK: 1:4096 ; Initialize with constant array @@ -36,16 +40,16 @@ exit: store [2 x i32][i32 7, i32 9], [2 x i32]* %array ; Print first initialized element - %idx3 = getelementptr [2 x i32]* %array, i32 0, i32 0 - %val3 = load i32* %idx3 - call void(i8*, ...)* @klee_print_expr(i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0), i32 %val3) + %idx3 = getelementptr [2 x i32], [2 x i32]* %array, i32 0, i32 0 + %val3 = load i32, i32* %idx3 + call void(i8*, ...) @klee_print_expr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i32 %val3) ; CHECK: 0:7 ; Print second initialized element - %idx4 = getelementptr [2 x i32]* %array, i32 0, i32 1 - %val4 = load i32* %idx4 - call void(i8*, ...)* @klee_print_expr(i8* getelementptr inbounds ([2 x i8]* @.str2, i32 0, i32 0), i32 %val4) + %idx4 = getelementptr [2 x i32], [2 x i32]* %array, i32 0, i32 1 + %val4 = load i32, i32* %idx4 + call void(i8*, ...) @klee_print_expr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str2, i32 0, i32 0), i32 %val4) ; CHECK: 1:9 ret i32 0 -} \ No newline at end of file +} -- cgit 1.4.1