1 // I, Howard Hinnant, hereby place this code in the public domain.
3 // Test overload resolution among reference types
5 // { dg-do compile { target c++11 } }
6 // { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } }
8 template <bool> struct sa;
9 template <> struct sa<true> {};
11 struct one {long x[1];};
12 struct two {long x[2];};
13 struct three {long x[3];};
14 struct four {long x[4];};
15 struct five {long x[5];};
16 struct six {long x[6];};
17 struct seven {long x[7];};
18 struct eight {long x[8];};
23 A(const volatile A&&);
28 volatile A v_source();
29 const volatile A cv_source();
33 one sink_8_12345678( A&);
34 two sink_8_12345678(const A&);
35 three sink_8_12345678(volatile A&);
36 four sink_8_12345678(const volatile A&);
37 five sink_8_12345678( A&&);
38 six sink_8_12345678(const A&&);
39 seven sink_8_12345678(volatile A&&);
40 eight sink_8_12345678(const volatile A&&);
48 sa<sizeof(sink_8_12345678(a)) == 1 * sizeof(long)> t1;
49 sa<sizeof(sink_8_12345678(ca)) == 2 * sizeof(long)> t2;
50 sa<sizeof(sink_8_12345678(va)) == 3 * sizeof(long)> t3;
51 sa<sizeof(sink_8_12345678(cva)) == 4 * sizeof(long)> t4;
52 sa<sizeof(sink_8_12345678(source())) == 5 * sizeof(long)> t5;
53 sa<sizeof(sink_8_12345678(c_source())) == 6 * sizeof(long)> t6;
54 sa<sizeof(sink_8_12345678(v_source())) == 7 * sizeof(long)> t7;
55 sa<sizeof(sink_8_12345678(cv_source())) == 8 * sizeof(long)> t8;
61 return test8_12345678();