aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c
blob: 316cfc75734adb9e94f000538f3355f5ffb91d31 (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
/* { dg-options "-O2 -w" } */

#include <stdio.h>
#include <stdlib.h>

#ifdef _PROFILE_USE
int foo(int x) {
  return 3 * x;
}
#else
int foo(int x) {
  return 3 * x;
}
#endif

int x = 1000;

int main(int argc, char *argv[]) {
  int i;
  int sum = 0;
  for (i = 0; i < x; i++)
    sum += i;
  printf("%d\n", sum);
  return 0;
}