Skip to content

Commit 610b959

Browse files
authored
Adjust tests for llvm commit 4b163e343cfa (#128)
That commit changed the mangling of some existing template parameters. This commit adjusts the tests to the new mangling, but keeps old tests under -fclang-abi-compat=17.
1 parent b1d0bed commit 610b959

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

ABI-Testsuite/test/mangling/expressions.xpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
22
// See https://llvm.org/LICENSE.txt for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
// RUN: cxx_compiler cxx_11 -fclang-abi-compat=17 cxx_rtti cxx_exceptions -c %s -o %t.o
5+
// RUN: bindump %t.o | FileCheck prefixes --check-prefix=CHECK17 --check-prefix=LP64-17 %s
46
// RUN: cxx_compiler cxx_11 cxx_rtti cxx_exceptions -c %s -o %t.o
57
// RUN: bindump %t.o | FileCheck prefixes %s
68

@@ -9,14 +11,13 @@
911
template<class T, int N> struct S1 {};
1012
template<class T, T N> struct S2 {};
1113

12-
// LP64-DAG: _Z1fIiEv2S1IT_Li16EE
1314
// ILP32-DAG: _Z1fIiEv2S1IT_Li12EE
1415
template<class T> void f(S1<T, sizeof(long double)>);
1516
// The sizeof(...) is not instantiation-dependent, and converted to int:
1617
// the result is encoded as "Li16E" for 16-byte long double types.
1718
template <> void f<int>(S1<int, sizeof(long double)>) {}
1819

19-
// LP64-DAG: _Z1fIiEv2S2IT_XLm16EEE
20+
// LP64-17-DAG: _Z1fIiEv2S2IT_Lm16EE
2021
// ILP32-DAG: _Z1fIiEv2S2IT_XLj12EEE
2122
template<class T> void f(S2<T, sizeof(long double)>);
2223
// The sizeof(...) is not instantiaion-dependent, and converted to an

ABI-Testsuite/test/mangling/literals1.xpp

+23-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
22
// See https://llvm.org/LICENSE.txt for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
// RUN: cxx_compiler cxx_11 -fclang-abi-compat=17 -c %s -o %t.o
5+
// RUN: bindump %t.o | FileCheck prefixes --check-prefix=LP64-17 --check-prefix=CHECK17 %s
46
// RUN: cxx_compiler cxx_11 -c %s -o %t.o
5-
// RUN: bindump %t.o | FileCheck prefixes %s
7+
// RUN: bindump %t.o | FileCheck prefixes --check-prefix=LP64-18 --check-prefix=CHECK18 %s
68

79

810

@@ -22,25 +24,35 @@ enum colour { RED = -3, GREEN, BLUE};
2224
// use long type for enumeration
2325
enum bigcolour { YELLOW = (1l << 32), CYAN, MAGENTA};
2426
void callreturnit() {
25-
// CHECK-DAG: _Z8returnitIiLi4EET_v
27+
// CHECK17-DAG: _Z8returnitIiLi4EET_v
28+
// CHECK18-DAG: _Z8returnitIiTnT_Li4EES0_v
2629
auto a = returnit<int, 4>();
27-
// CHECK-DAG: _Z8returnitIjLj4EET_v
30+
// CHECK17-DAG: _Z8returnitIjLj4EET_v
31+
// CHECK18-DAG: _Z8returnitIjTnT_Lj4EES0_v
2832
auto b = returnit<unsigned int, 4>();
29-
// CHECK-DAG: _Z8returnitIlLl4EET_v
33+
// CHECK17-DAG: _Z8returnitIlLl4EET_v
34+
// CHECK18-DAG: _Z8returnitIlTnT_Ll4EES0_v
3035
auto c = returnit<long, 4>();
31-
// CHECK-DAG: _Z8returnitImLm4EET_v
36+
// CHECK17-DAG: _Z8returnitImLm4EET_v
37+
// CHECK18-DAG: _Z8returnitImTnT_Lm4EES0_v
3238
auto d = returnit<unsigned long, 4>();
33-
// CHECK-DAG: _Z8returnitIxLxn456789EET_v
39+
// CHECK17-DAG: _Z8returnitIxLxn456789EET_v
40+
// CHECK18-DAG: _Z8returnitIxTnT_Lxn456789EES0_v
3441
auto e = returnit<long long, -456789>();
35-
// CHECK-DAG: _Z8returnitIbLb1EET_v
42+
// CHECK17-DAG: _Z8returnitIbLb1EET_v
43+
// CHECK18-DAG: _Z8returnitIbTnT_Lb1EES0_v
3644
auto f = returnit<bool, true>();
37-
// CHECK-DAG: _Z8returnitIbLb0EET_v
45+
// CHECK17-DAG: _Z8returnitIbLb0EET_v
46+
// CHECK18-DAG: _Z8returnitIbTnT_Lb0EES0_v
3847
auto g = returnit<bool, false>();
39-
// CHECK-DAG: _Z8returnitIDnLDn0EET_v
48+
// CHECK17-DAG: _Z8returnitIDnLDn0EET_v
49+
// CHECK18-DAG: _Z8returnitIDnTnT_LDn0EES0_v
4050
auto n = returnit<std::nullptr_t, nullptr>();
41-
// CHECK-DAG: _Z8returnitI6colourLS0_n2EET_v
51+
// CHECK17-DAG: _Z8returnitI6colourLS0_n2EET_v
52+
// CHECK18-DAG: _Z8returnitI6colourTnT_LS0_n2EES1_v
4253
auto cg = returnit<colour, GREEN>();
43-
// LP64-DAG: _Z8returnitI9bigcolourLS0_4294967296EET_v
54+
// LP64-17-DAG: _Z8returnitI9bigcolourLS0_4294967296EET_v
55+
// LP64-18-DAG: _Z8returnitI9bigcolourTnT_LS0_4294967296EES1_v
4456
// ILP32-DAG: _Z8returnitI9bigcolourLS0_n2147483648EET_v
4557
auto cy = returnit<bigcolour, YELLOW>();
4658
}

0 commit comments

Comments
 (0)