declare i80 @llvm.bswap.i80(i80)
-; CHECK: define i16 @W
+; CHECK-LABEL: define i16 @W(
define i16 @W() {
; CHECK: ret i16 256
%Z = call i16 @llvm.bswap.i16( i16 1 ) ; <i16> [#uses=1]
ret i16 %Z
}
-; CHECK: define i32 @X
+; CHECK-LABEL: define i32 @X(
define i32 @X() {
; CHECK: ret i32 16777216
%Z = call i32 @llvm.bswap.i32( i32 1 ) ; <i32> [#uses=1]
ret i32 %Z
}
-; CHECK: define i64 @Y
+; CHECK-LABEL: define i64 @Y(
define i64 @Y() {
; CHECK: ret i64 72057594037927936
%Z = call i64 @llvm.bswap.i64( i64 1 ) ; <i64> [#uses=1]
ret i64 %Z
}
-; CHECK: define i80 @Z
+; CHECK-LABEL: define i80 @Z(
define i80 @Z() {
; CHECK: ret i80 -450681596205739728166896
; 0xA0908070605040302010
}
; This checks if the struct doesn't get non-packed
-; CHECK: define internal <{ i32, i32 }> @test2
+; CHECK-LABEL: define internal <{ i32, i32 }> @test2(
define internal <{ i32, i32 }> @test2(i32 %DEADARG1) {
ret <{ i32, i32 }> <{ i32 1, i32 2 }>
}
%x = load i32* inttoptr (i32 12345 to i32*)
store i32 %x, i32* %p
ret void
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK: store
; CHECK-NOT: store
; CHECK: ret void
store i32 1, i32* @g; <-- This is dead.
store i32 42, i32* @g
ret void
-; CHECK: define void @test3
+; CHECK-LABEL: define void @test3(
; CHECK: store
; CHECK-NOT: store
; CHECK: ret void
%x = load i32* @g; <-- %p and @g could alias
store i32 %x, i32* %p
ret void
-; CHECK: define void @test4
+; CHECK-LABEL: define void @test4(
; CHECK: store
; CHECK: store
; CHECK: ret void
call void @test1f()
store i32 2, i32 *%p
ret void
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK-NOT: store
; CHECK-NEXT: call void
; CHECK-NEXT: store i32 2
br label %lbl_1215
}
-; CHECK: define i32 @fn
+; CHECK-LABEL: define i32 @fn(
; RUN: opt -gvn -S < %s | FileCheck %s
define i32 @f1(i32 %x) {
- ; CHECK: define i32 @f1(
+ ; CHECK-LABEL: define i32 @f1(
bb0:
%cmp = icmp eq i32 %x, 0
br i1 %cmp, label %bb2, label %bb1
}
define i32 @f2(i32 %x) {
- ; CHECK: define i32 @f2(
+ ; CHECK-LABEL: define i32 @f2(
bb0:
%cmp = icmp ne i32 %x, 0
br i1 %cmp, label %bb1, label %bb2
}
define i32 @f3(i32 %x) {
- ; CHECK: define i32 @f3(
+ ; CHECK-LABEL: define i32 @f3(
bb0:
switch i32 %x, label %bb1 [ i32 0, label %bb2]
bb1:
declare void @g(i1)
define void @f4(i8 * %x) {
-; CHECK: define void @f4(
+; CHECK-LABEL: define void @f4(
bb0:
%y = icmp eq i8* null, %x
br i1 %y, label %bb2, label %bb1
call void @use(i8* %a)
%b = load i8* %a
ret i8 %b
-; CHECK: define i8 @test
+; CHECK-LABEL: define i8 @test(
; CHECK: call void @use(i8* %a)
; CHECK-NEXT: ret i8 1
}
; Check that the mere presence of a blockaddress doesn't prevent -globalopt
; from promoting @f to fastcc.
-; CHECK: define{{.*}}fastcc{{.*}}@f
+; CHECK-LABEL: define{{.*}}fastcc{{.*}}@f(
define internal i8* @f() {
ret i8* blockaddress(@f, %L1)
L1:
@G2 = linkonce_odr constant i32 42
define void @foo2() {
-; CHECK: define void @foo2
+; CHECK-LABEL: define void @foo2(
; CHECK-NEXT: store
store i32 1, i32* @G2
ret void
}
define void @foo(i32* %x) {
-; CHECK: define void @foo
+; CHECK-LABEL: define void @foo(
; CHECK: store i32 %1, i32* %x
call void @bar(i32* byval %x)
ret void
define void @outer2(i32 %z, i1 %b) {
; Ensure that after inlining, none of the blocks with a call to @f actually
; make it through inlining.
-; CHECK: define void @outer2
+; CHECK-LABEL: define void @outer2(
; CHECK-NOT: call
; CHECK: ret void
; This previously crashed during inliner cleanup and folding inner return
; instructions. Check that we don't crash and we produce a function with a single
; return instruction due to merging the returns of the inlined function.
-; CHECK: define void @PR12470_outer
+; CHECK-LABEL: define void @PR12470_outer(
; CHECK-NOT: call
; CHECK: ret void
; CHECK-NOT: ret void
}
define i32 @caller1() {
-; CHECK: define i32 @caller1
+; CHECK-LABEL: define i32 @caller1(
; CHECK-NEXT: ret i32 3
%X = call i32 @callee1( i32 10, i32 3 )
define i32 @g() {
entry:
-; CHECK: define i32 @g
+; CHECK-LABEL: define i32 @g(
; CHECK: call i32 @f()
; CHECK-NOT: call i32 @a()
%call = call i32 @f()
define i32 @i() {
entry:
-; CHECK: define i32 @i
+; CHECK-LABEL: define i32 @i(
; CHECK: call i32 @b()
; CHECK-NOT: call i32 @h()
%call = call i32 @h() returns_twice
; rdar://10853263
; Make sure that the callee is still here.
-; CHECK: define i32 @callee
+; CHECK-LABEL: define i32 @callee(
define i32 @callee(i32 %param) {
%yyy = alloca [100000 x i8]
%r = bitcast [100000 x i8]* %yyy to i8*
ret i32 4
}
-; CHECK: define i32 @caller
+; CHECK-LABEL: define i32 @caller(
; CHECK-NEXT: entry:
; CHECK-NOT: alloca
; CHECK: ret
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
target triple = "i386-apple-darwin10.0.0"
-; CHECK: define void @fu1
+; CHECK-LABEL: define void @fu1(
define void @fu1(i32 %parm) nounwind ssp {
%1 = alloca i32, align 4
; CHECK: alloca double*
declare void @bar(double*)
-; CHECK: define void @fu2
+; CHECK-LABEL: define void @fu2(
define void @fu2(i32 %parm) nounwind ssp {
%1 = alloca i32, align 4
%ptr = alloca double*, align 4
%or4 = or i32 or (i32 zext (i1 icmp eq (i32* @g, i32* null) to i32), i32 1), %xor
ret i32 %or4
}
-; CHECK: define i32 @function
+; CHECK-LABEL: define i32 @function(
; Check transforms involving atomic operations
define i32* @test1(i8** %p) {
-; CHECK: define i32* @test1
+; CHECK-LABEL: define i32* @test1(
; CHECK: load atomic i8** %p monotonic, align 8
%c = bitcast i8** %p to i32**
%r = load atomic i32** %c monotonic, align 8
}
define i32 @test2(i32* %p) {
-; CHECK: define i32 @test2
+; CHECK-LABEL: define i32 @test2(
; CHECK: %x = load atomic i32* %p seq_cst, align 4
; CHECK: shl i32 %x, 1
%x = load atomic i32* %p seq_cst, align 4
declare void @bar({i32, i32} %a)
declare i32 @baz(i32 %a)
-; CHECK: define i32 @foo
+; CHECK-LABEL: define i32 @foo(
; CHECK-NOT: extractvalue
define i32 @foo(i32 %a, i32 %b) {
; Instcombine should fold various combinations of insertvalue and extractvalue
ret i32 %v5
}
-; CHECK: define i32 @extract2gep
+; CHECK-LABEL: define i32 @extract2gep(
; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %pair, i32 0, i32 1
; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]]
; CHECK-NEXT: store
ret i32 %E
}
-; CHECK: define i32 @doubleextract2gep
+; CHECK-LABEL: define i32 @doubleextract2gep(
; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %arg, i32 0, i32 1, i32 1
; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]]
; CHECK-NEXT: ret i32 [[LOAD]]
}
; PR16244
-; CHECK: define i1 @test71
+; CHECK-LABEL: define i1 @test71(
; CHECK-NEXT: ret i1 false
define i1 @test71(i8* %x) {
%a = getelementptr i8* %x, i64 8
define void @test1(i8* %a) {
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 100, i32 1, i1 false)
ret void
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK-NEXT: ret void
}
define void @test2(i8* %a) {
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 100, i32 1, i1 true)
ret void
-; CHECK: define void @test2
+; CHECK-LABEL: define void @test2(
; CHECK-NEXT: call void @llvm.memcpy
}
define void @test3(i8* %d, i8* %s) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %d, i8* %s, i64 17179869184, i32 4, i1 false)
ret void
-; CHECK: define void @test3
+; CHECK-LABEL: define void @test3(
; CHECK-NEXT: call void @llvm.memcpy
}
@.str2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
define void @test1(%struct.__sFILE* %stream) nounwind {
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK: call i32 @"fwrite$UNIX2003"
%call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) nounwind
ret void
}
define void @test2(%struct.__sFILE* %stream, i8* %str) nounwind ssp {
-; CHECK: define void @test2
+; CHECK-LABEL: define void @test2(
; CHECK: call i32 @"fputs$UNIX2003"
%call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind
ret void
define <4 x float> @dead_shuffle_elt(<4 x float> %x, <2 x float> %y) nounwind {
entry:
-; CHECK: define <4 x float> @dead_shuffle_elt
+; CHECK-LABEL: define <4 x float> @dead_shuffle_elt(
; CHECK: shufflevector <2 x float> %y, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%shuffle.i = shufflevector <2 x float> %y, <2 x float> %y, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
%shuffle9.i = shufflevector <4 x float> %x, <4 x float> %shuffle.i, <4 x i32> <i32 4, i32 5, i32 2, i32 3>
@.str = private constant [2 x i8] c"y\00"
define i32 @foo() nounwind {
-; CHECK: define i32 @foo
+; CHECK-LABEL: define i32 @foo(
; CHECK: call i32 @strcmp
; CHECK: ret i32 %temp1
}
define i32 @bar() nounwind {
-; CHECK: define i32 @bar
+; CHECK-LABEL: define i32 @bar(
; CHECK: ret i32 0
entry:
; MERGE: @j = global
@j = global i32 0
-; NOARGS: define internal void @main
-; LIST: define internal void @main
-; EMPTYFILE: define internal void @main
-; LIST2: define internal void @main
-; MERGE: define internal void @main
+; NOARGS-LABEL: define internal void @main(
+; LIST-LABEL: define internal void @main(
+; EMPTYFILE-LABEL: define internal void @main(
+; LIST2-LABEL: define internal void @main(
+; MERGE-LABEL: define internal void @main(
define void @main() {
ret void
}
-; NOARGS: define internal void @foo
-; LIST: define void @foo
-; EMPTYFILE: define internal void @foo
-; LIST2: define void @foo
-; MERGE: define void @foo
+; NOARGS-LABEL: define internal void @foo(
+; LIST-LABEL: define void @foo(
+; EMPTYFILE-LABEL: define internal void @foo(
+; LIST2-LABEL: define void @foo(
+; MERGE-LABEL: define void @foo(
define void @foo() {
ret void
}
-; NOARGS: define internal void @bar
-; LIST: define internal void @bar
-; EMPTYFILE: define internal void @bar
-; LIST2: define void @bar
-; MERGE: define void @bar
+; NOARGS-LABEL: define internal void @bar(
+; LIST-LABEL: define internal void @bar(
+; EMPTYFILE-LABEL: define internal void @bar(
+; LIST2-LABEL: define void @bar(
+; MERGE-LABEL: define void @bar(
define void @bar() {
ret void
}
; RUN: opt < %s -internalize -internalize-public-api-list foo -S | FileCheck %s
-; CHECK: define void @foo
+; CHECK-LABEL: define void @foo(
define void @foo() {
ret void
}
-; CHECK: define internal void @zed
+; CHECK-LABEL: define internal void @zed(
define void @zed() {
ret void
}
-; CHECK: define available_externally void @bar
+; CHECK-LABEL: define available_externally void @bar(
define available_externally void @bar() {
ret void
}
end:
ret i32 %val
-; CHECK: define i32 @test1(
+; CHECK-LABEL: define i32 @test1(
; CHECK: load atomic
; CHECK-NEXT: br label %loop
}
end:
ret i32 %val
-; CHECK: define i32 @test2(
+; CHECK-LABEL: define i32 @test2(
; CHECK: load atomic
; CHECK-NEXT: %exitcond = icmp ne
; CHECK-NEXT: br i1 %exitcond, label %end, label %loop
end:
ret i32 %vala
-; CHECK: define i32 @test3(
+; CHECK-LABEL: define i32 @test3(
; CHECK: load atomic i32* %x unordered
; CHECK-NEXT: br label %loop
}
end:
ret i32 %vala
-; CHECK: define i32 @test4(
+; CHECK-LABEL: define i32 @test4(
; CHECK: load atomic i32* %y monotonic
; CHECK-NEXT: store atomic
}
; This loop invariant instruction should be constant folded, not hoisted.
define i32 @test3(i1 %c) {
-; CHECK: define i32 @test3
+; CHECK-LABEL: define i32 @test3(
; CHECK: call void @foo2(i32 6)
%A = load i32* @X ; <i32> [#uses=2]
br label %Loop
declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
define i32 @tak(i32 %x, i32 %y, i32 %z) nounwind ssp {
-; CHECK: define i32 @tak
+; CHECK-LABEL: define i32 @tak(
; CHECK: entry
; CHECK-NEXT: call void @llvm.dbg.value(metadata !{i32 %x}
define void @FindFreeHorzSeg(i64 %startCol, i64 %row, i64* %rowStart) {
; Ensure that the loop increment basic block is rotated into the tail of the
; body, even though it contains a debug intrinsic call.
-; CHECK: define void @FindFreeHorzSeg
+; CHECK-LABEL: define void @FindFreeHorzSeg(
; CHECK: %dec = add
; CHECK-NEXT: tail call void @llvm.dbg.value
; CHECK-NEXT: br i1 %tobool, label %for.cond, label %for.end
}
; Should only end up with one phi.
-; CHECK: define void @test
+; CHECK-LABEL: define void @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label %for.body
; CHECK: for.body:
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
define void @Z4() nounwind {
-; CHECK: define void @Z4
+; CHECK-LABEL: define void @Z4(
bb:
br label %bb3
; Foo.A[i] = Foo.B[i] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias01
+; CHECK-LABEL: define i32 @noAlias01(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; Foo.A[i] = Foo.B[i+10] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias02
+; CHECK-LABEL: define i32 @noAlias02(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; Foo.A[i+10] = Foo.B[i] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias03
+; CHECK-LABEL: define i32 @noAlias03(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; *(PA+i) = *(PB+i) + a;
; return *(PA+a);
; }
-; CHECK: define i32 @noAlias04
+; CHECK-LABEL: define i32 @noAlias04(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
;
; Bar.A[N][i] = Bar.B[N][i] + a;
; return Bar.A[N][a];
; }
-; CHECK: define i32 @noAlias05
+; CHECK-LABEL: define i32 @noAlias05(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; Bar.A[N][i] = Bar.A[N+1][i] + a;
; return Bar.A[N][a];
; }
-; CHECK: define i32 @noAlias06
+; CHECK-LABEL: define i32 @noAlias06(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; Foo.A[SIZE-i-1] = Foo.B[SIZE-i-1] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias07
+; CHECK-LABEL: define i32 @noAlias07(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; Foo.A[SIZE-i-1] = Foo.B[SIZE-i-10] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias08
+; CHECK-LABEL: define i32 @noAlias08(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; Foo.A[SIZE-i-10] = Foo.B[SIZE-i-1] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias09
+; CHECK-LABEL: define i32 @noAlias09(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; *(PA+SIZE-i-1) = *(PB+SIZE-i-1) + a;
; return *(PA+a);
; }
-; CHECK: define i32 @noAlias10
+; CHECK-LABEL: define i32 @noAlias10(
; CHECK-NOT: sub nsw <4 x i32>
; CHECK: ret
;
; Bar.A[N][SIZE-i-1] = Bar.B[N][SIZE-i-1] + a;
; return Bar.A[N][a];
; }
-; CHECK: define i32 @noAlias11
+; CHECK-LABEL: define i32 @noAlias11(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; Bar.A[N][SIZE-i-1] = Bar.A[N+1][SIZE-i-1] + a;
; return Bar.A[N][a];
; }
-; CHECK: define i32 @noAlias12
+; CHECK-LABEL: define i32 @noAlias12(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; Foo.A[i] = Foo.A[i+4] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias13
+; CHECK-LABEL: define i32 @noAlias13(
; CHECK: add nsw <4 x i32>
; CHECK: ret
; Foo.A[SIZE-i-1] = Foo.A[SIZE-i-5] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @noAlias14
+; CHECK-LABEL: define i32 @noAlias14(
; CHECK: sub nsw <4 x i32>
; CHECK: ret
; Foo.A[i] = Foo.B[SIZE-i-1] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @mayAlias01
+; CHECK-LABEL: define i32 @mayAlias01(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; Foo.A[SIZE-i-1] = Foo.B[i] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @mayAlias02
+; CHECK-LABEL: define i32 @mayAlias02(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; *(PA+i) = *(PB+SIZE-i-1) + a;
; return *(PA+a);
; }
-; CHECK: define i32 @mayAlias03
+; CHECK-LABEL: define i32 @mayAlias03(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; Foo.A[i+10] = Foo.B[SIZE-i-1] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @mustAlias01
+; CHECK-LABEL: define i32 @mustAlias01(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; Foo.A[i] = Foo.B[SIZE-i-10] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @mustAlias02
+; CHECK-LABEL: define i32 @mustAlias02(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; Foo.A[i+10] = Foo.B[SIZE-i-10] + a;
; return Foo.A[a];
; }
-; CHECK: define i32 @mustAlias03
+; CHECK-LABEL: define i32 @mustAlias03(
; CHECK-NOT: add nsw <4 x i32>
; CHECK: ret
; Simple retain+release pair deletion, with some intervening control
; flow and harmless instructions.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: entry:
; CHECK: call void @llvm.arc.annotation.bottomup.bbstart(i8** @x, i8** @S_None)
; CHECK: %0 = tail call i8* @objc_retain(i8* %a) #0, !llvm.arc.annotation.bottomup ![[ANN0:[0-9]+]], !llvm.arc.annotation.topdown ![[ANN1:[0-9]+]]
ret void
}
-; CHECK: define void @test1b_imprecise(
+; CHECK-LABEL: define void @test1b_imprecise(
; CHECK: entry:
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW:#[0-9]+]]
; CHECK-NOT: @objc_
; Like test0 but the pointer is passed to an intervening call,
; so the optimization is not safe.
-; CHECK: define void @test2_precise(
+; CHECK-LABEL: define void @test2_precise(
; CHECK: @objc_retain(i8* %a)
; CHECK: @objc_release
; CHECK: }
ret void
}
-; CHECK: define void @test2_imprecise(
+; CHECK-LABEL: define void @test2_imprecise(
; CHECK: @objc_retain(i8* %a)
; CHECK: @objc_release
; CHECK: }
; TODO: For now, assume this can't happen.
-; CHECK: define void @test3_precise(
+; CHECK-LABEL: define void @test3_precise(
; TODO: @objc_retain(i8* %a)
; TODO: @objc_release
; CHECK: }
ret void
}
-; CHECK: define void @test3_imprecise(
+; CHECK-LABEL: define void @test3_imprecise(
; TODO: @objc_retain(i8* %a)
; TODO: @objc_release
; CHECK: }
; Like test0 but the retain is in a loop,
; so the optimization is not safe.
-; CHECK: define void @test4_precise(
+; CHECK-LABEL: define void @test4_precise(
; TODO: @objc_retain(i8* %a)
; TODO: @objc_release
; CHECK: }
ret void
}
-; CHECK: define void @test4_imprecise(
+; CHECK-LABEL: define void @test4_imprecise(
; TODO: @objc_retain(i8* %a)
; TODO: @objc_release
; CHECK: }
; Like test0 but the pointer is conditionally passed to an intervening call,
; so the optimization is not safe.
-; CHECK: define void @test5a(
+; CHECK-LABEL: define void @test5a(
; CHECK: @objc_retain(i8*
; CHECK: @objc_release
; CHECK: }
ret void
}
-; CHECK: define void @test5b(
+; CHECK-LABEL: define void @test5b(
; CHECK: @objc_retain(i8*
; CHECK: @objc_release
; CHECK: }
; retain+release pair deletion, where the release happens on two different
; flow paths.
-; CHECK: define void @test6a(
+; CHECK-LABEL: define void @test6a(
; CHECK: entry:
; CHECK: tail call i8* @objc_retain(
; CHECK: t:
ret void
}
-; CHECK: define void @test6b(
+; CHECK-LABEL: define void @test6b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test6b(i32* %x, i1 %p) nounwind {
ret void
}
-; CHECK: define void @test6c(
+; CHECK-LABEL: define void @test6c(
; CHECK: entry:
; CHECK: tail call i8* @objc_retain(
; CHECK: t:
ret void
}
-; CHECK: define void @test6d(
+; CHECK-LABEL: define void @test6d(
; CHECK: entry:
; CHECK: tail call i8* @objc_retain(
; CHECK: t:
; retain+release pair deletion, where the retain happens on two different
; flow paths.
-; CHECK: define void @test7(
+; CHECK-LABEL: define void @test7(
; CHECK: entry:
; CHECK-NOT: objc_
; CHECK: t:
ret void
}
-; CHECK: define void @test7b(
+; CHECK-LABEL: define void @test7b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test7b(i32* %x, i1 %p) nounwind {
; Like test7, but there's a retain/retainBlock mismatch. Don't delete!
-; CHECK: define void @test7c
+; CHECK-LABEL: define void @test7c(
; CHECK: t:
; CHECK: call i8* @objc_retainBlock
; CHECK: f:
; retain+release pair deletion, where the retain and release both happen on
; different flow paths. Wild!
-; CHECK: define void @test8a(
+; CHECK-LABEL: define void @test8a(
; CHECK: entry:
; CHECK: t:
; CHECK: @objc_retain
ret void
}
-; CHECK: define void @test8b(
+; CHECK-LABEL: define void @test8b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test8b(i32* %x, i1 %p, i1 %q) nounwind {
ret void
}
-; CHECK: define void @test8c(
+; CHECK-LABEL: define void @test8c(
; CHECK: entry:
; CHECK: t:
; CHECK: @objc_retain
ret void
}
-; CHECK: define void @test8d(
+; CHECK-LABEL: define void @test8d(
; CHECK: entry:
; CHECK: t:
; CHECK: @objc_retain
; Trivial retain+release pair deletion.
-; CHECK: define void @test9(
+; CHECK-LABEL: define void @test9(
; CHECK-NOT: @objc_
; CHECK: }
define void @test9(i8* %x) nounwind {
; Retain+release pair, but on an unknown pointer relationship. Don't delete!
-; CHECK: define void @test9b
+; CHECK-LABEL: define void @test9b(
; CHECK: @objc_retain(i8* %x)
; CHECK: @objc_release(i8* %s)
; CHECK: }
; Trivial retain+release pair with intervening calls - don't delete!
-; CHECK: define void @test10(
+; CHECK-LABEL: define void @test10(
; CHECK: @objc_retain(i8* %x)
; CHECK: @callee
; CHECK: @use_pointer
; Also, add a tail keyword, since objc_retain can never be passed
; a stack argument.
-; CHECK: define void @test11(
+; CHECK-LABEL: define void @test11(
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
; CHECK: }
; Same as test11 but with no use_pointer call. Delete the pair!
-; CHECK: define void @test11a(
+; CHECK-LABEL: define void @test11a(
; CHECK: entry:
; CHECK-NEXT: ret void
; CHECK: }
; since if the frontend emitted code for an __autoreleasing variable, we may
; want it to be in the autorelease pool.
-; CHECK: define i8* @test11b(
+; CHECK-LABEL: define i8* @test11b(
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
; CHECK: }
; Trivial retain,release pair with intervening call, but it's dominated
; by another retain - delete!
-; CHECK: define void @test12(
+; CHECK-LABEL: define void @test12(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retain(i8* %x)
; CHECK-NOT: @objc_
; Trivial retain,autorelease pair. Don't delete!
-; CHECK: define void @test13(
+; CHECK-LABEL: define void @test13(
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
; CHECK: tail call i8* @objc_retain(i8* %x) [[NUW]]
; CHECK: @use_pointer(i8* %x)
; Delete the retain+release pair.
-; CHECK: define void @test13b
+; CHECK-LABEL: define void @test13b(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retain(i8* %x)
; CHECK-NEXT: @use_pointer
; Don't delete the retain+release pair because there's an
; autoreleasePoolPop in the way.
-; CHECK: define void @test13c
+; CHECK-LABEL: define void @test13c(
; CHECK: @objc_retain(i8* %x)
; CHECK: @objc_autoreleasePoolPop
; CHECK: @objc_retain(i8* %x)
; Like test13c, but there's an autoreleasePoolPush in the way, but that
; doesn't matter.
-; CHECK: define void @test13d
+; CHECK-LABEL: define void @test13d(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retain(i8* %x)
; CHECK-NEXT: @objc_autoreleasePoolPush
; Trivial retain,release pair with intervening call, but it's post-dominated
; by another release - delete!
-; CHECK: define void @test14(
+; CHECK-LABEL: define void @test14(
; CHECK-NEXT: entry:
; CHECK-NEXT: @use_pointer
; CHECK-NEXT: @use_pointer
; Trivial retain,autorelease pair with intervening call, but it's post-dominated
; by another release. Don't delete anything.
-; CHECK: define void @test15(
+; CHECK-LABEL: define void @test15(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retain(i8* %x)
; CHECK-NEXT: @use_pointer
; Trivial retain,autorelease pair, post-dominated
; by another release. Delete the retain and release.
-; CHECK: define void @test15b
+; CHECK-LABEL: define void @test15b(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retain
; CHECK-NEXT: @objc_autorelease
ret void
}
-; CHECK: define void @test15c
+; CHECK-LABEL: define void @test15c(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_autorelease
; CHECK-NEXT: ret void
; Retain+release pairs in diamonds, all dominated by a retain.
-; CHECK: define void @test16a(
+; CHECK-LABEL: define void @test16a(
; CHECK: @objc_retain(i8* %x)
; CHECK-NOT: @objc
; CHECK: }
ret void
}
-; CHECK: define void @test16b(
+; CHECK-LABEL: define void @test16b(
; CHECK: @objc_retain(i8* %x)
; CHECK-NOT: @objc
; CHECK: }
ret void
}
-; CHECK: define void @test16c(
+; CHECK-LABEL: define void @test16c(
; CHECK: @objc_retain(i8* %x)
; CHECK-NOT: @objc
; CHECK: }
ret void
}
-; CHECK: define void @test16d(
+; CHECK-LABEL: define void @test16d(
; CHECK: @objc_retain(i8* %x)
; CHECK-NOT: @objc
; CHECK: }
; Retain+release pairs in diamonds, all post-dominated by a release.
-; CHECK: define void @test17(
+; CHECK-LABEL: define void @test17(
; CHECK-NOT: @objc_
; CHECK: purple:
; CHECK: @objc_release
; Delete no-ops.
-; CHECK: define void @test18(
+; CHECK-LABEL: define void @test18(
; CHECK-NOT: @objc_
; CHECK: }
define void @test18() {
; Delete no-ops where undef can be assumed to be null.
-; CHECK: define void @test18b
+; CHECK-LABEL: define void @test18b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test18b() {
; Bitcast insertion
-; CHECK: define void @test20(
+; CHECK-LABEL: define void @test20(
; CHECK: %tmp1 = tail call i8* @objc_retain(i8* %tmp) [[NUW]]
; CHECK-NEXT: invoke
; CHECK: }
; Delete a redundant retain,autorelease when forwaring a call result
; directly to a return value.
-; CHECK: define i8* @test21(
+; CHECK-LABEL: define i8* @test21(
; CHECK: call i8* @returner()
; CHECK-NEXT: ret i8* %call
; CHECK-NEXT: }
; Move an objc call up through a phi that has null operands.
-; CHECK: define void @test22(
+; CHECK-LABEL: define void @test22(
; CHECK: B:
; CHECK: %1 = bitcast double* %p to i8*
; CHECK: call void @objc_release(i8* %1)
; Optimize objc_retainBlock.
-; CHECK: define void @test23(
+; CHECK-LABEL: define void @test23(
; CHECK-NOT: @objc_
; CHECK: }
%block0 = type { i64, i64, i8*, i8* }
; Don't optimize objc_retainBlock, because there's no copy_on_escape metadata.
-; CHECK: define void @test23c(
+; CHECK-LABEL: define void @test23c(
; CHECK: @objc_retainBlock
; CHECK: @objc_release
; CHECK: }
; Any call can decrement a retain count.
-; CHECK: define void @test24(
+; CHECK-LABEL: define void @test24(
; CHECK: @objc_retain(i8* %a)
; CHECK: @objc_release
; CHECK: }
; Don't move a retain/release pair if the release can be moved
; but the retain can't be moved to balance it.
-; CHECK: define void @test25(
+; CHECK-LABEL: define void @test25(
; CHECK: entry:
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: true:
; Don't move a retain/release pair if the retain can be moved
; but the release can't be moved to balance it.
-; CHECK: define void @test26(
+; CHECK-LABEL: define void @test26(
; CHECK: entry:
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: true:
; Don't sink the retain,release into the loop.
-; CHECK: define void @test27(
+; CHECK-LABEL: define void @test27(
; CHECK: entry:
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: loop:
; Trivial code motion case: Triangle.
-; CHECK: define void @test28(
+; CHECK-LABEL: define void @test28(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Trivial code motion case: Triangle, but no metadata. Don't move past
; unrelated memory references!
-; CHECK: define void @test28b
+; CHECK-LABEL: define void @test28b(
; CHECK: call i8* @objc_retain(
; CHECK: true:
; CHECK-NOT: @objc_
; Trivial code motion case: Triangle, with metadata. Do move past
; unrelated memory references! And preserve the metadata.
-; CHECK: define void @test28c
+; CHECK-LABEL: define void @test28c(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Like test28. but with two releases.
-; CHECK: define void @test29(
+; CHECK-LABEL: define void @test29(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Basic case with the use and call in a diamond
; with an extra release.
-; CHECK: define void @test30(
+; CHECK-LABEL: define void @test30(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Basic case with a mergeable release.
-; CHECK: define void @test31(
+; CHECK-LABEL: define void @test31(
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: call void @callee()
; CHECK: store
; Don't consider bitcasts or getelementptrs direct uses.
-; CHECK: define void @test32(
+; CHECK-LABEL: define void @test32(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Do consider icmps to be direct uses.
-; CHECK: define void @test33(
+; CHECK-LABEL: define void @test33(
; CHECK-NOT: @objc_
; CHECK: true:
; CHECK: call i8* @objc_retain(
; Delete retain,release if there's just a possible dec and we have imprecise
; releases.
-; CHECK: define void @test34a(
+; CHECK-LABEL: define void @test34a(
; CHECK: call i8* @objc_retain
; CHECK: true:
; CHECK: done:
ret void
}
-; CHECK: define void @test34b(
+; CHECK-LABEL: define void @test34b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test34b(i8* %p, i1 %x, i8* %y) {
; release.
; Precise.
-; CHECK: define void @test35a(
+; CHECK-LABEL: define void @test35a(
; CHECK: entry:
; CHECK: call i8* @objc_retain
; CHECK: true:
}
; Imprecise.
-; CHECK: define void @test35b(
+; CHECK-LABEL: define void @test35b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test35b(i8* %p, i1 %x, i8* %y) {
; Delete a retain,release if there's no actual use and we have precise release.
-; CHECK: define void @test36a(
+; CHECK-LABEL: define void @test36a(
; CHECK: @objc_retain
; CHECK: call void @callee()
; CHECK-NOT: @objc_
; Like test36, but with metadata.
-; CHECK: define void @test36b(
+; CHECK-LABEL: define void @test36b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test36b(i8* %p) {
; Be aggressive about analyzing phis to eliminate possible uses.
-; CHECK: define void @test38(
+; CHECK-LABEL: define void @test38(
; CHECK-NOT: @objc_
; CHECK: }
define void @test38(i8* %p, i1 %u, i1 %m, i8* %z, i8* %y, i8* %x, i8* %w) {
; Delete retain,release pairs around loops.
-; CHECK: define void @test39(
+; CHECK-LABEL: define void @test39(
; CHECK-NOT: @objc_
; CHECK: }
define void @test39(i8* %p) {
; Delete retain,release pairs around loops containing uses.
-; CHECK: define void @test39b(
+; CHECK-LABEL: define void @test39b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test39b(i8* %p) {
; Delete retain,release pairs around loops containing potential decrements.
-; CHECK: define void @test39c(
+; CHECK-LABEL: define void @test39c(
; CHECK-NOT: @objc_
; CHECK: }
define void @test39c(i8* %p) {
; Delete retain,release pairs around loops even if
; the successors are in a different order.
-; CHECK: define void @test40(
+; CHECK-LABEL: define void @test40(
; CHECK-NOT: @objc_
; CHECK: }
define void @test40(i8* %p) {
; Do the known-incremented retain+release elimination even if the pointer
; is also autoreleased.
-; CHECK: define void @test42(
+; CHECK-LABEL: define void @test42(
; CHECK-NEXT: entry:
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
; Don't the known-incremented retain+release elimination if the pointer is
; autoreleased and there's an autoreleasePoolPop.
-; CHECK: define void @test43(
+; CHECK-LABEL: define void @test43(
; CHECK-NEXT: entry:
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
; Do the known-incremented retain+release elimination if the pointer is
; autoreleased and there's an autoreleasePoolPush.
-; CHECK: define void @test43b
+; CHECK-LABEL: define void @test43b(
; CHECK-NEXT: entry:
; CHECK-NEXT: call i8* @objc_retain(i8* %p)
; CHECK-NEXT: call i8* @objc_autorelease(i8* %p)
; Do retain+release elimination for non-provenance pointers.
-; CHECK: define void @test44(
+; CHECK-LABEL: define void @test44(
; CHECK-NOT: objc_
; CHECK: }
define void @test44(i8** %pp) {
; Don't delete retain+release with an unknown-provenance
; may-alias objc_release between them.
-; CHECK: define void @test45(
+; CHECK-LABEL: define void @test45(
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: call void @objc_release(i8* %q)
; CHECK: call void @use_pointer(i8* %p)
; Don't delete retain and autorelease here.
-; CHECK: define void @test46(
+; CHECK-LABEL: define void @test46(
; CHECK: tail call i8* @objc_retain(i8* %p) [[NUW]]
; CHECK: true:
; CHECK: call i8* @objc_autorelease(i8* %p) [[NUW]]
; Delete no-op cast calls.
-; CHECK: define i8* @test47(
+; CHECK-LABEL: define i8* @test47(
; CHECK-NOT: call
; CHECK: ret i8* %p
; CHECK: }
; Delete no-op cast calls.
-; CHECK: define i8* @test48(
+; CHECK-LABEL: define i8* @test48(
; CHECK-NOT: call
; CHECK: ret i8* %p
; CHECK: }
; Delete no-op cast calls.
-; CHECK: define i8* @test49(
+; CHECK-LABEL: define i8* @test49(
; CHECK-NOT: call
; CHECK: ret i8* %p
; CHECK: }
; Do delete retain+release with intervening stores of the address value if we
; have imprecise release attached to objc_release.
-; CHECK: define void @test50a(
+; CHECK-LABEL: define void @test50a(
; CHECK-NEXT: call i8* @objc_retain
; CHECK-NEXT: call void @callee
; CHECK-NEXT: store
ret void
}
-; CHECK: define void @test50b(
+; CHECK-LABEL: define void @test50b(
; CHECK-NOT: @objc_
; CHECK: }
define void @test50b(i8* %p, i8** %pp) {
; Don't delete retain+release with intervening stores through the
; address value.
-; CHECK: define void @test51a(
+; CHECK-LABEL: define void @test51a(
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: call void @objc_release(i8* %p)
; CHECK: ret void
ret void
}
-; CHECK: define void @test51b(
+; CHECK-LABEL: define void @test51b(
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: call void @objc_release(i8* %p)
; CHECK: ret void
; Don't delete retain+release with intervening use of a pointer of
; unknown provenance.
-; CHECK: define void @test52a(
+; CHECK-LABEL: define void @test52a(
; CHECK: call i8* @objc_retain
; CHECK: call void @callee()
; CHECK: call void @use_pointer(i8* %z)
ret void
}
-; CHECK: define void @test52b(
+; CHECK-LABEL: define void @test52b(
; CHECK: call i8* @objc_retain
; CHECK: call void @callee()
; CHECK: call void @use_pointer(i8* %z)
; Oops. That's wrong. Clang sometimes uses function types gratuitously.
; See rdar://10551239.
-; CHECK: define void @test53(
+; CHECK-LABEL: define void @test53(
; CHECK: @objc_
; CHECK: }
define void @test53(void ()** %zz, i8** %pp) {
; Convert autorelease to release if the value is unused.
-; CHECK: define void @test54(
+; CHECK-LABEL: define void @test54(
; CHECK: call i8* @returner()
; CHECK-NEXT: call void @objc_release(i8* %t) [[NUW]], !clang.imprecise_release !0
; CHECK-NEXT: ret void
; Nested retain+release pairs. Delete them both.
-; CHECK: define void @test55(
+; CHECK-LABEL: define void @test55(
; CHECK-NOT: @objc
; CHECK: }
define void @test55(i8* %x) {
; can be partially eliminated. Plus an extra outer pair to
; eliminate, for fun.
-; CHECK: define void @test56(
+; CHECK-LABEL: define void @test56(
; CHECK-NOT: @objc
; CHECK: if.then:
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %x) [[NUW]]
; known unnecessary because the presence of the second one means that
; the first one won't be deleting the object.
-; CHECK: define void @test57(
+; CHECK-LABEL: define void @test57(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @use_pointer(i8* %x)
; CHECK-NEXT: call void @use_pointer(i8* %x)
; An adjacent retain+release pair is sufficient even if it will be
; removed itself.
-; CHECK: define void @test58(
+; CHECK-LABEL: define void @test58(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @use_pointer(i8* %x)
; CHECK-NEXT: call void @use_pointer(i8* %x)
; Don't delete the second retain+release pair in an adjacent set.
-; CHECK: define void @test59(
+; CHECK-LABEL: define void @test59(
; CHECK-NEXT: entry:
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %x) [[NUW]]
; CHECK-NEXT: call void @use_pointer(i8* %x)
; We have a precise lifetime retain/release here. We can not remove them since
; @something is not constant.
-; CHECK: define void @test60a(
+; CHECK-LABEL: define void @test60a(
; CHECK: call i8* @objc_retain
; CHECK: call void @objc_release
; CHECK: }
ret void
}
-; CHECK: define void @test60b(
+; CHECK-LABEL: define void @test60b(
; CHECK: call i8* @objc_retain
; CHECK-NOT: call i8* @objc_retain
; CHECK-NOT: call i8* @objc_rrelease
ret void
}
-; CHECK: define void @test60c(
+; CHECK-LABEL: define void @test60c(
; CHECK-NOT: @objc_
; CHECK: }
define void @test60c() {
ret void
}
-; CHECK: define void @test60d(
+; CHECK-LABEL: define void @test60d(
; CHECK-NOT: @objc_
; CHECK: }
define void @test60d() {
ret void
}
-; CHECK: define void @test60e(
+; CHECK-LABEL: define void @test60e(
; CHECK-NOT: @objc_
; CHECK: }
define void @test60e() {
; Constant pointers to objects don't need to be considered related to other
; pointers.
-; CHECK: define void @test61(
+; CHECK-LABEL: define void @test61(
; CHECK-NOT: @objc_
; CHECK: }
define void @test61() {
; Delete a retain matched by releases when one is inside the loop and the
; other is outside the loop.
-; CHECK: define void @test62(
+; CHECK-LABEL: define void @test62(
; CHECK-NOT: @objc_
; CHECK: }
define void @test62(i8* %x, i1* %p) nounwind {
; Like test62 but with no release in exit.
; Don't delete anything!
-; CHECK: define void @test63(
+; CHECK-LABEL: define void @test63(
; CHECK: loop:
; CHECK: tail call i8* @objc_retain(i8* %x)
; CHECK: loop.more:
; Like test62 but with no release in loop.more.
; Don't delete anything!
-; CHECK: define void @test64(
+; CHECK-LABEL: define void @test64(
; CHECK: loop:
; CHECK: tail call i8* @objc_retain(i8* %x)
; CHECK: exit:
; Move an autorelease past a phi with a null.
-; CHECK: define i8* @test65(
+; CHECK-LABEL: define i8* @test65(
; CHECK: if.then:
; CHECK: call i8* @objc_autorelease(
; CHECK: return:
; Don't move an autorelease past an autorelease pool boundary.
-; CHECK: define i8* @test65b(
+; CHECK-LABEL: define i8* @test65b(
; CHECK: if.then:
; CHECK-NOT: @objc_autorelease
; CHECK: return:
; Don't move an autoreleaseReuturnValue, which would break
; the RV optimization.
-; CHECK: define i8* @test65c(
+; CHECK-LABEL: define i8* @test65c(
; CHECK: if.then:
; CHECK-NOT: @objc_autorelease
; CHECK: return:
; An objc_retain can serve as a may-use for a different pointer.
; rdar://11931823
-; CHECK: define void @test66a(
+; CHECK-LABEL: define void @test66a(
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
ret void
}
-; CHECK: define void @test66b(
+; CHECK-LABEL: define void @test66b(
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
ret void
}
-; CHECK: define void @test66c(
+; CHECK-LABEL: define void @test66c(
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
ret void
}
-; CHECK: define void @test66d(
+; CHECK-LABEL: define void @test66d(
; CHECK: tail call i8* @objc_retain(i8* %cond) [[NUW]]
; CHECK: tail call void @objc_release(i8* %call) [[NUW]]
; CHECK: tail call i8* @objc_retain(i8* %tmp8) [[NUW]]
; Make sure that we understand that objc_sync_{enter,exit} are IC_User not
; IC_Call/IC_CallOrUser.
-; CHECK: define void @test67
+; CHECK-LABEL: define void @test67(
; CHECK-NEXT: call i32 @objc_sync_enter(i8* %x)
; CHECK-NEXT: call i32 @objc_sync_exit(i8* %x)
; CHECK-NEXT: ret void
declare void @callee()
declare void @block_callee(void ()*)
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: call i8* @objc_retain(
; CHECK: for.body:
; CHECK-NOT: @objc
ret void
}
-; CHECK: define void @test1(
+; CHECK-LABEL: define void @test1(
; CHECK: call i8* @objc_retain(
; CHECK: for.body:
; CHECK-NOT: @objc
ret void
}
-; CHECK: define void @test2(
+; CHECK-LABEL: define void @test2(
; CHECK: call i8* @objc_retain(
; CHECK: for.body:
; CHECK-NOT: @objc
@x = external global i8*
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: entry:
; CHECK-NEXT: tail call void @objc_storeStrong(i8** @x, i8* %p) [[NUW:#[0-9]+]]
; CHECK-NEXT: ret void
; Like test0, but there's no store, so don't form an objc_storeStrong.
-; CHECK: define void @test7(
+; CHECK-LABEL: define void @test7(
; CHECK-NEXT: entry:
; CHECK-NEXT: %0 = tail call i8* @objc_retain(i8* %p) [[NUW]]
; CHECK-NEXT: %tmp = load i8** @x, align 8
; Like test0, but there's no retain, so don't form an objc_storeStrong.
-; CHECK: define void @test8(
+; CHECK-LABEL: define void @test8(
; CHECK-NEXT: entry:
; CHECK-NEXT: %tmp = load i8** @x, align 8
; CHECK-NEXT: store i8* %p, i8** @x, align 8
; Don't get in trouble on bugpointed code.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
define void @test0() {
bb:
%tmp = bitcast %4* undef to i8*
; When rewriting operands for a phi which has multiple operands
; for the same block, use the exactly same value in each block.
-; CHECK: define void @test1(
+; CHECK-LABEL: define void @test1(
; CHECK: %0 = bitcast i8* %tmp3 to %0*
; CHECK: br i1 undef, label %bb7, label %bb7
; CHECK: bb7:
declare i8* @returner()
declare void @callee()
-; CHECK: define void @test0
+; CHECK-LABEL: define void @test0(
; CHECK: call void @use_pointer(i8* %0)
; CHECK: }
define void @test0(i8* %x) nounwind {
ret void
}
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK: call void @use_pointer(i8* %0)
; CHECK: }
define void @test1(i8* %x) nounwind {
; Merge objc_retain and objc_autorelease into objc_retainAutorelease.
-; CHECK: define void @test2(
+; CHECK-LABEL: define void @test2(
; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW:#[0-9]+]]
; CHECK: }
define void @test2(i8* %x) nounwind {
; Same as test2 but the value is returned. Do an RV optimization.
-; CHECK: define i8* @test2b(
+; CHECK-LABEL: define i8* @test2b(
; CHECK: tail call i8* @objc_retainAutoreleaseReturnValue(i8* %x) [[NUW]]
; CHECK: }
define i8* @test2b(i8* %x) nounwind {
; Merge a retain,autorelease pair around a call.
-; CHECK: define void @test3(
+; CHECK-LABEL: define void @test3(
; CHECK: tail call i8* @objc_retainAutorelease(i8* %x) [[NUW]]
; CHECK: @use_pointer(i8* %0)
; CHECK: }
; Trivial retain,autorelease pair with intervening call, but it's post-dominated
; by another release. The retain and autorelease can be merged.
-; CHECK: define void @test4(
+; CHECK-LABEL: define void @test4(
; CHECK-NEXT: entry:
; CHECK-NEXT: @objc_retainAutorelease(i8* %x) [[NUW]]
; CHECK-NEXT: @use_pointer
; Don't merge retain and autorelease if they're not control-equivalent.
-; CHECK: define void @test5(
+; CHECK-LABEL: define void @test5(
; CHECK: tail call i8* @objc_retain(i8* %p) [[NUW]]
; CHECK: true:
; CHECK: call i8* @objc_autorelease(i8* %0) [[NUW]]
; into objc_retainAutoreleasedReturnValueAutoreleaseReturnValue?
; Those entrypoints don't exist yet though.
-; CHECK: define i8* @test6(
+; CHECK-LABEL: define i8* @test6(
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %p) [[NUW]]
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %1) [[NUW]]
; CHECK: }
; Do the return value substitution for PHI nodes too.
-; CHECK: define i8* @test8(
+; CHECK-LABEL: define i8* @test8(
; CHECK: %retval = phi i8* [ %p, %if.then ], [ null, %entry ]
; CHECK: }
define i8* @test8(i1 %x, i8* %c) {
}
; Kill calls to @clang.arc.use(...)
-; CHECK: define void @test9(
+; CHECK-LABEL: define void @test9(
; CHECK-NOT: clang.arc.use
; CHECK: }
define void @test9(i8* %a, i8* %b) {
; Convert objc_retain to objc_retainAutoreleasedReturnValue if its
; argument is a return value.
-; CHECK: define void @test11(
+; CHECK-LABEL: define void @test11(
; CHECK-NEXT: %y = call i8* @returner()
; CHECK-NEXT: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
; Don't convert objc_retain to objc_retainAutoreleasedReturnValue if its
; argument is not a return value.
-; CHECK: define void @test12(
+; CHECK-LABEL: define void @test12(
; CHECK-NEXT: tail call i8* @objc_retain(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
; CHECK-NEXT: }
; Don't Convert objc_retain to objc_retainAutoreleasedReturnValue if it
; isn't next to the call providing its return value.
-; CHECK: define void @test13(
+; CHECK-LABEL: define void @test13(
; CHECK-NEXT: %y = call i8* @returner()
; CHECK-NEXT: call void @callee()
; CHECK-NEXT: tail call i8* @objc_retain(i8* %y) [[NUW]]
; Don't delete the autorelease.
-; CHECK: define %0* @test0(
+; CHECK-LABEL: define %0* @test0(
; CHECK: @objc_retain
; CHECK: .lr.ph:
; CHECK-NOT: @objc_r
; Do delete the autorelease, even with the retain in a different block.
-; CHECK: define %0* @test1(
+; CHECK-LABEL: define %0* @test1(
; CHECK-NOT: @objc
; CHECK: }
define %0* @test1() nounwind {
; Don't optimize away the retainBlock, because the object's address "escapes"
; with the objc_storeWeak call.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: %tmp7 = call i8* @objc_retainBlock(i8* %tmp6) [[NUW:#[0-9]+]], !clang.arc.copy_on_escape !0
; CHECK: call void @objc_release(i8* %tmp7) [[NUW]], !clang.imprecise_release !0
; CHECK: }
; Like test0, but it makes a regular call instead of a storeWeak call,
; so the optimization is valid.
-; CHECK: define void @test1(
+; CHECK-LABEL: define void @test1(
; CHECK-NOT: @objc_retainBlock
; CHECK: }
define void @test1() nounwind {
; GVN should not be able to eliminate this redundant load, with ARC-specific
; alias analysis.
-; CHECK: define i8* @test1
+; CHECK-LABEL: define i8* @test1(
; CHECK: load
; CHECK: load
; CHECK: ret i8* %t
declare void @clang.arc.use(...) nounwind
; Kill calls to @clang.arc.use(...)
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK-NOT: clang.arc.use
; CHECK: }
define void @test0(i8* %a, i8* %b) {
; FIXME: the fact that we re-order retains w.r.t. @clang.arc.use could
; be problematic if we get run twice, e.g. under LTO.
;
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: @objc_retain(i8* %x)
; CHECK-NEXT: store i8* %y, i8** %temp0
; CHECK-NEXT: @objc_retain(i8* %y)
ret void
}
-; CHECK: define void @test0a(
+; CHECK-LABEL: define void @test0a(
; CHECK: @objc_retain(i8* %x)
; CHECK-NEXT: store i8* %y, i8** %temp0
; CHECK-NEXT: @objc_retain(i8* %y)
; ARCOpt shouldn't try to move the releases to the block containing the invoke.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: invoke.cont:
; CHECK: call void @objc_release(i8* %zipFile) [[NUW:#[0-9]+]], !clang.imprecise_release !0
; CHECK: ret void
; ARCOpt should move the release before the callee calls.
-; CHECK: define void @test1(
+; CHECK-LABEL: define void @test1(
; CHECK: invoke.cont:
; CHECK: call void @objc_release(i8* %zipFile) [[NUW]], !clang.imprecise_release !0
; CHECK: call void @callee()
; Don't try to place code on invoke critical edges.
-; CHECK: define void @test3(
+; CHECK-LABEL: define void @test3(
; CHECK: if.end:
; CHECK-NEXT: call void @objc_release(i8* %p) [[NUW]]
; CHECK-NEXT: ret void
; Like test3, but with ARC-relevant exception handling.
-; CHECK: define void @test4(
+; CHECK-LABEL: define void @test4(
; CHECK: lpad:
; CHECK-NEXT: %r = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__objc_personality_v0 to i8*)
; CHECK-NEXT: cleanup
; Don't turn the retainAutoreleaseReturnValue into retain, because it's
; for an invoke which we can assume codegen will put immediately prior.
-; CHECK: define void @test5(
+; CHECK-LABEL: define void @test5(
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %z)
; CHECK: }
define void @test5() {
; Like test5, but there's intervening code.
-; CHECK: define void @test6(
+; CHECK-LABEL: define void @test6(
; CHECK: call i8* @objc_retain(i8* %z)
; CHECK: }
define void @test6() {
; Delete a nested retain+release pair.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: call i8* @objc_retain
; CHECK-NOT: @objc_retain
; CHECK: }
; Delete a nested retain+release pair.
-; CHECK: define void @test2(
+; CHECK-LABEL: define void @test2(
; CHECK: call i8* @objc_retain
; CHECK-NOT: @objc_retain
; CHECK: }
; Delete a nested retain+release pair.
-; CHECK: define void @test4(
+; CHECK-LABEL: define void @test4(
; CHECK: call i8* @objc_retain
; CHECK-NOT: @objc_retain
; CHECK: }
; Delete a nested retain+release pair.
-; CHECK: define void @test5(
+; CHECK-LABEL: define void @test5(
; CHECK: call i8* @objc_retain
; CHECK-NOT: @objc_retain
; CHECK: }
; The optimizer currently can't do this, because isn't isn't sophisticated enough in
; reasnoning about nesting.
-; CHECK: define void @test6(
+; CHECK-LABEL: define void @test6(
; CHECK: call i8* @objc_retain
; CHECK: @objc_retain
; CHECK: }
; The optimizer currently can't do this, because isn't isn't sophisticated enough in
; reasnoning about nesting.
-; CHECK: define void @test7(
+; CHECK-LABEL: define void @test7(
; CHECK: call i8* @objc_retain
; CHECK: @objc_retain
; CHECK: }
; Delete a nested retain+release pair.
-; CHECK: define void @test8(
+; CHECK-LABEL: define void @test8(
; CHECK: call i8* @objc_retain
; CHECK-NOT: @objc_retain
; CHECK: }
; The optimizer currently can't do this, because of a split loop backedge.
; See test9b for the same testcase without a split backedge.
-; CHECK: define void @test9(
+; CHECK-LABEL: define void @test9(
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; Like test9, but without a split backedge. TODO: optimize this.
-; CHECK: define void @test9b(
+; CHECK-LABEL: define void @test9b(
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; CHECK: @objc_retain
; The optimizer currently can't do this, because of a split loop backedge.
; See test10b for the same testcase without a split backedge.
-; CHECK: define void @test10(
+; CHECK-LABEL: define void @test10(
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; Like test10, but without a split backedge. TODO: optimize this.
-; CHECK: define void @test10b(
+; CHECK-LABEL: define void @test10b(
; CHECK: call i8* @objc_retain
; CHECK: call i8* @objc_retain
; CHECK: @objc_retain
@__block_d_tmp = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
@__block_d_tmp5 = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
-; CHECK: define void @test11(
+; CHECK-LABEL: define void @test11(
; CHECK: tail call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]]
; CHECK: tail call i8* @objc_retain(i8* %call) [[NUW]]
; CHECK: call void @objc_release(i8* %call) [[NUW]], !clang.imprecise_release !0
; metadata and eliminate the retainBlock+release pair here.
; rdar://10803830.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK-NOT: @objc
; CHECK: }
define void @test0() {
; shouldn't eliminate anything, but *CAN* strength reduce the objc_retainBlock
; to an objc_retain.
-; CHECK: define void @test0_no_metadata(
+; CHECK-LABEL: define void @test0_no_metadata(
; CHECK: call i8* @objc_retain(
; CHECK: invoke
; CHECK: call void @objc_release(
; in dubious ways.
; rdar://10551239
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: %otherBlock = phi void ()* [ %b1, %if.then ], [ null, %entry ]
; CHECK-NEXT: call void @use_fptr(void ()* %otherBlock)
; CHECK-NEXT: %tmp11 = bitcast void ()* %otherBlock to i8*
; Clean up residue left behind after inlining.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: entry:
; CHECK-NEXT: ret void
; CHECK-NEXT: }
; Same as test0, but with slightly different use arrangements.
-; CHECK: define void @test1(
+; CHECK-LABEL: define void @test1(
; CHECK: entry:
; CHECK-NEXT: ret void
; CHECK-NEXT: }
; Delete a retainRV+autoreleaseRV even if the pointer is used.
-; CHECK: define void @test24(
+; CHECK-LABEL: define void @test24(
; CHECK-NEXT: entry:
; CHECK-NEXT: call void @use_pointer(i8* %p)
; CHECK-NEXT: ret void
@__block_descriptor_tmp = external hidden constant { i64, i64, i8*, i8*, i8*, i8* }
@"\01L_OBJC_SELECTOR_REFERENCES_" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
-; CHECK: define void @test(
+; CHECK-LABEL: define void @test(
; CHECK: %3 = call i8* @objc_retainBlock(i8* %2) [[NUW:#[0-9]+]]
; CHECK: @objc_msgSend
; CHECK-NEXT: @objc_release(i8* %3)
; Same as test, but the objc_retainBlock has a clang.arc.copy_on_escape
; tag so it's safe to delete.
-; CHECK: define void @test_with_COE(
+; CHECK-LABEL: define void @test_with_COE(
; CHECK-NOT: @objc_retainBlock
; CHECK: @objc_msgSend
; CHECK: @objc_release
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
define void @bitcasttest(i8* %storage, void (...)* %block) {
-; CHECK: define void @bitcasttest
+; CHECK-LABEL: define void @bitcasttest(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK: tail call i8* @objc_retain
}
define void @bitcasttest_a(i8* %storage, void (...)* %block) {
-; CHECK: define void @bitcasttest_a
+; CHECK-LABEL: define void @bitcasttest_a(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK-NOT: tail call i8* @objc_retain
}
define void @geptest(void (...)** %storage_array, void (...)* %block) {
-; CHECK: define void @geptest
+; CHECK-LABEL: define void @geptest(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK: tail call i8* @objc_retain
}
define void @geptest_a(void (...)** %storage_array, void (...)* %block) {
-; CHECK: define void @geptest_a
+; CHECK-LABEL: define void @geptest_a(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK-NOT: tail call i8* @objc_retain
define void @selecttest(void (...)** %store1, void (...)** %store2,
void (...)* %block) {
-; CHECK: define void @selecttest
+; CHECK-LABEL: define void @selecttest(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK: tail call i8* @objc_retain
define void @selecttest_a(void (...)** %store1, void (...)** %store2,
void (...)* %block) {
-; CHECK: define void @selecttest_a
+; CHECK-LABEL: define void @selecttest_a(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK-NOT: tail call i8* @objc_retain
define void @phinodetest(void (...)** %storage1,
void (...)** %storage2,
void (...)* %block) {
-; CHECK: define void @phinodetest
+; CHECK-LABEL: define void @phinodetest(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK: tail call i8* @objc_retain
define void @phinodetest_a(void (...)** %storage1,
void (...)** %storage2,
void (...)* %block) {
-; CHECK: define void @phinodetest_a
+; CHECK-LABEL: define void @phinodetest_a(
entry:
%t1 = bitcast void (...)* %block to i8*
; CHECK-NOT: tail call i8* @objc_retain
; retain is an objc_retainAutoreleasedReturnValue, since it's
; better to do the RV optimization.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK-NEXT: entry:
; CHECK-NEXT: %x = call i8* @returner
; CHECK-NEXT: %0 = tail call i8* @objc_retainAutoreleasedReturnValue(i8* %x) [[NUW:#[0-9]+]]
; Delete no-ops.
-; CHECK: define void @test2
+; CHECK-LABEL: define void @test2(
; CHECK-NOT: @objc_
; CHECK: }
define void @test2() {
; Delete a redundant retainRV,autoreleaseRV when forwaring a call result
; directly to a return value.
-; CHECK: define i8* @test3
+; CHECK-LABEL: define i8* @test3(
; CHECK: call i8* @returner()
; CHECK-NEXT: ret i8* %call
define i8* @test3() {
; Delete a redundant retain,autoreleaseRV when forwaring a call result
; directly to a return value.
-; CHECK: define i8* @test4
+; CHECK-LABEL: define i8* @test4(
; CHECK: call i8* @returner()
; CHECK-NEXT: ret i8* %call
define i8* @test4() {
; into objc_retainAutoreleasedReturnValueAutoreleaseReturnValue?
; Those entrypoints don't exist yet though.
-; CHECK: define i8* @test7(
+; CHECK-LABEL: define i8* @test7(
; CHECK: call i8* @objc_retainAutoreleasedReturnValue(i8* %p)
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
define i8* @test7() {
ret i8* %t
}
-; CHECK: define i8* @test7b(
+; CHECK-LABEL: define i8* @test7b(
; CHECK: call i8* @objc_retain(i8* %p)
; CHECK: %t = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
define i8* @test7b() {
; Don't zap the objc_retainAutoreleasedReturnValue.
-; CHECK: define i8* @test13(
+; CHECK-LABEL: define i8* @test13(
; CHECK: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %p)
; CHECK: call i8* @objc_autorelease(i8* %p)
; CHECK: ret i8* %p
; Convert objc_retainAutoreleasedReturnValue to objc_retain if its
; argument is not a return value.
-; CHECK: define void @test14(
+; CHECK-LABEL: define void @test14(
; CHECK-NEXT: tail call i8* @objc_retain(i8* %p) [[NUW]]
; CHECK-NEXT: ret void
define void @test14(i8* %p) {
; Don't convert objc_retainAutoreleasedReturnValue to objc_retain if its
; argument is a return value.
-; CHECK: define void @test15(
+; CHECK-LABEL: define void @test15(
; CHECK-NEXT: %y = call i8* @returner()
; CHECK-NEXT: tail call i8* @objc_retainAutoreleasedReturnValue(i8* %y) [[NUW]]
; CHECK-NEXT: ret void
; Convert autoreleaseRV to autorelease.
-; CHECK: define void @test23(
+; CHECK-LABEL: define void @test23(
; CHECK: call i8* @objc_autorelease(i8* %p) [[NUW]]
define void @test23(i8* %p) {
store i8 0, i8* %p
; Don't convert autoreleaseRV to autorelease if the result is returned,
; even through a bitcast.
-; CHECK: define {}* @test24(
+; CHECK-LABEL: define {}* @test24(
; CHECK: tail call i8* @objc_autoreleaseReturnValue(i8* %p)
define {}* @test24(i8* %p) {
%t = call i8* @objc_autoreleaseReturnValue(i8* %p)
; Handle a retain+release pair entirely contained within a split loop backedge.
; rdar://11256239
-; CHECK: define void @test0
+; CHECK-LABEL: define void @test0(
; CHECK: call i8* @objc_retain(i8* %call) [[NUW:#[0-9]+]]
; CHECK: call i8* @objc_retain(i8* %call) [[NUW]]
; CHECK: call i8* @objc_retain(i8* %cond) [[NUW]]
; If the pointer-to-weak-pointer is null, it's undefined behavior.
-; CHECK: define void @test0(
+; CHECK-LABEL: define void @test0(
; CHECK: store i8* undef, i8** null
; CHECK: store i8* undef, i8** null
; CHECK: store i8* undef, i8** null
store atomic i32 123, i32* @G seq_cst, align 4
ret i32 0
}
-; CHECK: define i32 @test1
+; CHECK-LABEL: define i32 @test1(
; CHECK-NOT: store
; CHECK: ret i32 17
ret i32 %V
}
-; CHECK: define i32 @test2
+; CHECK-LABEL: define i32 @test2(
; CHECK-NOT: load
; CHECK: ret i32 222
%X = add i32 1, 2
ret i32 %A
}
-; CHECK: define internal i32 @test1a
+; CHECK-LABEL: define internal i32 @test1a(
; CHECK: ret i32 undef
define i32 @test1b() {
%X = call i32 @test1a( i32 17 )
ret i32 %X
-; CHECK: define i32 @test1b
+; CHECK-LABEL: define i32 @test1b(
; CHECK: ret i32 17
}
%C.upgrd.1 = call i32 @test2a(i32 1)
ret i32 %C.upgrd.1
}
-; CHECK: define internal i32 @test2a
+; CHECK-LABEL: define internal i32 @test2a(
; CHECK-NEXT: br label %T
; CHECK: ret i32 undef
%X = call i32 @test2a(i32 0)
ret i32 %X
}
-; CHECK: define i32 @test2b
+; CHECK-LABEL: define i32 @test2b(
; CHECK-NEXT: %X = call i32 @test2a(i32 0)
; CHECK-NEXT: ret i32 0
store i32 %X, i32* @G
ret void
}
-; CHECK: define void @test3a
+; CHECK-LABEL: define void @test3a(
; CHECK-NEXT: ret void
store i32 123, i32* @G
ret i32 0
}
-; CHECK: define i32 @test3b
+; CHECK-LABEL: define i32 @test3b(
; CHECK-NOT: store
; CHECK: ret i32 0
define internal i64 @test4c(i64 %a) {
ret i64 %a
}
-; CHECK: define internal i64 @test4c
+; CHECK-LABEL: define internal i64 @test4c(
; CHECK: ret i64 undef
%a = call i64 @test6a()
ret i64 %a
}
-; CHECK: define i64 @test6b
+; CHECK-LABEL: define i64 @test6b(
; CHECK: ret i64 0
;;======================== test7
%Y = extractvalue %T %X, 0
%Z = add i32 %Y, %Y
ret i32 %Z
-; CHECK: define i32 @test7b
+; CHECK-LABEL: define i32 @test7b(
; CHECK-NEXT: call %T @test7a(i32 17)
; CHECK-NEXT: ret i32 36
}
define void @test8b(i32* %P) {
%X = call {} @test8a(i32 5, i32* %P)
ret void
-; CHECK: define void @test8b
+; CHECK-LABEL: define void @test8b(
; CHECK-NEXT: call {} @test8a
; CHECK-NEXT: ret void
}
entry:
%call = call i32 @test10b(i32 undef)
ret i32 %call
-; CHECK: define i32 @test10a
+; CHECK-LABEL: define i32 @test10a(
; CHECK: ret i32 0
}
entry:
%r = and i32 %x, 1
ret i32 %r
-; CHECK: define internal i32 @test10b
+; CHECK-LABEL: define internal i32 @test10b(
; CHECK: ret i32 undef
}
; with no cases.
declare void @foo()
define void @test1() {
-; CHECK: define void @test1
+; CHECK-LABEL: define void @test1(
; CHECK: call void @foo()
switch i32 undef, label %d []
d:
unreachable
}
-; CHECK: define void @odd_fn
+; CHECK-LABEL: define void @odd_fn(
; CHECK: %storemerge.in = phi i32* [ %retptr2, %else ], [ %retptr1, %then ]
%struct.anon = type { [1 x float] }
-; CHECK: define void @Test(
+; CHECK-LABEL: define void @Test(
; CHECK: load float addrspace(2)*
; CHECK-NEXT: fsub float
; CHECK: store float {{.*}}, float addrspace(2)*
%struct.Vector4 = type { float, float, float, float }
@f.vector = internal constant %struct.Vector4 { float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00 }, align 16
-; CHECK: define void @f
+; CHECK-LABEL: define void @f(
; CHECK-NOT: alloca
; CHECK: phi <4 x float>
if.end:
%dirent_type.0 = phi i32 [ 3, %sw.default ], [ 6, %sw.bb3 ], [ 5, %sw.bb2 ], [ 0, %sw.bb1 ], [ 3, %sw.bb ], [ 0, %if.else ]
ret i32 %dirent_type.0
-; CHECK: define i32 @overflow
+; CHECK-LABEL: define i32 @overflow(
; CHECK: switch
; CHECK: phi
}
bb3:
%tmp4 = phi i1 [ undef, %bb ], [ false, %bb2 ], [ true, %bb1 ]
ret i1 %tmp4
-; CHECK: define i1 @undef
+; CHECK-LABEL: define i1 @undef(
; CHECK: %switch.cast = trunc i32 %switch.tableidx to i9
; CHECK: %switch.downshift = lshr i9 3, %switch.shiftamt
}
declare void @foo() nounwind uwtable
define void @func(i32 %A) nounwind uwtable {
-; CHECK: define void @func
+; CHECK-LABEL: define void @func(
entry:
%cmp11 = icmp eq i32 %A, 1
br i1 %cmp11, label %if.then, label %if.else, !prof !0
; PR7328
; PR7506
define i32 @foo(i32 %x) {
-; CHECK: define i32 @foo
+; CHECK-LABEL: define i32 @foo(
; CHECK: %accumulator.tr = phi i32 [ 1, %entry ], [ 0, %body ]
entry:
%cond = icmp ugt i32 %x, 0 ; <i1> [#uses=1]
ret i32 1
}
-; CHECK: define i32 @test1_factorial
+; CHECK-LABEL: define i32 @test1_factorial(
; CHECK: phi i32
; CHECK-NOT: call i32
; CHECK: else:
ret i32 %x
}
-; CHECK: define i32 @test2_mul
+; CHECK-LABEL: define i32 @test2_mul(
; CHECK: phi i32
; CHECK-NOT: call i32
; CHECK: return:
; Do turn other calls into infinite loops though.
-; CHECK: define double @foo
+; CHECK-LABEL: define double @foo(
; CHECK-NOT: call
; CHECK: }
define double @foo(double %f) {
ret double %t
}
-; CHECK: define float @fabsf
+; CHECK-LABEL: define float @fabsf(
; CHECK-NOT: call
; CHECK: }
define float @fabsf(float %f) {