2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / attr-ifunc-2.c
blob8221cd431381e7ea1557784995272b8e0d9f870f
1 /* { dg-require-ifunc "" } */
3 typedef int F (void);
5 static F *resolver ()
7 return 0;
10 extern int magic (void) /* { dg-message "previous definition" } */
11 __attribute__ ((ifunc ("resolver")));
12 extern int magic (void) /* { dg-error "redefinition" } */
13 __attribute__ ((alias ("resolver")));
15 extern int spell (void) /* { dg-message "previous definition" } */
17 return 0;
19 extern int spell (void) /* { dg-error "redefinition" } */
20 __attribute__ ((ifunc ("resolver")));
22 extern int mantra (void) /* { dg-message "previous definition" } */
23 __attribute__ ((alias ("resolver")));
24 extern int mantra (void) /* { dg-error "redefinition" } */
25 __attribute__ ((ifunc ("resolver")));
27 extern int saying (void) /* { dg-error "weak .* cannot be defined" } */
28 __attribute__ ((weak,ifunc ("resolver")));
29 extern int maxim (void) /* { dg-error "indirect function .* cannot be declared weak" } */
30 __attribute__ ((ifunc ("resolver"),weak));