aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/torture/pr60971.c
blob: b7a967dabb45f60a265ff9ab57fc1d7a3dc2b2f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* PR tree-optimization/60971 */
/* { dg-do run } */

#ifndef __cplusplus
#define bool _Bool
#endif

volatile unsigned char c;

__attribute__((noinline)) unsigned char
foo (void)
{
  return c;
}

__attribute__((noinline)) bool
bar (void)
{
  return foo () & 1;
}

int
main ()
{
  c = 0x41;
  c = bar ();
  if (c != 1)
    __builtin_abort ();
  c = 0x20;
  c = bar ();
  if (c != 0)
    __builtin_abort ();
  return 0;
}