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]+]]
1311void 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]]
2016void 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]+]]
3125int 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]+]]
3931int * 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]]
4737void 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]+]]
7157void 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]]
7761void 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}
0 commit comments