diff options
author | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-07-21 00:45:20 -0700 |
commit | c6a4f5e819217e1e12c458aed8e7b122e23a3a58 (patch) | |
tree | 81b7dd2bb4370a392f31d332a566c903b5744764 /test/Verifier | |
parent | 19c6fbb3e8aaf74093afa08013134b61fa08f245 (diff) | |
download | external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.zip external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.gz external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.bz2 |
Update LLVM for rebase to r212749.
Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls
Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
Diffstat (limited to 'test/Verifier')
-rw-r--r-- | test/Verifier/alias.ll | 15 | ||||
-rw-r--r-- | test/Verifier/bitcast-alias-address-space.ll | 10 | ||||
-rw-r--r-- | test/Verifier/comdat.ll | 5 | ||||
-rw-r--r-- | test/Verifier/comdat2.ll | 5 | ||||
-rw-r--r-- | test/Verifier/jumptable.ll | 9 | ||||
-rw-r--r-- | test/Verifier/range-1.ll | 2 | ||||
-rw-r--r-- | test/Verifier/range-2.ll | 30 |
7 files changed, 75 insertions, 1 deletions
diff --git a/test/Verifier/alias.ll b/test/Verifier/alias.ll index e3636bc..ff02a37 100644 --- a/test/Verifier/alias.ll +++ b/test/Verifier/alias.ll @@ -10,3 +10,18 @@ declare void @f() @ga = alias i32* @g ; CHECK: Alias must point to a definition ; CHECK-NEXT: @ga + + +@test2_a = alias i32* @test2_b +@test2_b = alias i32* @test2_a +; CHECK: Aliases cannot form a cycle +; CHECK-NEXT: i32* @test2_a +; CHECK-NEXT: Aliases cannot form a cycle +; CHECK-NEXT: i32* @test2_b + + +@test3_a = global i32 42 +@test3_b = alias weak i32* @test3_a +@test3_c = alias i32* @test3_b +; CHECK: Alias cannot point to a weak alias +; CHECK-NEXT: i32* @test3_c diff --git a/test/Verifier/bitcast-alias-address-space.ll b/test/Verifier/bitcast-alias-address-space.ll new file mode 100644 index 0000000..d9794d9 --- /dev/null +++ b/test/Verifier/bitcast-alias-address-space.ll @@ -0,0 +1,10 @@ +; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s + +; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(1)*' + +target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32" + + +@data = addrspace(2) global i32 27 + +@illegal_alias_data = alias bitcast (i32 addrspace(2)* @data to i32 addrspace(1)*) diff --git a/test/Verifier/comdat.ll b/test/Verifier/comdat.ll new file mode 100644 index 0000000..ca47429 --- /dev/null +++ b/test/Verifier/comdat.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s + +$v = comdat any +@v = common global i32 0, comdat $v +; CHECK: 'common' global may not be in a Comdat! diff --git a/test/Verifier/comdat2.ll b/test/Verifier/comdat2.ll new file mode 100644 index 0000000..23b6cee --- /dev/null +++ b/test/Verifier/comdat2.ll @@ -0,0 +1,5 @@ +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s + +$v = comdat any +@v = private global i32 0, comdat $v +; CHECK: comdat global value has local linkage diff --git a/test/Verifier/jumptable.ll b/test/Verifier/jumptable.ll new file mode 100644 index 0000000..5f4cd3f --- /dev/null +++ b/test/Verifier/jumptable.ll @@ -0,0 +1,9 @@ +; RUN: not llc <%s 2>&1 | FileCheck %s + +define i32 @f() jumptable { + ret i32 0 +} + +; CHECK: Attribute 'jumptable' requires 'unnamed_addr' +; CHECK: i32 ()* @f +; CHECK: LLVM ERROR: Broken function found, compilation aborted! diff --git a/test/Verifier/range-1.ll b/test/Verifier/range-1.ll index b6a75d1..f15ca3f 100644 --- a/test/Verifier/range-1.ll +++ b/test/Verifier/range-1.ll @@ -6,7 +6,7 @@ entry: ret void } !0 = metadata !{i8 0, i8 1} -; CHECK: Ranges are only for loads! +; CHECK: Ranges are only for loads, calls and invokes! ; CHECK-NEXT: store i8 0, i8* %x, align 1, !range !0 define i8 @f2(i8* %x) { diff --git a/test/Verifier/range-2.ll b/test/Verifier/range-2.ll index 8d85d19..1d2e057 100644 --- a/test/Verifier/range-2.ll +++ b/test/Verifier/range-2.ll @@ -34,3 +34,33 @@ entry: ret i8 %y } !4 = metadata !{i8 -1, i8 0, i8 1, i8 -2} + +; We can annotate the range of the return value of a CALL. +define void @call_all(i8* %x) { +entry: + %v1 = call i8 @f1(i8* %x), !range !0 + %v2 = call i8 @f2(i8* %x), !range !1 + %v3 = call i8 @f3(i8* %x), !range !2 + %v4 = call i8 @f4(i8* %x), !range !3 + %v5 = call i8 @f5(i8* %x), !range !4 + ret void +} + +; We can annotate the range of the return value of an INVOKE. +define void @invoke_all(i8* %x) { +entry: + %v1 = invoke i8 @f1(i8* %x) to label %cont unwind label %lpad, !range !0 + %v2 = invoke i8 @f2(i8* %x) to label %cont unwind label %lpad, !range !1 + %v3 = invoke i8 @f3(i8* %x) to label %cont unwind label %lpad, !range !2 + %v4 = invoke i8 @f4(i8* %x) to label %cont unwind label %lpad, !range !3 + %v5 = invoke i8 @f5(i8* %x) to label %cont unwind label %lpad, !range !4 + +cont: + ret void + +lpad: + %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [0 x i8*] zeroinitializer + ret void +} +declare i32 @__gxx_personality_v0(...) |