aboutsummaryrefslogtreecommitdiffstats
path: root/test/Verifier
diff options
context:
space:
mode:
Diffstat (limited to 'test/Verifier')
-rw-r--r--test/Verifier/2002-11-05-GetelementptrPointers.ll2
-rw-r--r--test/Verifier/2006-10-15-AddrLabel.ll2
-rw-r--r--test/Verifier/2010-08-07-PointerIntrinsic.ll4
-rw-r--r--test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll2
-rw-r--r--test/Verifier/bitcast-address-space-through-gep-2.ll4
-rw-r--r--test/Verifier/bitcast-address-space-through-gep.ll2
-rw-r--r--test/Verifier/dbg.ll18
-rw-r--r--test/Verifier/frameallocate.ll48
-rw-r--r--test/Verifier/frameescape.ll69
-rw-r--r--[-rwxr-xr-x]test/Verifier/inalloca-vararg.ll0
-rw-r--r--test/Verifier/invalid-statepoint.ll20
-rw-r--r--test/Verifier/invalid-statepoint2.ll19
-rw-r--r--test/Verifier/llvm.dbg.declare-address.ll16
-rw-r--r--test/Verifier/llvm.dbg.declare-expression.ll16
-rw-r--r--test/Verifier/llvm.dbg.declare-variable.ll16
-rw-r--r--test/Verifier/llvm.dbg.value-expression.ll16
-rw-r--r--test/Verifier/llvm.dbg.value-value.ll16
-rw-r--r--test/Verifier/llvm.dbg.value-variable.ll16
-rw-r--r--test/Verifier/memcpy.ll9
-rw-r--r--test/Verifier/range-1.ll32
-rw-r--r--test/Verifier/range-2.ll10
-rw-r--r--test/Verifier/recursive-struct-param.ll15
22 files changed, 275 insertions, 77 deletions
diff --git a/test/Verifier/2002-11-05-GetelementptrPointers.ll b/test/Verifier/2002-11-05-GetelementptrPointers.ll
index 66b233e..2dcceda 100644
--- a/test/Verifier/2002-11-05-GetelementptrPointers.ll
+++ b/test/Verifier/2002-11-05-GetelementptrPointers.ll
@@ -5,6 +5,6 @@
; contained WITHIN a structure.
define void @test({i32, i32*} * %X) {
- getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0
+ getelementptr {i32, i32*}, {i32, i32*} * %X, i32 0, i32 1, i32 0
ret void
}
diff --git a/test/Verifier/2006-10-15-AddrLabel.ll b/test/Verifier/2006-10-15-AddrLabel.ll
index decbf5b..bd2c40d 100644
--- a/test/Verifier/2006-10-15-AddrLabel.ll
+++ b/test/Verifier/2006-10-15-AddrLabel.ll
@@ -5,6 +5,6 @@
define i32 @main() {
%foo = call i8* %llvm.stacksave()
%foop = bitcast i8* %foo to label*
- %nret = load label* %foop
+ %nret = load label, label* %foop
br label %nret
}
diff --git a/test/Verifier/2010-08-07-PointerIntrinsic.ll b/test/Verifier/2010-08-07-PointerIntrinsic.ll
index 427eb66..0c0121d 100644
--- a/test/Verifier/2010-08-07-PointerIntrinsic.ll
+++ b/test/Verifier/2010-08-07-PointerIntrinsic.ll
@@ -8,10 +8,10 @@ target triple = "x86-unknown-unknown"
@bb = global [16 x i8] zeroinitializer, align 1
define void @x() nounwind {
L.0:
- %0 = getelementptr [32 x i8]* @aa, i32 0, i32 4
+ %0 = getelementptr [32 x i8], [32 x i8]* @aa, i32 0, i32 4
%1 = bitcast i8* %0 to [16 x i8]*
%2 = bitcast [16 x i8]* %1 to [0 x i8]*
- %3 = getelementptr [16 x i8]* @bb
+ %3 = getelementptr [16 x i8], [16 x i8]* @bb
%4 = bitcast [16 x i8]* %3 to [0 x i8]*
call void @llvm.memcpy.i32([0 x i8]* %2, [0 x i8]* %4, i32 16, i32 1)
br label %return
diff --git a/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll b/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
index ef38d37..6e91164 100644
--- a/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
+++ b/test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
@@ -7,7 +7,7 @@ target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32
; Check that we can find inttoptr -> illegal bitcasts when hidden
; inside constantexpr pointer operands
define i32 addrspace(2)* @illegal_bitcast_inttoptr_as_1_to_2_inside_gep() {
- %cast = getelementptr i32 addrspace(2)* bitcast (i32 addrspace(1)* inttoptr (i32 1234 to i32 addrspace(1)*) to i32 addrspace(2)*), i32 3
+ %cast = getelementptr i32, i32 addrspace(2)* bitcast (i32 addrspace(1)* inttoptr (i32 1234 to i32 addrspace(1)*) to i32 addrspace(2)*), i32 3
ret i32 addrspace(2)* %cast
}
diff --git a/test/Verifier/bitcast-address-space-through-gep-2.ll b/test/Verifier/bitcast-address-space-through-gep-2.ll
index 2ee3942..026df52 100644
--- a/test/Verifier/bitcast-address-space-through-gep-2.ll
+++ b/test/Verifier/bitcast-address-space-through-gep-2.ll
@@ -13,7 +13,7 @@ target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-p3:8:8:8-i1:8:32-i8:8:32-
@bitcast_after_gep_bitcast_gep =
global %struct.Foo1 { i32 addrspace(1)* bitcast
(i32 addrspace(3)* getelementptr
- (i32 addrspace(3)* bitcast
+ (i32, i32 addrspace(3)* bitcast
(i32 addrspace(2)* getelementptr
- ([32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(3)*), i32 3) to i32 addrspace(1)*) }
+ ([32 x i32], [32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(3)*), i32 3) to i32 addrspace(1)*) }
diff --git a/test/Verifier/bitcast-address-space-through-gep.ll b/test/Verifier/bitcast-address-space-through-gep.ll
index 9494420..3d3fb9f 100644
--- a/test/Verifier/bitcast-address-space-through-gep.ll
+++ b/test/Verifier/bitcast-address-space-through-gep.ll
@@ -10,6 +10,6 @@ target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32
; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(1)*'
; Make sure we still reject the bitcast after the value is accessed through a GEP
-@bitcast_after_gep = global %struct.Foo { i32 addrspace(1)* bitcast (i32 addrspace(2)* getelementptr ([32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(1)*) }
+@bitcast_after_gep = global %struct.Foo { i32 addrspace(1)* bitcast (i32 addrspace(2)* getelementptr ([32 x i32], [32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(1)*) }
diff --git a/test/Verifier/dbg.ll b/test/Verifier/dbg.ll
new file mode 100644
index 0000000..3cff1e0
--- /dev/null
+++ b/test/Verifier/dbg.ll
@@ -0,0 +1,18 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+
+define void @foo() {
+entry:
+ br label %exit, !dbg !MDLocation(scope: !MDSubprogram(), inlinedAt: !{})
+; CHECK: inlined-at should be a location
+; CHECK-NEXT: !{{[0-9]+}} = !MDLocation(line: 0, scope: !{{[0-9]+}}, inlinedAt: ![[IA:[0-9]+]])
+; CHECK-NEXT: ![[IA]] = !{}
+
+exit:
+ ret void, !dbg !{}
+; CHECK: invalid !dbg metadata attachment
+; CHECK-NEXT: ret void, !dbg ![[LOC:[0-9]+]]
+; CHECK-NEXT: ![[LOC]] = !{}
+}
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/frameallocate.ll b/test/Verifier/frameallocate.ll
deleted file mode 100644
index e3018db..0000000
--- a/test/Verifier/frameallocate.ll
+++ /dev/null
@@ -1,48 +0,0 @@
-; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-
-declare i8* @llvm.frameallocate(i32)
-declare i8* @llvm.framerecover(i8*, i8*)
-
-define internal void @f() {
- call i8* @llvm.frameallocate(i32 4)
- call i8* @llvm.frameallocate(i32 4)
- ret void
-}
-; CHECK: multiple calls to llvm.frameallocate in one function
-
-define internal void @f_a(i32 %n) {
- call i8* @llvm.frameallocate(i32 %n)
- ret void
-}
-; CHECK: llvm.frameallocate argument must be constant integer size
-
-define internal void @g() {
-entry:
- br label %not_entry
-not_entry:
- call i8* @llvm.frameallocate(i32 4)
- ret void
-}
-; CHECK: llvm.frameallocate used outside of entry block
-
-define internal void @h() {
- call i8* @llvm.framerecover(i8* null, i8* null)
- ret void
-}
-; CHECK: llvm.framerecover first argument must be function defined in this module
-
-@global = constant i8 0
-
-declare void @declaration()
-
-define internal void @i() {
- call i8* @llvm.framerecover(i8* @global, i8* null)
- ret void
-}
-; CHECK: llvm.framerecover first argument must be function defined in this module
-
-define internal void @j() {
- call i8* @llvm.framerecover(i8* bitcast(void()* @declaration to i8*), i8* null)
- ret void
-}
-; CHECK: llvm.framerecover first argument must be function defined in this module
diff --git a/test/Verifier/frameescape.ll b/test/Verifier/frameescape.ll
new file mode 100644
index 0000000..54e0db4
--- /dev/null
+++ b/test/Verifier/frameescape.ll
@@ -0,0 +1,69 @@
+; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+
+declare void @llvm.frameescape(...)
+declare i8* @llvm.framerecover(i8*, i8*, i32)
+
+define internal void @f() {
+ %a = alloca i8
+ call void (...)* @llvm.frameescape(i8* %a)
+ call void (...)* @llvm.frameescape(i8* %a)
+ ret void
+}
+; CHECK: multiple calls to llvm.frameescape in one function
+
+define internal void @g() {
+entry:
+ %a = alloca i8
+ br label %not_entry
+not_entry:
+ call void (...)* @llvm.frameescape(i8* %a)
+ ret void
+}
+; CHECK: llvm.frameescape used outside of entry block
+
+define internal void @h() {
+ call i8* @llvm.framerecover(i8* null, i8* null, i32 0)
+ ret void
+}
+; CHECK: llvm.framerecover first argument must be function defined in this module
+
+@global = constant i8 0
+
+declare void @declaration()
+
+define internal void @i() {
+ call i8* @llvm.framerecover(i8* @global, i8* null, i32 0)
+ ret void
+}
+; CHECK: llvm.framerecover first argument must be function defined in this module
+
+define internal void @j() {
+ call i8* @llvm.framerecover(i8* bitcast(void()* @declaration to i8*), i8* null, i32 0)
+ ret void
+}
+; CHECK: llvm.framerecover first argument must be function defined in this module
+
+define internal void @k(i32 %n) {
+ call i8* @llvm.framerecover(i8* bitcast(void()* @f to i8*), i8* null, i32 %n)
+ ret void
+}
+; CHECK: idx argument of llvm.framerecover must be a constant int
+
+define internal void @l(i8* %b) {
+ %a = alloca i8
+ call void (...)* @llvm.frameescape(i8* %a, i8* %b)
+ ret void
+}
+; CHECK: llvm.frameescape only accepts static allocas
+
+define internal void @m() {
+ %a = alloca i8
+ call void (...)* @llvm.frameescape(i8* %a)
+ ret void
+}
+
+define internal void @n(i8* %fp) {
+ call i8* @llvm.framerecover(i8* bitcast(void ()* @m to i8*), i8* %fp, i32 1)
+ ret void
+}
+; CHECK: all indices passed to llvm.framerecover must be less than the number of arguments passed ot llvm.frameescape in the parent function
diff --git a/test/Verifier/inalloca-vararg.ll b/test/Verifier/inalloca-vararg.ll
index 5099fd1..5099fd1 100755..100644
--- a/test/Verifier/inalloca-vararg.ll
+++ b/test/Verifier/inalloca-vararg.ll
diff --git a/test/Verifier/invalid-statepoint.ll b/test/Verifier/invalid-statepoint.ll
new file mode 100644
index 0000000..7000973
--- /dev/null
+++ b/test/Verifier/invalid-statepoint.ll
@@ -0,0 +1,20 @@
+; RUN: not opt -verify 2>&1 < %s | FileCheck %s
+
+; CHECK: gc.statepoint: mismatch in number of call arguments
+
+declare zeroext i1 @return0i1()
+
+; Function Attrs: nounwind
+declare i32 @llvm.experimental.gc.statepoint.p0f0i1f(i1 ()*, i32, i32, ...) #0
+
+; Function Attrs: nounwind
+declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32) #0
+
+define i32 addrspace(1)* @0(i32 addrspace(1)* %dparam) {
+ %a00 = load i32, i32 addrspace(1)* %dparam
+ %to0 = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f0i1f(i1 ()* @return0i1, i32 9, i32 0, i2 0, i32 addrspace(1)* %dparam)
+ %relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %to0, i32 0, i32 4)
+ ret i32 addrspace(1)* %relocate
+}
+
+attributes #0 = { nounwind }
diff --git a/test/Verifier/invalid-statepoint2.ll b/test/Verifier/invalid-statepoint2.ll
new file mode 100644
index 0000000..0d8b2a8
--- /dev/null
+++ b/test/Verifier/invalid-statepoint2.ll
@@ -0,0 +1,19 @@
+; RUN: not opt -S < %s -verify 2>&1 | FileCheck %s
+
+; CHECK: gc.statepoint: number of deoptimization arguments must be a constant integer
+
+declare void @use(...)
+declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(i32, i32, i32)
+declare i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32, i32, i32)
+declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...)
+declare i32 @"personality_function"()
+
+;; Basic usage
+define i64 addrspace(1)* @test1(i8 addrspace(1)* %arg, i32 %val) gc "statepoint-example" {
+entry:
+ %cast = bitcast i8 addrspace(1)* %arg to i64 addrspace(1)*
+ %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* undef, i32 0, i32 0, i32 %val, i32 0, i32 0, i32 0, i32 10, i32 0, i8 addrspace(1)* %arg, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg, i8 addrspace(1)* %arg)
+ %reloc = call i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(i32 %safepoint_token, i32 9, i32 10)
+ ret i64 addrspace(1)* %reloc
+}
+
diff --git a/test/Verifier/llvm.dbg.declare-address.ll b/test/Verifier/llvm.dbg.declare-address.ll
new file mode 100644
index 0000000..f4a9366
--- /dev/null
+++ b/test/Verifier/llvm.dbg.declare-address.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.declare intrinsic address/value
+; CHECK-NEXT: call void @llvm.dbg.declare({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.declare(metadata !"", metadata !MDLocalVariable(tag: DW_TAG_arg_variable), metadata !MDExpression())
+ ret void
+}
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/llvm.dbg.declare-expression.ll b/test/Verifier/llvm.dbg.declare-expression.ll
new file mode 100644
index 0000000..1121e43
--- /dev/null
+++ b/test/Verifier/llvm.dbg.declare-expression.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.declare intrinsic expression
+; CHECK-NEXT: call void @llvm.dbg.declare({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.declare(metadata i32* %s, metadata !MDLocalVariable(tag: DW_TAG_arg_variable), metadata !"")
+ ret void
+}
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/llvm.dbg.declare-variable.ll b/test/Verifier/llvm.dbg.declare-variable.ll
new file mode 100644
index 0000000..e038243
--- /dev/null
+++ b/test/Verifier/llvm.dbg.declare-variable.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.declare intrinsic variable
+; CHECK-NEXT: call void @llvm.dbg.declare({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.declare(metadata i32* %s, metadata !"", metadata !MDExpression())
+ ret void
+}
+
+declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/llvm.dbg.value-expression.ll b/test/Verifier/llvm.dbg.value-expression.ll
new file mode 100644
index 0000000..c0d14a5
--- /dev/null
+++ b/test/Verifier/llvm.dbg.value-expression.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.value intrinsic expression
+; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.value(metadata i32* %s, i64 0, metadata !MDLocalVariable(tag: DW_TAG_arg_variable), metadata !"")
+ ret void
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/llvm.dbg.value-value.ll b/test/Verifier/llvm.dbg.value-value.ll
new file mode 100644
index 0000000..b64febe
--- /dev/null
+++ b/test/Verifier/llvm.dbg.value-value.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.value intrinsic address/value
+; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.value(metadata !"", i64 0, metadata !MDLocalVariable(tag: DW_TAG_arg_variable), metadata !MDExpression())
+ ret void
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/llvm.dbg.value-variable.ll b/test/Verifier/llvm.dbg.value-variable.ll
new file mode 100644
index 0000000..a87a15c
--- /dev/null
+++ b/test/Verifier/llvm.dbg.value-variable.ll
@@ -0,0 +1,16 @@
+; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s
+; CHECK: invalid llvm.dbg.value intrinsic variable
+; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
+; CHECK-NEXT: !""
+
+define void @foo(i32 %a) {
+entry:
+ %s = alloca i32
+ call void @llvm.dbg.value(metadata i32* %s, i64 0, metadata !"", metadata !MDExpression())
+ ret void
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+
+!llvm.module.flags = !{!0}
+!0 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/test/Verifier/memcpy.ll b/test/Verifier/memcpy.ll
new file mode 100644
index 0000000..bd168cc
--- /dev/null
+++ b/test/Verifier/memcpy.ll
@@ -0,0 +1,9 @@
+; RUN: not opt -verify < %s 2>&1 | FileCheck %s
+
+; CHECK: alignment argument of memory intrinsics must be a power of 2
+
+define void @foo(i8* %P, i8* %Q) {
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %P, i8* %Q, i32 4, i32 3, i1 false)
+ ret void
+}
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
diff --git a/test/Verifier/range-1.ll b/test/Verifier/range-1.ll
index fda65cb..170badc 100644
--- a/test/Verifier/range-1.ll
+++ b/test/Verifier/range-1.ll
@@ -11,7 +11,7 @@ entry:
define i8 @f2(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !1
+ %y = load i8, i8* %x, align 1, !range !1
ret i8 %y
}
!1 = !{}
@@ -19,7 +19,7 @@ entry:
define i8 @f3(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !2
+ %y = load i8, i8* %x, align 1, !range !2
ret i8 %y
}
!2 = !{i8 0}
@@ -27,7 +27,7 @@ entry:
define i8 @f4(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !3
+ %y = load i8, i8* %x, align 1, !range !3
ret i8 %y
}
!3 = !{double 0.0, i8 0}
@@ -35,7 +35,7 @@ entry:
define i8 @f5(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !4
+ %y = load i8, i8* %x, align 1, !range !4
ret i8 %y
}
!4 = !{i8 0, double 0.0}
@@ -43,7 +43,7 @@ entry:
define i8 @f6(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !5
+ %y = load i8, i8* %x, align 1, !range !5
ret i8 %y
}
!5 = !{i32 0, i8 0}
@@ -52,7 +52,7 @@ entry:
define i8 @f7(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !6
+ %y = load i8, i8* %x, align 1, !range !6
ret i8 %y
}
!6 = !{i8 0, i32 0}
@@ -61,7 +61,7 @@ entry:
define i8 @f8(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !7
+ %y = load i8, i8* %x, align 1, !range !7
ret i8 %y
}
!7 = !{i32 0, i32 0}
@@ -70,7 +70,7 @@ entry:
define i8 @f9(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !8
+ %y = load i8, i8* %x, align 1, !range !8
ret i8 %y
}
!8 = !{i8 0, i8 0}
@@ -78,7 +78,7 @@ entry:
define i8 @f10(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !9
+ %y = load i8, i8* %x, align 1, !range !9
ret i8 %y
}
!9 = !{i8 0, i8 2, i8 1, i8 3}
@@ -86,7 +86,7 @@ entry:
define i8 @f11(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !10
+ %y = load i8, i8* %x, align 1, !range !10
ret i8 %y
}
!10 = !{i8 0, i8 2, i8 2, i8 3}
@@ -94,7 +94,7 @@ entry:
define i8 @f12(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !11
+ %y = load i8, i8* %x, align 1, !range !11
ret i8 %y
}
!11 = !{i8 1, i8 2, i8 -1, i8 0}
@@ -102,7 +102,7 @@ entry:
define i8 @f13(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !12
+ %y = load i8, i8* %x, align 1, !range !12
ret i8 %y
}
!12 = !{i8 1, i8 3, i8 5, i8 1}
@@ -110,7 +110,7 @@ entry:
define i8 @f14(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !13
+ %y = load i8, i8* %x, align 1, !range !13
ret i8 %y
}
!13 = !{i8 1, i8 3, i8 5, i8 2}
@@ -118,7 +118,7 @@ entry:
define i8 @f15(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !14
+ %y = load i8, i8* %x, align 1, !range !14
ret i8 %y
}
!14 = !{i8 10, i8 1, i8 12, i8 13}
@@ -126,7 +126,7 @@ entry:
define i8 @f16(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !16
+ %y = load i8, i8* %x, align 1, !range !16
ret i8 %y
}
!16 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
@@ -134,7 +134,7 @@ entry:
define i8 @f17(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !17
+ %y = load i8, i8* %x, align 1, !range !17
ret i8 %y
}
!17 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
diff --git a/test/Verifier/range-2.ll b/test/Verifier/range-2.ll
index f8891c8..b7c9a6e 100644
--- a/test/Verifier/range-2.ll
+++ b/test/Verifier/range-2.ll
@@ -2,35 +2,35 @@
define i8 @f1(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !0
+ %y = load i8, i8* %x, align 1, !range !0
ret i8 %y
}
!0 = !{i8 0, i8 1}
define i8 @f2(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !1
+ %y = load i8, i8* %x, align 1, !range !1
ret i8 %y
}
!1 = !{i8 255, i8 1}
define i8 @f3(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !2
+ %y = load i8, i8* %x, align 1, !range !2
ret i8 %y
}
!2 = !{i8 1, i8 3, i8 5, i8 42}
define i8 @f4(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !3
+ %y = load i8, i8* %x, align 1, !range !3
ret i8 %y
}
!3 = !{i8 -1, i8 0, i8 1, i8 2}
define i8 @f5(i8* %x) {
entry:
- %y = load i8* %x, align 1, !range !4
+ %y = load i8, i8* %x, align 1, !range !4
ret i8 %y
}
!4 = !{i8 -1, i8 0, i8 1, i8 -2}
diff --git a/test/Verifier/recursive-struct-param.ll b/test/Verifier/recursive-struct-param.ll
new file mode 100644
index 0000000..4b280a0
--- /dev/null
+++ b/test/Verifier/recursive-struct-param.ll
@@ -0,0 +1,15 @@
+; RUN: opt -verify < %s
+
+%struct.__sFILE = type { %struct.__sFILE }
+
+@.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00", align 1
+
+; Function Attrs: nounwind ssp
+define void @test(%struct.__sFILE* %stream, i8* %str) {
+ %fputs = call i32 @fputs(i8* %str, %struct.__sFILE* %stream)
+ ret void
+}
+
+; Function Attrs: nounwind
+declare i32 @fputs(i8* nocapture, %struct.__sFILE* nocapture)
+