Merge with main truk.
[official-gcc.git] / gcc / testsuite / g++.dg / dfp / mangle-1.C
blob455d3e4c0ef6ccde15d56666d2618e8ef5ee0411
1 // { dg-do compile }
3 // Mangling of classes from std::decimal are special-cased.
4 // Derived from g++.dg/abi/mangle13.C.
6 namespace std {
7   namespace decimal {
8     class decimal64 {
9       public:
10         typedef float __decfloat64 __attribute__ ((mode (DD)));
11         explicit decimal64 (float __r):__val (__r) {}
12       private:
13         __decfloat64 __val;
14     };
15   }
18 struct A {
19   template <typename T> std::decimal::decimal64 f ();
20   std::decimal::decimal64 operator+();
21   operator std::decimal::decimal64 ();
22   template <typename T>
23   std::decimal::decimal64 operator-();
26 typedef std::decimal::decimal64 (A::*P)();
28 template <P> struct S {};
30 template <typename T> void g (S<&T::template f<std::decimal::decimal64> >) {}
31 template <typename T> void g (S<&T::operator+ >) {}
32 template <typename T> void g (S<&T::operator std::decimal::decimal64>) {}
33 template <typename T> void g (S<&T::template operator- <std::decimal::decimal64> >) {}
35 template void g<A> (S<&A::f<std::decimal::decimal64> >);
36 template void g<A> (S<&A::operator+>);
37 template void g<A> (S<&A::operator std::decimal::decimal64>);
39 // { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_1fIDdEEE\[: \t\n\]" } }
40 // { dg-final { scan-assembler "\n?_Z1gI1AEv1SIXadsrT_plEE\[: \t\n\]" } }