summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/diagnostic-tree-expr-ranges-2.c
blob: 302e233a04acccf20dd25ffd92f0345614e81716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -fdiagnostics-show-caret" } */

int test_uninit_1 (void)
{
  int result;
  return result;  /* { dg-warning "uninitialized" } */
/* { dg-begin-multiline-output "" }
   return result;
          ^~~~~~
   { dg-end-multiline-output "" } */
}

int test_uninit_2 (void)
{
  int result;
  result += 3; /* { dg-warning "uninitialized" } */
/* { dg-begin-multiline-output "" }
   result += 3;
   ~~~~~~~^~~~
   { dg-end-multiline-output "" } */
  return result;
}