aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/analyzer/getchar-1.c
blob: 157877dd4fb8f2c3225525c9322a8e5e980f26f5 (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 "../../gcc.dg/analyzer/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;
}