2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / dfp / mangle-1.C
blobee9644b27a5364dda5bd7fffd234550bd331b3c2
1 // { dg-do compile }
2 // { dg-options "-fabi-version=10" }
4 // Mangling of classes from std::decimal are special-cased.
5 // Derived from g++.dg/abi/mangle13.C.
7 namespace std {
8   namespace decimal {
9     class decimal64 {
10       public:
11         typedef float __decfloat64 __attribute__ ((mode (DD)));
12         explicit decimal64 (float __r):__val (__r) {}
13       private:
14         __decfloat64 __val;
15     };
16   }
19 struct A {
20   template <typename T> std::decimal::decimal64 f ();
21   std::decimal::decimal64 operator+();
22   operator std::decimal::decimal64 ();
23   template <typename T>
24   std::decimal::decimal64 operator-();
27 typedef std::decimal::decimal64 (A::*P)();
29 template <P> struct S {};
31 template <typename T> void g (S<&T::template f<std::decimal::decimal64> >) {}
32 template <typename T> void g (S<&T::operator+ >) {}
33 template <typename T> void g (S<&T::operator std::decimal::decimal64>) {}
34 template <typename T> void g (S<&T::template operator- <std::decimal::decimal64> >) {}
36 template void g<A> (S<&A::f<std::decimal::decimal64> >);
37 template void g<A> (S<&A::operator+>);
38 template void g<A> (S<&A::operator std::decimal::decimal64>);
40 // { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_1fIDdEEE\[: \t\n\]" } }
41 // { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_plEE\[: \t\n\]" } }