[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / 20050121-2.c
blob6a6092c900a6fc93a2f4e5138acd7a84c297541a
1 /* PR middle-end/19551 */
2 /* { dg-options "-O2" } */
3 /* { dg-do link } */
5 extern void abort ();
7 #define T(type, name) \
8 extern __attribute__((pure)) _Complex type \
9 foo_c##name (int x); \
11 void \
12 bar_c##name (type *x) \
13 { \
14 type f = __real foo_c##name (5); \
15 if (0) *x = f; \
16 } \
18 void \
19 baz_c##name (type *x) \
20 { \
21 type f = __imag foo_c##name (5); \
22 if (0) *x = f; \
23 } \
25 extern __attribute__((pure)) type \
26 foo_##name (int x); \
28 void \
29 bar_##name (type *x) \
30 { \
31 type f = foo_##name (5); \
32 if (0) *x = f; \
35 typedef long double ldouble_t;
36 typedef long long llong;
38 T (float, float)
39 T (double, double)
40 T (long double, ldouble_t)
41 T (char, char)
42 T (short, short)
43 T (int, int)
44 T (long, long)
45 T (long long, llong)
46 #undef T
48 int
49 main (void)
51 #define T(type, name) \
52 { \
53 type var = 0; \
54 bar_c##name (&var); \
55 baz_c##name (&var); \
56 bar_##name (&var); \
58 T (float, float)
59 T (double, double)
60 T (long double, ldouble_t)
61 T (char, char)
62 T (short, short)
63 T (int, int)
64 T (long, long)
65 T (long long, llong)
66 return 0;