aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/const-2.c
blob: e48005dfb0ad4b80b2c448748b6d01394c4cbe76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR tree-optimization/83559 - -Wsuggest-attribute=const conflicts with
   -Wattributes warning about const attribute on function returning void
   { dg-do compile { target nonpic } }
   { dg-options "-O2 -Wsuggest-attribute=const" } */

int f_i_v (void)    /* { dg-warning "candidate for attribute .const." } */
{
  return 0;
}

int f_i ()          /* { dg-warning "candidate for attribute .const." } */
{
  return 0;
}

void f_v_v (void)   /* { dg-bogus "candidate" } */
{
}

void f_v ()         /* { dg-bogus "candidate" } */
{
}