aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/getchar-1.c
blob: 0cc984bd2b3412a604252549810547e8508c41ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* { dg-skip-if "" { powerpc*-*-aix* } } */

#include <stdio.h>
#include "analyzer-decls.h"

int test_1 (void)
{
  int c = getchar ();
  return c;
}

int glob_2;
int test_2 (void)
{
  int c;
  glob_2 = 42;
  __analyzer_eval (glob_2 == 42); /* { dg-warning "TRUE" } */
  c = getchar ();
  __analyzer_eval (glob_2 == 42); /* { dg-warning "TRUE" } */
  return c;
}