aboutsummaryrefslogtreecommitdiffstats
path: root/test/Instrumentation/BoundsChecking/simple.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Instrumentation/BoundsChecking/simple.ll')
-rw-r--r--test/Instrumentation/BoundsChecking/simple.ll48
1 files changed, 24 insertions, 24 deletions
diff --git a/test/Instrumentation/BoundsChecking/simple.ll b/test/Instrumentation/BoundsChecking/simple.ll
index ddacf6d..5fae2f4 100644
--- a/test/Instrumentation/BoundsChecking/simple.ll
+++ b/test/Instrumentation/BoundsChecking/simple.ll
@@ -14,7 +14,7 @@ declare noalias i8* @realloc(i8* nocapture, i64) nounwind
define void @f1() nounwind {
%1 = tail call i8* @malloc(i64 32)
%2 = bitcast i8* %1 to i32*
- %idx = getelementptr inbounds i32* %2, i64 2
+ %idx = getelementptr inbounds i32, i32* %2, i64 2
; CHECK-NOT: trap
store i32 3, i32* %idx, align 4
ret void
@@ -24,7 +24,7 @@ define void @f1() nounwind {
define void @f2() nounwind {
%1 = tail call i8* @malloc(i64 32)
%2 = bitcast i8* %1 to i32*
- %idx = getelementptr inbounds i32* %2, i64 8
+ %idx = getelementptr inbounds i32, i32* %2, i64 8
; CHECK: trap
store i32 3, i32* %idx, align 4
ret void
@@ -34,7 +34,7 @@ define void @f2() nounwind {
define void @f3(i64 %x) nounwind {
%1 = tail call i8* @calloc(i64 4, i64 %x)
%2 = bitcast i8* %1 to i32*
- %idx = getelementptr inbounds i32* %2, i64 8
+ %idx = getelementptr inbounds i32, i32* %2, i64 8
; CHECK: mul i64 4, %
; CHECK: sub i64 {{.*}}, 32
; CHECK-NEXT: icmp ult i64 {{.*}}, 32
@@ -49,27 +49,27 @@ define void @f3(i64 %x) nounwind {
define void @f4(i64 %x) nounwind {
%1 = tail call i8* @realloc(i8* null, i64 %x) nounwind
%2 = bitcast i8* %1 to i32*
- %idx = getelementptr inbounds i32* %2, i64 8
+ %idx = getelementptr inbounds i32, i32* %2, i64 8
; CHECK: trap
- %3 = load i32* %idx, align 4
+ %3 = load i32, i32* %idx, align 4
ret void
}
; CHECK: @f5
define void @f5(i64 %x) nounwind {
- %idx = getelementptr inbounds [8 x i8]* @.str, i64 0, i64 %x
+ %idx = getelementptr inbounds [8 x i8], [8 x i8]* @.str, i64 0, i64 %x
; CHECK: trap
- %1 = load i8* %idx, align 4
+ %1 = load i8, i8* %idx, align 4
ret void
}
define void @f5_as1(i64 %x) nounwind {
; CHECK: @f5_as1
- %idx = getelementptr inbounds [8 x i8] addrspace(1)* @.str_as1, i64 0, i64 %x
+ %idx = getelementptr inbounds [8 x i8], [8 x i8] addrspace(1)* @.str_as1, i64 0, i64 %x
; CHECK: sub i16
- ; CHECK icmp ult i16
+ ; CHECK: icmp ult i16
; CHECK: trap
- %1 = load i8 addrspace(1)* %idx, align 4
+ %1 = load i8, i8 addrspace(1)* %idx, align 4
ret void
}
@@ -77,7 +77,7 @@ define void @f5_as1(i64 %x) nounwind {
define void @f6(i64 %x) nounwind {
%1 = alloca i128
; CHECK-NOT: trap
- %2 = load i128* %1, align 4
+ %2 = load i128, i128* %1, align 4
ret void
}
@@ -86,7 +86,7 @@ define void @f7(i64 %x) nounwind {
%1 = alloca i128, i64 %x
; CHECK: mul i64 16,
; CHECK: trap
- %2 = load i128* %1, align 4
+ %2 = load i128, i128* %1, align 4
ret void
}
@@ -96,7 +96,7 @@ define void @f8() nounwind {
%2 = alloca i128
%3 = select i1 undef, i128* %1, i128* %2
; CHECK-NOT: trap
- %4 = load i128* %3, align 4
+ %4 = load i128, i128* %3, align 4
ret void
}
@@ -105,7 +105,7 @@ define void @f9(i128* %arg) nounwind {
%1 = alloca i128
%2 = select i1 undef, i128* %arg, i128* %1
; CHECK-NOT: trap
- %3 = load i128* %2, align 4
+ %3 = load i128, i128* %2, align 4
ret void
}
@@ -117,25 +117,25 @@ define void @f10(i64 %x, i64 %y) nounwind {
; CHECK: select
; CHECK: select
; CHECK: trap
- %4 = load i128* %3, align 4
+ %4 = load i128, i128* %3, align 4
ret void
}
; CHECK: @f11
define void @f11(i128* byval %x) nounwind {
%1 = bitcast i128* %x to i8*
- %2 = getelementptr inbounds i8* %1, i64 16
+ %2 = getelementptr inbounds i8, i8* %1, i64 16
; CHECK: br label
- %3 = load i8* %2, align 4
+ %3 = load i8, i8* %2, align 4
ret void
}
; CHECK: @f11_as1
define void @f11_as1(i128 addrspace(1)* byval %x) nounwind {
%1 = bitcast i128 addrspace(1)* %x to i8 addrspace(1)*
- %2 = getelementptr inbounds i8 addrspace(1)* %1, i16 16
+ %2 = getelementptr inbounds i8, i8 addrspace(1)* %1, i16 16
; CHECK: br label
- %3 = load i8 addrspace(1)* %2, align 4
+ %3 = load i8, i8 addrspace(1)* %2, align 4
ret void
}
@@ -144,8 +144,8 @@ define i64 @f12(i64 %x, i64 %y) nounwind {
%1 = tail call i8* @calloc(i64 1, i64 %x)
; CHECK: mul i64 %y, 8
%2 = bitcast i8* %1 to i64*
- %3 = getelementptr inbounds i64* %2, i64 %y
- %4 = load i64* %3, align 8
+ %3 = getelementptr inbounds i64, i64* %2, i64 %y
+ %4 = load i64, i64* %3, align 8
ret i64 %4
}
@@ -157,9 +157,9 @@ entry:
dead:
; Self-refential GEPs can occur in dead code.
- %incdec.ptr = getelementptr inbounds i32* %incdec.ptr, i64 1
- ; CHECK: %incdec.ptr = getelementptr inbounds i32* %incdec.ptr
- %l = load i32* %incdec.ptr
+ %incdec.ptr = getelementptr inbounds i32, i32* %incdec.ptr, i64 1
+ ; CHECK: %incdec.ptr = getelementptr inbounds i32, i32* %incdec.ptr
+ %l = load i32, i32* %incdec.ptr
br label %alive
alive: