summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/inline-14.c
blob: 15b2d404c1157d0685b6e3ea02649603ebc9efa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Check that you can't redefine a C99 inline function.  */
/* { dg-do compile } */
/* { dg-options "-std=c99" } */

extern inline int func1 (void)
{ /* { dg-message "note: previous definition" } */
  return 1;
}

inline int func1 (void) /* { dg-error "redefinition" } */
{
  return 1;
}

inline int func2 (void)
{ /* { dg-message "note: previous definition" } */
  return 2;
}

inline int func2 (void) /* { dg-error "redefinition" } */
{
  return 2;
}