Skip to content

Commit 36cd62f

Browse files
committed
Use -SAME to define variables after -LABEL checks.
1 parent ca97344 commit 36cd62f

File tree

5 files changed

+45
-63
lines changed

5 files changed

+45
-63
lines changed

clang/test/CodeGen/call-graph-section-callback.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ typedef void (*CallbackFn)(int);
1010

1111
// Callback function with "internal" linkage.
1212
// CHECK-LABEL: define internal void @_ZL10myCallbacki(
13-
// CHECK: {{.*}} !type [[F_CALLBACK:![0-9]+]]
13+
// CHECK-SAME: {{.*}} !type [[F_CALLBACK:![0-9]+]]
1414
static void myCallback(int value)
1515
{
1616
volatile int sink = value;

clang/test/CodeGen/call-graph-section-templates.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ template <class T>
1717
class Cls2 {
1818
public:
1919
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f1Ev(
20-
// FT: {{.*}} !type [[F_TCLS2F1:![0-9]+]]
20+
// FT-SAME: {{.*}} !type [[F_TCLS2F1:![0-9]+]]
2121
void f1() {}
2222

2323
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f2ES0_(
24-
// FT: {{.*}} !type [[F_TCLS2F2:![0-9]+]]
24+
// FT-SAME: {{.*}} !type [[F_TCLS2F2:![0-9]+]]
2525
void f2(T a) {}
2626

2727
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f3EPS0_(
28-
// FT: {{.*}} !type [[F_TCLS2F3:![0-9]+]]
28+
// FT-SAME: {{.*}} !type [[F_TCLS2F3:![0-9]+]]
2929
void f3(T *a) {}
3030

3131
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f4EPKS0_(
32-
// FT: {{.*}} !type [[F_TCLS2F4:![0-9]+]]
32+
// FT-SAME: {{.*}} !type [[F_TCLS2F4:![0-9]+]]
3333
void f4(const T *a) {}
3434

3535
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f5ERS0_(
36-
// FT: {{.*}} !type [[F_TCLS2F5:![0-9]+]]
36+
// FT-SAME: {{.*}} !type [[F_TCLS2F5:![0-9]+]]
3737
void f5(T &a) {}
3838

3939
// FT-LABEL: define {{.*}} void @_ZN4Cls2I4Cls1E2f6ERKS0_(
40-
// FT: {{.*}} !type [[F_TCLS2F6:![0-9]+]]
40+
// FT-SAME: {{.*}} !type [[F_TCLS2F6:![0-9]+]]
4141
void f6(const T &a) {}
4242

4343
// Mixed type function pointer member
@@ -58,6 +58,7 @@ template <class T>
5858
T *T_func(T a, T *b, const T *c, T &d, const T &e) { return b; }
5959

6060
// CST-LABEL: define {{.*}} @_Z3foov
61+
// CST-SAME: {{.*}} !type [[F_TCLS2F1:![0-9]+]]
6162
void foo() {
6263
// Methods for Cls2<Cls1> is checked above within the template description.
6364
Cls2<Cls1> Obj;
@@ -98,7 +99,7 @@ void foo() {
9899
}
99100

100101
// CST-LABEL: define {{.*}} @_Z6T_funcI4Cls1EPT_S1_S2_PKS1_RS1_RS3_(
101-
// CST: {{.*}} !type [[F_TFUNC_CLS1:![0-9]+]]
102+
// CST-SAME: {{.*}} !type [[F_TFUNC_CLS1:![0-9]+]]
102103

103104
// CST: [[F_TCLS2F1]] = !{i64 0, !"_ZTSFvvE.generalized"}
104105
// CST: [[F_TFUNC_CLS1_CT]] = !{[[F_TFUNC_CLS1:![0-9]+]]}

clang/test/CodeGen/call-graph-section-virtual-methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Base {
1313
public:
1414
// FT-LABEL: define {{.*}} @_ZN4Base2vfEPc(
15-
// FT: {{.*}} !type [[F_TVF:![0-9]+]]
15+
// FT-SAME: {{.*}} !type [[F_TVF:![0-9]+]]
1616
virtual int vf(char *a) { return 0; };
1717
};
1818

clang/test/CodeGen/call-graph-section.c

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,46 @@
11
// Tests that we assign appropriate identifiers to indirect calls and targets.
22

33
// RUN: %clang_cc1 -triple x86_64-unknown-linux -fexperimental-call-graph-section \
4-
// RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=ITANIUM %s
4+
// RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,ITANIUM %s
55

66
// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fexperimental-call-graph-section \
7-
// RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=MS %s
7+
// RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,MS %s
88

9-
// ITANIUM-LABEL: define {{(dso_local)?}} void @foo(
10-
// ITANIUM: {{.*}} !type [[F_TVOID:![0-9]+]]
11-
// MS-LABEL: define {{(dso_local)?}} void @foo(
12-
// MS: {{.*}} !type [[F_TVOID:![0-9]+]]
9+
// CHECK-LABEL: define {{(dso_local)?}} void @foo(
10+
// CHECK-SAME: {{.*}} !type [[F_TVOID:![0-9]+]]
1311
void foo() {
1412
}
1513

16-
// ITANIUM-LABEL: define {{(dso_local)?}} void @bar(
17-
// ITANIUM: {{.*}} !type [[F_TVOID]]
18-
// MS-LABEL: define {{(dso_local)?}} void @bar(
19-
// MS: {{.*}} !type [[F_TVOID]]
14+
// CHECK-LABEL: define {{(dso_local)?}} void @bar(
15+
// CHECK-SAME: {{.*}} !type [[F_TVOID]]
2016
void bar() {
2117
void (*fp)() = foo;
2218
// ITANIUM: call {{.*}}, !callee_type [[F_TVOID_CT:![0-9]+]]
2319
// MS: call {{.*}}, !callee_type [[F_TVOID_CT:![0-9]+]]
2420
fp();
2521
}
2622

27-
// ITANIUM-LABEL: define {{(dso_local)?}} i32 @baz(
28-
// ITANIUM: {{.*}} !type [[F_TPRIMITIVE:![0-9]+]]
29-
// MS-LABEL: define {{(dso_local)?}} i32 @baz(
30-
// MS: {{.*}} !type [[F_TPRIMITIVE:![0-9]+]]
23+
// CHECK-LABEL: define {{(dso_local)?}} i32 @baz(
24+
// CHECK-SAME: {{.*}} !type [[F_TPRIMITIVE:![0-9]+]]
3125
int baz(char a, float b, double c) {
3226
return 1;
3327
}
3428

35-
// ITANIUM-LABEL: define {{(dso_local)?}} ptr @qux(
36-
// ITANIUM: {{.*}} !type [[F_TPTR:![0-9]+]]
37-
// MS-LABEL: define {{(dso_local)?}} ptr @qux(
38-
// MS: {{.*}} !type [[F_TPTR:![0-9]+]]
29+
// CHECK-LABEL: define {{(dso_local)?}} ptr @qux(
30+
// CHECK-SAME: {{.*}} !type [[F_TPTR:![0-9]+]]
3931
int *qux(char *a, float *b, double *c) {
4032
return 0;
4133
}
4234

43-
// ITANIUM-LABEL: define {{(dso_local)?}} void @corge(
44-
// ITANIUM: {{.*}} !type [[F_TVOID]]
45-
// MS-LABEL: define {{(dso_local)?}} void @corge(
46-
// MS: {{.*}} !type [[F_TVOID]]
35+
// CHECK-LABEL: define {{(dso_local)?}} void @corge(
36+
// CHECK-SAME: {{.*}} !type [[F_TVOID]]
4737
void corge() {
48-
int (*fp_baz)(char, float, double) = baz;
49-
// ITANIUM: call i32 {{.*}}, !callee_type [[F_TPRIMITIVE_CT:![0-9]+]]
50-
// MS: call i32 {{.*}}, !callee_type [[F_TPRIMITIVE_CT:![0-9]+]]
38+
int (*fp_baz)(char, float, double) = baz;
39+
// CHECK: call i32 {{.*}}, !callee_type [[F_TPRIMITIVE_CT:![0-9]+]]
5140
fp_baz('a', .0f, .0);
5241

53-
int *(*fp_qux)(char *, float *, double *) = qux;
54-
// ITANIUM: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
55-
// MS: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
42+
int *(*fp_qux)(char *, float *, double *) = qux;
43+
// CHECK: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
5644
fp_qux(0, 0, 0);
5745
}
5846

@@ -64,31 +52,24 @@ struct st2 {
6452
struct st1 m;
6553
};
6654

67-
// ITANIUM-LABEL: define {{(dso_local)?}} void @stparam(
68-
// ITANIUM: {{.*}} !type [[F_TSTRUCT:![0-9]+]]
69-
// MS-LABEL: define {{(dso_local)?}} void @stparam(
70-
// MS: {{.*}} !type [[F_TSTRUCT:![0-9]+]]
55+
// CHECK-LABEL: define {{(dso_local)?}} void @stparam(
56+
// CHECK-SAME: {{.*}} !type [[F_TSTRUCT:![0-9]+]]
7157
void stparam(struct st2 a, struct st2 *b) {}
7258

73-
// ITANIUM-LABEL: define {{(dso_local)?}} void @stf(
74-
// ITANIUM: {{.*}} !type [[F_TVOID]]
75-
// MS-LABEL: define {{(dso_local)?}} void @stf(
76-
// MS: {{.*}} !type [[F_TVOID]]
59+
// CHECK-LABEL: define {{(dso_local)?}} void @stf(
60+
// CHECK-SAME: {{.*}} !type [[F_TVOID]]
7761
void stf() {
7862
struct st1 St1;
79-
St1.fp = qux;
80-
// ITANIUM: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
81-
// MS: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
63+
St1.fp = qux;
64+
// CHECK: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
8265
St1.fp(0, 0, 0);
8366

8467
struct st2 St2;
85-
St2.m.fp = qux;
86-
// ITANIUM: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
87-
// MS: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
68+
St2.m.fp = qux;
69+
// CHECK: call ptr {{.*}}, !callee_type [[F_TPTR_CT:![0-9]+]]
8870
St2.m.fp(0, 0, 0);
89-
90-
// ITANIUM: call void {{.*}}, !callee_type [[F_TSTRUCT_CT:![0-9]+]]
91-
// MS: call void {{.*}}, !callee_type [[F_TSTRUCT_CT:![0-9]+]]
71+
72+
// CHECK: call void {{.*}}, !callee_type [[F_TSTRUCT_CT:![0-9]+]]
9273
void (*fp_stparam)(struct st2, struct st2 *) = stparam;
9374
fp_stparam(St2, &St2);
9475
}

clang/test/CodeGen/call-graph-section.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,39 @@ class Cls2 {
2121
int *(*fp)(char *, float *);
2222

2323
// FT-LABEL: define {{.*}} i32 @_ZN4Cls22f1Ecfd(
24-
// FT: {{.*}} !type [[F_TCLS2F1:![0-9]+]]
24+
// FT-SAME: {{.*}} !type [[F_TCLS2F1:![0-9]+]]
2525
int f1(char a, float b, double c) { return 0; }
2626

2727
// FT-LABEL: define {{.*}} ptr @_ZN4Cls22f2EPcPfPd(
28-
// FT: {{.*}} !type [[F_TCLS2F2:![0-9]+]]
28+
// FT-SAME: {{.*}} !type [[F_TCLS2F2:![0-9]+]]
2929
int *f2(char *a, float *b, double *c) { return 0; }
3030

3131
// FT-LABEL: define {{.*}} void @_ZN4Cls22f3E4Cls1(
32-
// FT: {{.*}} !type [[F_TCLS2F3F4:![0-9]+]]
32+
// FT-SAME: {{.*}} !type [[F_TCLS2F3F4:![0-9]+]]
3333
void f3(Cls1 a) {}
3434

3535
// FT-LABEL: define {{.*}} void @_ZN4Cls22f4E4Cls1(
36-
// FT: {{.*}} !type [[F_TCLS2F3F4]]
36+
// FT-SAME: {{.*}} !type [[F_TCLS2F3F4]]
3737
void f4(const Cls1 a) {}
3838

3939
// FT-LABEL: define {{.*}} void @_ZN4Cls22f5EP4Cls1(
40-
// FT: {{.*}} !type [[F_TCLS2F5:![0-9]+]]
40+
// FT-SAME: {{.*}} !type [[F_TCLS2F5:![0-9]+]]
4141
void f5(Cls1 *a) {}
4242

4343
// FT-LABEL: define {{.*}} void @_ZN4Cls22f6EPK4Cls1(
44-
// FT: {{.*}} !type [[F_TCLS2F6:![0-9]+]]
44+
// FT-SAME: {{.*}} !type [[F_TCLS2F6:![0-9]+]]
4545
void f6(const Cls1 *a) {}
4646

4747
// FT-LABEL: define {{.*}} void @_ZN4Cls22f7ER4Cls1(
48-
// FT: {{.*}} !type [[F_TCLS2F7:![0-9]+]]
48+
// FT-SAME: {{.*}} !type [[F_TCLS2F7:![0-9]+]]
4949
void f7(Cls1 &a) {}
5050

5151
// FT-LABEL: define {{.*}} void @_ZN4Cls22f8ERK4Cls1(
52-
// FT: {{.*}} !type [[F_TCLS2F8:![0-9]+]]
52+
// FT-SAME: {{.*}} !type [[F_TCLS2F8:![0-9]+]]
5353
void f8(const Cls1 &a) {}
5454

5555
// FT-LABEL: define {{.*}} void @_ZNK4Cls22f9Ev(
56-
// FT: {{.*}} !type [[F_TCLS2F9:![0-9]+]]
56+
// FT-SAME: {{.*}} !type [[F_TCLS2F9:![0-9]+]]
5757
void f9() const {}
5858
};
5959

0 commit comments

Comments
 (0)