Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/abi/mangle72.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // Verify manglinng of class literals with pointers to members. | |
2 // Some of the mangling here is wrong. Note the FIXME comments below. | |
3 // { dg-do compile { target c++2a } } | |
4 | |
5 struct A { int a[2]; }; | |
6 | |
7 template <A> struct X { }; | |
8 | |
9 // Let's mangle some non-member pointer literals for comparison. | |
10 void f__ (X<A{{ }}>) { } | |
11 // { dg-final { scan-assembler "_Z3f001XIXtl1AEEE" } } | |
12 | |
13 void f0_ (X<A{{ 0 }}>) { } | |
14 // { dg-final { scan-assembler "_Z3f0_1XIXtl1AEEE" } } | |
15 | |
16 void f00 (X<A{{ 0, 0 }}>) { } | |
17 // { dg-final { scan-assembler "_Z3f__1XIXtl1AEEE" } } | |
18 | |
19 | |
20 // Exercise arrays of pointers to data members. | |
21 typedef int (A::*padm_t)[2]; | |
22 | |
23 struct B { padm_t a[2]; }; | |
24 template <B> struct Y { }; | |
25 | |
26 void g__ (Y<B{{ }}>) { } | |
27 // { dg-final { scan-assembler "_Z3g__1YIXtl1BtlA2_M1AA2_iLS3_0EEEEE" } } | |
28 | |
29 void g0_ (Y<B{{ 0 }}>) { } | |
30 // { dg-final { scan-assembler "_Z3g0_1YIXtl1BtlA2_M1AA2_iLS3_0EEEEE" } } | |
31 | |
32 void g00 (Y<B{{ 0, 0 }}>) { } | |
33 // { dg-final { scan-assembler "_Z3g001YIXtl1BtlA2_M1AA2_iLS3_0EEEEE" } } | |
34 | |
35 void g0x (Y<B{{ 0, &A::a }}>) { } | |
36 // FIXME: This needs to mangle differently from g00. The space at | |
37 // the end is intentional to make the directive fail so that the xfail | |
38 // can be reminder to change this once the mangling is fixed. | |
39 // { dg-final { scan-assembler "_Z3g0x1YIXtl1BtlA2_M1AA2_iLS3_0EEEEE " { xfail *-*-* } } } | |
40 | |
41 void gx_ (Y<B{{ &A::a }}>) { } | |
42 // { dg-final { scan-assembler "_Z3gx_1YIXtl1BtlA2_M1AA2_iLS3_0ELS3_0EEEEE" } } | |
43 | |
44 | |
45 struct C { padm_t a[3]; }; | |
46 template <C> struct Z { }; | |
47 | |
48 void h___ (Z<C{{ }}>) { } | |
49 // { dg-final { scan-assembler "_Z4h___1ZIXtl1CtlA3_M1AA2_iLS3_0EEEEE" } } | |
50 | |
51 void h0__ (Z<C{{ 0 }}>) { } | |
52 // { dg-final { scan-assembler "_Z4h0__1ZIXtl1CtlA3_M1AA2_iLS3_0EEEEE" } } | |
53 | |
54 void h00_ (Z<C{{ 0, 0 }}>) { } | |
55 // { dg-final { scan-assembler "_Z4h00_1ZIXtl1CtlA3_M1AA2_iLS3_0EEEEE" } } | |
56 | |
57 void h000 (Z<C{{ 0, 0, 0 }}>) { } | |
58 // { dg-final { scan-assembler "_Z4h0001ZIXtl1CtlA3_M1AA2_iLS3_0EEEEE" } } | |
59 | |
60 void h00x (Z<C{{ 0, 0, &A::a }}>) { } | |
61 // FIXME: This needs to mangle differently from hx0_ and hx__. | |
62 // { dg-final { scan-assembler "_Z4h00x1ZIXtl1CtlA3_M1AA2_iLS3_0ELS3_0EEEEE " { xfail *-*-*} } } | |
63 | |
64 void h0x0 (Z<C{{ 0, &A::a, 0 }}>) { } | |
65 // { dg-final { scan-assembler "_Z4h0x01ZIXtl1CtlA3_M1AA2_iLS3_0ELS3_0ELS3_0EEEEE" } } | |
66 | |
67 void h0x_ (Z<C{{ 0, &A::a }}>) { } | |
68 // { dg-final { scan-assembler "_Z4h0x_1ZIXtl1CtlA3_M1AA2_iLS3_0ELS3_0ELS3_0EEEEE" } } | |
69 | |
70 void hx0_ (Z<C{{ &A::a, 0 }}>) { } | |
71 // FIXME: This needs to mangle differently from h00x and hx__. | |
72 // { dg-final { scan-assembler "_Z4hx0_1ZIXtl1CtlA3_M1AA2_iLS3_0ELS3_0EEEEE " { xfail *-*-*} } } | |
73 | |
74 void hx__ (Z<C{{ &A::a }}>) { } | |
75 // FIXME: This needs to mangle differently from h00x and hx0_. | |
76 // { dg-final { scan-assembler "_Z4hx__1ZIXtl1CtlA3_M1AA2_iLS3_0ELS3_0EEEEE " { xfail *-*-* } } } | |
77 | |
78 | |
79 // Exercise arrays of pointers to function members. | |
80 | |
81 struct AF { void f (); }; | |
82 typedef void (AF::*pafm_t)(); | |
83 | |
84 struct D { pafm_t a[2]; }; | |
85 template <D> struct F { }; | |
86 | |
87 void k__ (F<D{{ }}>) { } | |
88 // { dg-final { scan-assembler "_Z3k__1FIXtl1DEEE" } } | |
89 | |
90 void k0_ (F<D{{ 0 }}>) { } | |
91 // { dg-final { scan-assembler "_Z3k0_1FIXtl1DEEE" } } | |
92 | |
93 void k00 (F<D{{ 0, 0 }}>) { } | |
94 // { dg-final { scan-assembler "_Z3k001FIXtl1DEEE" } } | |
95 | |
96 void k0x (F<D{{ 0, &AF::f }}>) { } | |
97 // { dg-final { scan-assembler "_Z3k0x1FIXtl1DtlA2_M2AFFvvEtlS3_EtlS3_adL_ZNS1_1fEvEEEEEE" } } | |
98 | |
99 void kx_ (F<D{{ &AF::f }}>) { } | |
100 // { dg-final { scan-assembler "_Z3kx_1FIXtl1DtlA2_M2AFFvvEtlS3_adL_ZNS1_1fEvEEEEEE" } } | |
101 | |
102 void kx0 (F<D{{ &AF::f, 0 }}>) { } | |
103 // { dg-final { scan-assembler "_Z3kx01FIXtl1DtlA2_M2AFFvvEtlS3_adL_ZNS1_1fEvEEEEEE" } } | |
104 | |
105 void kxx (F<D{{ &AF::f, &AF::f }}>) { } | |
106 // { dg-final { scan-assembler "_Z3kxx1FIXtl1DtlA2_M2AFFvvEtlS3_adL_ZNS1_1fEvEEtlS3_adL_ZNS1_1fEvEEEEEE" } } |