Debian Codegraph @

gcc/testsuite/g++.dg/abi/pr77728-1.C

raw
1 // { dg-do compile { target arm_eabi } }
2 // { dg-options "-Wpsabi" }
3
4 #include <stdarg.h>
5
6 template <int N>
7 struct A { double p; };
8
9 A<0> v;
10
11 template <int N>
12 struct B
13 {
14 typedef A<N> T;
15 int i, j;
16 };
17
18 struct C : public B<0> {};
19 struct D {};
20 struct E : public D, C {};
21 struct F : public B<1> {};
22 struct G : public F { static double y; };
23 struct H : public G {};
24 struct I : public D { long long z; };
25 struct J : public D { static double z; int i, j; };
26
27 template <int N>
28 struct K : public D { typedef A<N> T; int i, j; };
29
30 struct L { static double h; int i, j; };
31
32 int
33 fn1 (int a, B<0> b) // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" }
34 {
35 return a + b.i;
36 }
37
38 int
39 fn2 (int a, B<1> b)
40 {
41 return a + b.i;
42 }
43
44 int
45 fn3 (int a, L b) // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" }
46 {
47 return a + b.i;
48 }
49
50 int
51 fn4 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, B<0> n, ...)
52 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
53 {
54 va_list ap;
55 va_start (ap, n);
56 int x = va_arg (ap, int);
57 va_end (ap);
58 return x;
59 }
60
61 int
62 fn5 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, B<1> n, ...)
63 {
64 va_list ap;
65 va_start (ap, n);
66 int x = va_arg (ap, int);
67 va_end (ap);
68 return x;
69 }
70
71 int
72 fn6 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, C n, ...)
73 {
74 va_list ap;
75 va_start (ap, n);
76 int x = va_arg (ap, int);
77 va_end (ap);
78 return x;
79 }
80
81 int
82 fn7 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, E n, ...)
83 {
84 va_list ap;
85 va_start (ap, n);
86 int x = va_arg (ap, int);
87 va_end (ap);
88 return x;
89 }
90
91 int
92 fn8 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, H n, ...)
93 {
94 va_list ap;
95 va_start (ap, n);
96 int x = va_arg (ap, int);
97 va_end (ap);
98 return x;
99 }
100
101 int
102 fn9 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, I n, ...)
103 {
104 va_list ap;
105 va_start (ap, n);
106 int x = va_arg (ap, int);
107 va_end (ap);
108 return x;
109 }
110
111 int
112 fn10 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, J n, ...)
113 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
114 {
115 va_list ap;
116 va_start (ap, n);
117 int x = va_arg (ap, int);
118 va_end (ap);
119 return x;
120 }
121
122 int
123 fn11 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, K<0> n, ...)
124 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
125 {
126 va_list ap;
127 va_start (ap, n);
128 int x = va_arg (ap, int);
129 va_end (ap);
130 return x;
131 }
132
133 int
134 fn12 (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, K<2> n, ...)
135 {
136 va_list ap;
137 va_start (ap, n);
138 int x = va_arg (ap, int);
139 va_end (ap);
140 return x;
141 }
142
143 void
144 test ()
145 {
146 static B<0> b0;
147 static B<1> b1;
148 static L l;
149 static C c;
150 static E e;
151 static H h;
152 static I i;
153 static J j;
154 static K<0> k0;
155 static K<2> k2;
156 fn1 (1, b0); // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" }
157 fn2 (1, b1);
158 fn3 (1, l); // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" }
159 fn4 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, b0, 1, 2, 3, 4);
160 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
161 fn5 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, b1, 1, 2, 3, 4);
162 fn6 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, c, 1, 2, 3, 4);
163 fn7 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, e, 1, 2, 3, 4);
164 fn8 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, h, 1, 2, 3, 4);
165 fn9 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, i, 1, 2, 3, 4);
166 fn10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, j, 1, 2, 3, 4);
167 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
168 fn11 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, k0, 1, 2, 3, 4);
169 // { dg-message "note: parameter passing for argument of type \[^\n\r]* changed in GCC 7\.1" "" { target *-*-* } .-1 }
170 fn12 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, k2, 1, 2, 3, 4);
171 }