summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/attr-ifunc-2.c
blob: f717315f3d49c7f687141df97b27b0e955cb39d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-require-ifunc "" } */

static void *resolver ()
{
  return 0;
}

extern int magic (void)  /* { dg-message "previous definition" } */
     __attribute__ ((ifunc ("resolver")));
extern int magic (void)  /* { dg-error "redefinition" "" } */
     __attribute__ ((alias ("resolver")));

extern int spell (void)  /* { dg-message "previous definition" } */
{
  return 0;
}
extern int spell (void)  /* { dg-error "redefinition" "" } */
     __attribute__ ((ifunc ("resolver")));

extern int mantra (void)  /* { dg-message "previous definition" } */
     __attribute__ ((alias ("resolver")));
extern int mantra (void)  /* { dg-error "redefinition" "" } */
     __attribute__ ((ifunc ("resolver")));

extern int saying (void)  /* { dg-error "weak .* cannot be defined" "" } */
     __attribute__ ((weak,ifunc ("resolver")));
extern int maxim (void) /* { dg-error "indirect function .* cannot be declared weak" "" } */
     __attribute__ ((ifunc ("resolver"),weak));