public:
explicit Foo(int x);
~Foo();
-// CHECK-LABEL: define {{[^@]+}}@_ZNK3Foo23function_defined_inlineEi(
+// CHECK-LABEL: @_ZNK3Foo23function_defined_inlineEi(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
// CHECK-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
inline int function_defined_out_of_line(int arg) const;
};
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooC1Ei(
+// CHECK-LABEL: @_ZN3FooC1Ei(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK-NEXT: ret void
//
Foo::Foo(int x) : x(x) {}
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooD1Ev(
+// CHECK-LABEL: @_ZN3FooD1Ev(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
// CHECK-NEXT: store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
// CHECK-NEXT: ret void
//
Foo::~Foo() {}
-// CHECK-LABEL: define {{[^@]+}}@_ZNK3Foo28function_defined_out_of_lineEi(
+// CHECK-LABEL: @_ZNK3Foo28function_defined_out_of_lineEi(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
// CHECK-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
int Foo::function_defined_out_of_line(int arg) const { return x - arg; }
// Call the inline methods to ensure the LLVM IR is generated:
-// CHECK-LABEL: define {{[^@]+}}@main(
+// CHECK-LABEL: @main(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[F:%.*]] = alloca [[CLASS_FOO:%.*]], align 4
// CHECK-NEXT: call void @_ZN3FooC1Ei(%class.Foo* noundef nonnull align 4 dereferenceable(4) [[F]], i32 noundef 1)
};
// CHECK: Function Attrs: mustprogress noinline nounwind optnone
-// CHECK-LABEL: define {{[^@]+}}@_Z3fooP2ST(
+// CHECK-LABEL: @_Z3fooP2ST(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[S_ADDR:%.*]] = alloca %struct.ST*, align 8
// CHECK-NEXT: store %struct.ST* [[S:%.*]], %struct.ST** [[S_ADDR]], align 8
struct RT Z;
};
-// CHECK-LABEL: define {{[^@]+}}@_Z3fooP2ST(
+// CHECK-LABEL: @_Z3fooP2ST(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[S_ADDR:%.*]] = alloca %struct.ST*, align 8
// CHECK-NEXT: store %struct.ST* [[S:%.*]], %struct.ST** [[S_ADDR]], align 8
void empty_function(void);
-// CHECK-LABEL: define {{[^@]+}}@main(
+// CHECK-LABEL: @main(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// CHECK-NEXT: store i32 0, i32* [[RETVAL]], align 4
return foo(1);
}
-// CHECK-LABEL: define {{[^@]+}}@foo(
+// CHECK-LABEL: @foo(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
// CHECK-NEXT: store i32 [[ARG:%.*]], i32* [[ARG_ADDR]], align 4
return arg;
}
-// CHECK-LABEL: define {{[^@]+}}@empty_function(
+// CHECK-LABEL: @empty_function(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
//
void use(int);
-// CHECK1-LABEL: define {{[^@]+}}@test(
+// CHECK1-LABEL: @test(
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: store i32 [[A:%.*]], i32* [[A_ADDR]], align 4
// CHECK1-NEXT: ret void
//
-// CHECK2-LABEL: define {{[^@]+}}@test(
+// CHECK2-LABEL: @test(
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: store i32 [[A:%.*]], i32* [[A_ADDR]], align 4
// CHECK2-NEXT: ret void
//
-// CHECK3-LABEL: define {{[^@]+}}@test(
+// CHECK3-LABEL: @test(
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32 [[A:%.*]], i32* [[A_ADDR]], align 4
// These two specializations should generate lines for all of Foo's methods.
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIcEC1Ec(
+// CHECK-LABEL: @_ZN3FooIcEC1Ec(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo*, align 8
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca i8, align 1
// CHECK-NEXT: call void @_ZN3FooIcEC2Ec(%struct.Foo* noundef nonnull align 1 dereferenceable(1) [[THIS1]], i8 noundef signext [[TMP0]])
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIcED1Ev(
+// CHECK-LABEL: @_ZN3FooIcED1Ev(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo*, align 8
// CHECK-NEXT: store %struct.Foo* [[THIS:%.*]], %struct.Foo** [[THIS_ADDR]], align 8
// CHECK-NEXT: call void @_ZN3FooIcED2Ev(%struct.Foo* noundef nonnull align 1 dereferenceable(1) [[THIS1]]) #[[ATTR2:[0-9]+]]
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIcE3getEv(
+// CHECK-LABEL: @_ZN3FooIcE3getEv(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo*, align 8
// CHECK-NEXT: store %struct.Foo* [[THIS:%.*]], %struct.Foo** [[THIS_ADDR]], align 8
// CHECK-NEXT: [[TMP0:%.*]] = load i8, i8* [[X]], align 1
// CHECK-NEXT: ret i8 [[TMP0]]
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIcE3setEc(
+// CHECK-LABEL: @_ZN3FooIcE3setEc(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo*, align 8
// CHECK-NEXT: [[_X_ADDR:%.*]] = alloca i8, align 1
//
template struct Foo<char>;
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIsEC1Es(
+// CHECK-LABEL: @_ZN3FooIsEC1Es(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo.0*, align 8
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca i16, align 2
// CHECK-NEXT: call void @_ZN3FooIsEC2Es(%struct.Foo.0* noundef nonnull align 2 dereferenceable(2) [[THIS1]], i16 noundef signext [[TMP0]])
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIsED1Ev(
+// CHECK-LABEL: @_ZN3FooIsED1Ev(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo.0*, align 8
// CHECK-NEXT: store %struct.Foo.0* [[THIS:%.*]], %struct.Foo.0** [[THIS_ADDR]], align 8
// CHECK-NEXT: call void @_ZN3FooIsED2Ev(%struct.Foo.0* noundef nonnull align 2 dereferenceable(2) [[THIS1]]) #[[ATTR2]]
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIsE3getEv(
+// CHECK-LABEL: @_ZN3FooIsE3getEv(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo.0*, align 8
// CHECK-NEXT: store %struct.Foo.0* [[THIS:%.*]], %struct.Foo.0** [[THIS_ADDR]], align 8
// CHECK-NEXT: [[TMP0:%.*]] = load i16, i16* [[X]], align 2
// CHECK-NEXT: ret i16 [[TMP0]]
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3FooIsE3setEs(
+// CHECK-LABEL: @_ZN3FooIsE3setEs(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Foo.0*, align 8
// CHECK-NEXT: [[_X_ADDR:%.*]] = alloca i16, align 2
// This should not generate lines for the implicit specialization of Foo, but
// should generate lines for the explicit specialization of Bar.
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BarIiEC1Ei(
+// CHECK-LABEL: @_ZN3BarIiEC1Ei(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Bar*, align 8
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
// CHECK-NEXT: call void @_ZN3BarIiEC2Ei(%struct.Bar* noundef nonnull align 4 dereferenceable(4) [[THIS1]], i32 noundef [[TMP0]])
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BarIiED1Ev(
+// CHECK-LABEL: @_ZN3BarIiED1Ev(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Bar*, align 8
// CHECK-NEXT: store %struct.Bar* [[THIS:%.*]], %struct.Bar** [[THIS_ADDR]], align 8
// CHECK-NEXT: call void @_ZN3BarIiED2Ev(%struct.Bar* noundef nonnull align 4 dereferenceable(4) [[THIS1]]) #[[ATTR2]]
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BarIiE3getEv(
+// CHECK-LABEL: @_ZN3BarIiE3getEv(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Bar*, align 8
// CHECK-NEXT: store %struct.Bar* [[THIS:%.*]], %struct.Bar** [[THIS_ADDR]], align 8
// CHECK-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN3FooIiE3getEv(%struct.Foo.1* noundef nonnull align 4 dereferenceable(4) [[FOO]])
// CHECK-NEXT: ret i32 [[CALL]]
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BarIiE3setEi(
+// CHECK-LABEL: @_ZN3BarIiE3setEi(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Bar*, align 8
// CHECK-NEXT: [[_X_ADDR:%.*]] = alloca i32, align 4
// This should not generate lines for the implicit specialization of Foo, but
// should generate lines for the explicit specialization of Baz.
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BazIlEC1El(
+// CHECK-LABEL: @_ZN3BazIlEC1El(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Baz*, align 8
// CHECK-NEXT: [[X_ADDR:%.*]] = alloca i64, align 8
// CHECK-NEXT: call void @_ZN3BazIlEC2El(%struct.Baz* noundef nonnull align 8 dereferenceable(8) [[THIS1]], i64 noundef [[TMP0]])
// CHECK-NEXT: ret void
//
-// CHECK-LABEL: define {{[^@]+}}@_ZN3BazIlED1Ev(
+// CHECK-LABEL: @_ZN3BazIlED1Ev(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.Baz*, align 8
// CHECK-NEXT: store %struct.Baz* [[THIS:%.*]], %struct.Baz** [[THIS_ADDR]], align 8
__test_offloading_42_abcdef_bar_l123();
int somevar_abc123_;
}
-// CHECK-LABEL: define {{[^@]+}}@foo(
+// CHECK-LABEL: @foo(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK-NEXT: ret void
//
//
-// CHECK-LABEL: define {{[^@]+}}@{{__omp_offloading_[a-z0-9]+_[a-z0-9]+_foo_l[0-9]+}}(
+// CHECK-LABEL: @{{__omp_offloading_[a-z0-9]+_[a-z0-9]+_foo_l[0-9]+}}(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK-NEXT: store i64 [[A:%.*]], i64* [[A_ADDR]], align 8
A[i] = 1.0;
}
}
-// OMP-LABEL: define {{[^@]+}}@main(
+// OMP-LABEL: @main(
// OMP-NEXT: entry:
// OMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: ret i32 0
//
//
-// OMP-LABEL: define {{[^@]+}}@.omp_outlined.(
+// OMP-LABEL: @.omp_outlined.(
// OMP-NEXT: entry:
// OMP-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// OMP-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// OMP-NEXT: ret void
//
//
-// OMP-LABEL: define {{[^@]+}}@foo(
+// OMP-LABEL: @foo(
// OMP-NEXT: entry:
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: ret void
//
//
-// OMP-LABEL: define {{[^@]+}}@.omp_outlined..1(
+// OMP-LABEL: @.omp_outlined..1(
// OMP-NEXT: entry:
// OMP-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// OMP-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// OMP-NEXT: ret void
//
//
-// NOOMP-LABEL: define {{[^@]+}}@main(
+// NOOMP-LABEL: @main(
// NOOMP-NEXT: entry:
// NOOMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// NOOMP-NEXT: [[I:%.*]] = alloca i32, align 4
// NOOMP-NEXT: ret i32 0
//
//
-// NOOMP-LABEL: define {{[^@]+}}@foo(
+// NOOMP-LABEL: @foo(
// NOOMP-NEXT: entry:
// NOOMP-NEXT: [[I:%.*]] = alloca i32, align 4
// NOOMP-NEXT: store i32 0, i32* [[I]], align 4
void foo(void);
-// OMP-LABEL: define {{[^@]+}}@main(
+// OMP-LABEL: @main(
// OMP-NEXT: entry:
// OMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: call void @foo()
// OMP-NEXT: ret i32 0
//
-// NOOMP-LABEL: define {{[^@]+}}@main(
+// NOOMP-LABEL: @main(
// NOOMP-NEXT: entry:
// NOOMP-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
// NOOMP-NEXT: [[I:%.*]] = alloca i32, align 4
return 0;
}
-// OMP-LABEL: define {{[^@]+}}@foo(
+// OMP-LABEL: @foo(
// OMP-NEXT: entry:
// OMP-NEXT: [[I:%.*]] = alloca i32, align 4
// OMP-NEXT: store i32 0, i32* [[I]], align 4
// OMP-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB2]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// OMP-NEXT: ret void
//
-// NOOMP-LABEL: define {{[^@]+}}@foo(
+// NOOMP-LABEL: @foo(
// NOOMP-NEXT: entry:
// NOOMP-NEXT: [[I:%.*]] = alloca i32, align 4
// NOOMP-NEXT: store i32 0, i32* [[I]], align 4
// CHECK: @bar.hex = internal global i32 [[#0x20]], align 4
// CHECK: @bar.dec = internal global i32 20, align 4
//.
-// CHECK-LABEL: define {{[^@]+}}@foo(
+// CHECK-LABEL: @foo(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
//
static int hex = 0x10;
static int dec = 10;
}
-// CHECK-LABEL: define {{[^@]+}}@bar(
+// CHECK-LABEL: @bar(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
//
// CHECK: @foo.i = internal global i32 0, align 4
// CHECK: @foo.j = internal global i32 0, align 4
//.
-// CHECK-LABEL: define {{[^@]+}}@foo(
+// CHECK-LABEL: @foo(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
//
void foo(void) {
static int i, j;
}
-// CHECK-LABEL: define {{[^@]+}}@bar(
+// CHECK-LABEL: @bar(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret void
//
// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s -DFOO | FileCheck -check-prefixes=CHECK,FOO %s
#ifdef FOO
-// FOO-LABEL: define {{[^@]+}}@foo(
+// FOO-LABEL: @foo(
// FOO-NEXT: entry:
// FOO-NEXT: ret i32 1
//
}
#endif
-// CHECK-LABEL: define {{[^@]+}}@bar(
+// CHECK-LABEL: @bar(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret i32 2
//
// Example input for update_cc_test_checks
// RUN: %clang_cc1 -no-opaque-pointers -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
-// CHECK-LABEL: define {{[^@]+}}@test(
+// CHECK-LABEL: @test(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
}
// A function with a mangled name
-// CHECK-LABEL: define {{[^@]+}}@_Z4testlii(
+// CHECK-LABEL: @_Z4testlii(
// CHECK-NEXT: entry:
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
-// CHECK-LABEL: define {{[^@]+}}@checks_please(
+// CHECK-LABEL: @checks_please(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret i32 1
//
// UTC_ARGS: --enable
-// CHECK-LABEL: define {{[^@]+}}@checks_again(
+// CHECK-LABEL: @checks_again(
// CHECK-NEXT: entry:
// CHECK-NEXT: ret i32 2
//
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -emit-llvm -o - %s | \
// RUN: FileCheck %s
-// CHECK-LABEL: define {{[^@]+}}@foo(
+// CHECK-LABEL: @foo(
// CHECK-NEXT: entry:
// CHECK-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_foo_l7() #[[ATTR2:[0-9]+]]
// CHECK-NEXT: ret void
BOTH-NEXT:// CHECK: @bar.i = internal global i32 0, align 4
BOTH-NEXT:// CHECK: @bar.j = internal global i32 0, align 4
BOTH-NEXT://.
- BOTH-NEXT:// CHECK-LABEL: define {{.+}}@foo(
+ BOTH-NEXT:// CHECK-LABEL: @foo(
BOTH-NEXT:// CHECK-NEXT: entry:
BOTH-NEXT:// CHECK-NEXT: ret void
BOTH-NEXT://
NRM-NEXT: static int i, j;
NRM-NEXT:}
IGF-NEXT://
- BOTH-NEXT:// CHECK-LABEL: define {{.+}}@bar(
+ BOTH-NEXT:// CHECK-LABEL: @bar(
BOTH-NEXT:// CHECK-NEXT: entry:
BOTH-NEXT:// CHECK-NEXT: ret void
BOTH-NEXT://
; RUN: opt < %s -S | FileCheck %s
define i32 @reuse_arg_names(i32 %X, i32 %Y) {
-; CHECK-LABEL: define {{[^@]+}}@reuse_arg_names(
+; CHECK-LABEL: @reuse_arg_names(
; CHECK-NEXT: [[Z:%.*]] = sub i32 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: [[Q:%.*]] = add i32 [[Z]], [[Y]]
; CHECK-NEXT: ret i32 [[Q]]
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
define i32 @common_sub_operand(i32 %X, i32 %Y) {
-; CHECK-LABEL: define {{[^@]+}}@common_sub_operand(
+; CHECK-LABEL: @common_sub_operand(
; CHECK-NEXT: ret i32 [[X:%.*]]
;
%Z = sub i32 %X, %Y
}
define i32 @negated_operand(i32 %x) {
-; CHECK-LABEL: define {{[^@]+}}@negated_operand(
+; CHECK-LABEL: @negated_operand(
; CHECK-NEXT: ret i32 0
;
%negx = sub i32 0, %x
}
define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
-; CHECK-LABEL: define {{[^@]+}}@negated_operand_commute_vec(
+; CHECK-LABEL: @negated_operand_commute_vec(
; CHECK-NEXT: ret <2 x i32> zeroinitializer
;
%negx = sub <2 x i32> zeroinitializer, %x
}
define i8 @knownnegation(i8 %x, i8 %y) {
-; CHECK-LABEL: define {{[^@]+}}@knownnegation(
+; CHECK-LABEL: @knownnegation(
; CHECK-NEXT: ret i8 0
;
%xy = sub i8 %x, %y
}
define <2 x i8> @knownnegation_commute_vec(<2 x i8> %x, <2 x i8> %y) {
-; CHECK-LABEL: define {{[^@]+}}@knownnegation_commute_vec(
+; CHECK-LABEL: @knownnegation_commute_vec(
; CHECK-NEXT: ret <2 x i8> zeroinitializer
;
%xy = sub <2 x i8> %x, %y
}
define i32 @nameless_value(i32 %X) {
-; CHECK-LABEL: define {{[^@]+}}@nameless_value(
+; CHECK-LABEL: @nameless_value(
; CHECK-NEXT: [[TMP1:%.*]] = sub i32 42, [[X:%.*]]
; CHECK-NEXT: ret i32 [[TMP1]]
;
; RUN: llvm-extract -S --func=foo %s | FileCheck --check-prefixes=CHECK %s
define i32 @foo(i32 %x) {
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: [[Y:%.*]] = add i32 [[X:%.*]], 1
; CHECK-NEXT: ret i32 [[Y]]
;
+++ /dev/null
-; RUN: opt < %s -S | FileCheck %s
-
-define i32 @a() {
- %val = call i32 @b(i32 0)
- ret i32 %val
-}
-
-define i32 @b(i32 %arg) {
- ret i32 %arg
-}
+++ /dev/null
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -S | FileCheck %s
-
-define i32 @a() {
-; CHECK-LABEL: define {{[^@]+}}@a(
-; CHECK-NEXT: [[VAL:%.*]] = call i32 @b(i32 0)
-; CHECK-NEXT: ret i32 [[VAL]]
-;
- %val = call i32 @b(i32 0)
- ret i32 %val
-}
-
-define i32 @b(i32 %arg) {
-; CHECK-LABEL: define {{[^@]+}}@b(
-; CHECK-NEXT: ret i32 [[ARG:%.*]]
-;
- ret i32 %arg
-}
declare void @llvm.trap() noreturn cold
declare void @_Z10sideeffectv()
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; CHECK-NEXT: ret void
;
;
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; CHECK-NEXT: ret void
;
;
-; CHECK-LABEL: define {{[^@]+}}@foo.cold.1(
+; CHECK-LABEL: @foo.cold.1(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[SINK:%.*]]
; CHECK: sink:
; CHECK-NEXT: unreachable
;
;
-; CHECK-LABEL: define {{[^@]+}}@bar.cold.1(
+; CHECK-LABEL: @bar.cold.1(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[SINK:%.*]]
; CHECK: sink:
;.
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external dso_local global i32, align 4
;.
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; CHECK-NEXT: ret void
;
;
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; CHECK-NEXT: ret void
;
;
-; CHECK-LABEL: define {{[^@]+}}@foo.cold.1(
+; CHECK-LABEL: @foo.cold.1(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[SINK:%.*]]
; CHECK: sink:
; CHECK-NEXT: unreachable
;
;
-; CHECK-LABEL: define {{[^@]+}}@bar.cold.1(
+; CHECK-LABEL: @bar.cold.1(
; CHECK-NEXT: newFuncRoot:
; CHECK-NEXT: br label [[SINK:%.*]]
; CHECK: sink:
@G = external dso_local global i32, align 4
define void @foo(i32) {
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
}
define void @bar(i32) {
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external dso_local global i32, align 4
;.
define void @foo(i32) {
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
}
define void @bar(i32) {
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; CHECK-NEXT: tail call void @_Z10sideeffectv()
; CHECK-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
declare void @llvm.trap() noreturn cold
declare void @_Z10sideeffectv()
-; REUSE-LABEL: define {{[^@]+}}@foo(
+; REUSE-LABEL: @foo(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; REUSE-NEXT: ret void
;
;
-; REUSE-LABEL: define {{[^@]+}}@bar(
+; REUSE-LABEL: @bar(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; REUSE-NEXT: ret void
;
;
-; REUSE-LABEL: define {{[^@]+}}@foo.cold.1(
+; REUSE-LABEL: @foo.cold.1(
; REUSE-NEXT: newFuncRoot:
; REUSE-NEXT: br label [[SINK:%.*]]
; REUSE: sink:
; REUSE-NEXT: unreachable
;
;
-; REUSE-LABEL: define {{[^@]+}}@bar.cold.1(
+; REUSE-LABEL: @bar.cold.1(
; REUSE-NEXT: newFuncRoot:
; REUSE-NEXT: br label [[SINK:%.*]]
; REUSE: sink:
;.
; REUSE: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external dso_local global i32, align 4
;.
-; REUSE-LABEL: define {{[^@]+}}@foo(
+; REUSE-LABEL: @foo(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; REUSE-NEXT: ret void
;
;
-; REUSE-LABEL: define {{[^@]+}}@bar(
+; REUSE-LABEL: @bar(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; REUSE-NEXT: ret void
;
;
-; REUSE-LABEL: define {{[^@]+}}@foo.cold.1(
+; REUSE-LABEL: @foo.cold.1(
; REUSE-NEXT: newFuncRoot:
; REUSE-NEXT: br label [[SINK:%.*]]
; REUSE: sink:
; REUSE-NEXT: unreachable
;
;
-; REUSE-LABEL: define {{[^@]+}}@bar.cold.1(
+; REUSE-LABEL: @bar.cold.1(
; REUSE-NEXT: newFuncRoot:
; REUSE-NEXT: br label [[SINK:%.*]]
; REUSE: sink:
@G = external dso_local global i32, align 4
define void @foo(i32) {
-; REUSE-LABEL: define {{[^@]+}}@foo(
+; REUSE-LABEL: @foo(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
}
define void @bar(i32) {
-; REUSE-LABEL: define {{[^@]+}}@bar(
+; REUSE-LABEL: @bar(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
; REUSE: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external dso_local global i32, align 4
;.
define void @foo(i32) {
-; REUSE-LABEL: define {{[^@]+}}@foo(
+; REUSE-LABEL: @foo(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
}
define void @bar(i32) {
-; REUSE-LABEL: define {{[^@]+}}@bar(
+; REUSE-LABEL: @bar(
; REUSE-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0:%.*]], 0
; REUSE-NEXT: tail call void @_Z10sideeffectv()
; REUSE-NEXT: br i1 [[TMP2]], label [[CODEREPL:%.*]], label [[EXIT:%.*]]
declare void @foo()
define internal void @bar() {
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: call void @foo() #[[ATTR0:[0-9]+]]
; CHECK-NEXT: ret void
;
declare void @foo()
define internal void @bar() {
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: ret void
;
; Also verify we use "ONE_AND_FOUR" for the unmodified @sometimes_here version and "THREE" for the version without the add.
define internal void @sometimes_here() {
-; ONE_AND_FOUR-LABEL: define {{[^@]+}}@sometimes_here(
+; ONE_AND_FOUR-LABEL: @sometimes_here(
; ONE_AND_FOUR-NEXT: [[C:%.*]] = add i32 undef, undef
; ONE_AND_FOUR-NEXT: ret void
;
-; THREE-LABEL: define {{[^@]+}}@sometimes_here(
+; THREE-LABEL: @sometimes_here(
; THREE-NEXT: ret void
;
%c = add i32 undef, undef
}
define void @always_here() {
-; ALL-LABEL: define {{[^@]+}}@always_here(
+; ALL-LABEL: @always_here(
; ALL-NEXT: ret void
;
ret void
; Function Attrs: nounwind uwtable
define dso_local void @foo(i32* %A) #0 !dbg !7 {
-; CHECK-LABEL: define {{[^@]+}}@foo(
+; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
; Function Attrs: nounwind uwtable
define dso_local void @bar(i32* %A) #0 !dbg !39 {
-; CHECK-LABEL: define {{[^@]+}}@bar(
+; CHECK-LABEL: @bar(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
+++ /dev/null
-# Verify that calls and defines of the same function can be mixed
-# RUN: cp -f %S/Inputs/define_after_call.ll %t.ll && %update_test_checks %t.ll
-# RUN: diff -u %t.ll %S/Inputs/define_after_call.ll.expected
-# RUN: opt < %t.ll -S | FileCheck %t.ll
func_name, preserve_names, function_sig,
global_vars_seen_dict, is_filtered):
# Label format is based on IR string.
- function_def_regex = 'define {{[^@]+}}'
+ function_def_regex = 'define {{[^@]+}}' if function_sig else ''
check_label_format = '{} %s-LABEL: {}@%s%s%s'.format(comment_marker, function_def_regex)
return add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name,
check_label_format, False, preserve_names, global_vars_seen_dict,