Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.dg / dfp / mangle-3.C
1 // { dg-do compile }
2
3 // Mangling of classes from std::decimal are special-cased.
4 // Derived from g++.dg/abi/mangle20-1.C.
5
6 namespace std {
7   namespace decimal {
8     class decimal64 {
9       public:
10         typedef float __decfloat64 __attribute__ ((mode (DD)));
11         explicit decimal64 (int __r):__val (__r) {}
12       private:
13         __decfloat64 __val;
14     };
15   }
16 }
17
18 template <int I> void f(std::decimal::decimal64 (*)[2]) {}
19 template <int I> void g(std::decimal::decimal64 (*)[I+2]) {}
20
21 static const std::decimal::decimal64 I(1);
22 static const std::decimal::decimal64 J(2);
23
24 template void f<1>(std::decimal::decimal64 (*)[2]);
25 template void g<1>(std::decimal::decimal64 (*)[3]);
26
27 //  { dg-final { scan-assembler "\n_?_Z1fILi1EEvPA2_Dd\[: \t\n\]" } }
28 //  { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_Dd\[: \t\n\]" } }