about summary refs log tree commit diff homepage
path: root/test/Feature/_utils._ll
diff options
context:
space:
mode:
authorRichard Trembecký <richardt@centrum.sk>2016-04-29 22:33:41 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2018-05-24 14:08:27 +0100
commita0cd85b41f02ce5c476612eec182aa1ff3e6fe2b (patch)
treeb7d938116cae4f4a18225e9aef2f8934b761e063 /test/Feature/_utils._ll
parent870f2d6aac35457e7524078a4b4a8b011f84c45c (diff)
downloadklee-a0cd85b41f02ce5c476612eec182aa1ff3e6fe2b.tar.gz
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 <jirislaby@gmail.com>
Diffstat (limited to 'test/Feature/_utils._ll')
-rw-r--r--test/Feature/_utils._ll39
1 files changed, 21 insertions, 18 deletions
diff --git a/test/Feature/_utils._ll b/test/Feature/_utils._ll
index 32a73bb1..d825df3a 100644
--- a/test/Feature/_utils._ll
+++ b/test/Feature/_utils._ll
@@ -1,3 +1,6 @@
+; LLVM 3.7 requires a type as the first argument to 'getelementptr'
+; LLVM 3.7 requires a type as the first argument to 'load'
+
 define i32 @util_make_and_i1(i32 %a, i32 %b) {
         %a_i1 = icmp ne i32 %a, 0
         %b_i1 = icmp ne i32 %b, 0
@@ -17,26 +20,26 @@ define i32 @util_make_or_i1(i32 %a, i32 %b) {
 define i16 @util_make_concat2(i8 %a, i8 %b) {
         %tmp = alloca i16
         %tmp8 = bitcast i16* %tmp to i8*
-        %p0 = getelementptr i8* %tmp8, i32 0
-        %p1 = getelementptr i8* %tmp8, i32 1
+        %p0 = getelementptr i8, i8* %tmp8, i32 0
+        %p1 = getelementptr i8, i8* %tmp8, i32 1
         store i8 %b, i8* %p0
         store i8 %a, i8* %p1
-        %concat = load i16* %tmp
+        %concat = load i16, i16* %tmp
         ret i16 %concat
 }
 
 define i32 @util_make_concat4(i8 %a, i8 %b, i8 %c, i8 %d) {
         %tmp = alloca i32
         %tmp8 = bitcast i32* %tmp to i8*
-        %p0 = getelementptr i8* %tmp8, i32 0
-        %p1 = getelementptr i8* %tmp8, i32 1
-        %p2 = getelementptr i8* %tmp8, i32 2
-        %p3 = getelementptr i8* %tmp8, i32 3
+        %p0 = getelementptr i8, i8* %tmp8, i32 0
+        %p1 = getelementptr i8, i8* %tmp8, i32 1
+        %p2 = getelementptr i8, i8* %tmp8, i32 2
+        %p3 = getelementptr i8, i8* %tmp8, i32 3
         store i8 %d, i8* %p0
         store i8 %c, i8* %p1
         store i8 %b, i8* %p2
         store i8 %a, i8* %p3
-        %concat = load i32* %tmp
+        %concat = load i32, i32* %tmp
         ret i32 %concat
 }
 
@@ -44,14 +47,14 @@ define i64 @util_make_concat8(i8 %a, i8 %b, i8 %c, i8 %d,
                               i8 %e, i8 %f, i8 %g, i8 %h) {
         %tmp = alloca i64
         %tmp8 = bitcast i64* %tmp to i8*
-        %p0 = getelementptr i8* %tmp8, i32 0
-        %p1 = getelementptr i8* %tmp8, i32 1
-        %p2 = getelementptr i8* %tmp8, i32 2
-        %p3 = getelementptr i8* %tmp8, i32 3
-        %p4 = getelementptr i8* %tmp8, i32 4
-        %p5 = getelementptr i8* %tmp8, i32 5
-        %p6 = getelementptr i8* %tmp8, i32 6
-        %p7 = getelementptr i8* %tmp8, i32 7
+        %p0 = getelementptr i8, i8* %tmp8, i32 0
+        %p1 = getelementptr i8, i8* %tmp8, i32 1
+        %p2 = getelementptr i8, i8* %tmp8, i32 2
+        %p3 = getelementptr i8, i8* %tmp8, i32 3
+        %p4 = getelementptr i8, i8* %tmp8, i32 4
+        %p5 = getelementptr i8, i8* %tmp8, i32 5
+        %p6 = getelementptr i8, i8* %tmp8, i32 6
+        %p7 = getelementptr i8, i8* %tmp8, i32 7
         store i8 %h, i8* %p0
         store i8 %g, i8* %p1
         store i8 %f, i8* %p2
@@ -60,7 +63,7 @@ define i64 @util_make_concat8(i8 %a, i8 %b, i8 %c, i8 %d,
         store i8 %c, i8* %p5
         store i8 %b, i8* %p6
         store i8 %a, i8* %p7
-        %concat = load i64* %tmp
+        %concat = load i64, i64* %tmp
         ret i64 %concat
 }
 
@@ -68,4 +71,4 @@ define i32 @util_make_select(i32 %cond, i32 %t, i32 %f) {
         %cond_i1 = icmp ne i32 %cond, 0
         %res = select i1 %cond_i1, i32 %t, i32 %f
         ret i32 %res
-}
\ No newline at end of file
+}