aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr67947.c
blob: 1016f2579cb22fa98d1992e313b99ebf2a0460be (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
/* { dg-do run } */
/* { dg-additional-options "-O3" } */

#include <stdlib.h>

int a;
int c;
__attribute__((noinline, noclone)) void foo (int x)
{
  if (x == 0)
    c++;
}

volatile int t = 1;

int
main (int argc, char* argv[])
{
  int j, k, b = 0;
  if (t == 0)
    b = 1;
  for (j = 0; j < 3; j++)
    for (k = 0; k < 1; k++)
      {
	foo (0);
	if (b)
	  for (k = -1; a;)
	    ;
      }
  if (c != 3)
    abort ();
  return 0;
}