gcc/testsuite/gcc.dg/tree-prof/prof-robust-1.c
raw| 1 | /* { dg-options "-O2 -w" } */ |
| 2 | |
| 3 | #include <stdio.h> |
| 4 | #include <stdlib.h> |
| 5 | |
| 6 | #ifdef _PROFILE_USE |
| 7 | int foo(int x) { |
| 8 | return 3 * x; |
| 9 | } |
| 10 | #else |
| 11 | int foo(int x) { |
| 12 | return 3 * x; |
| 13 | } |
| 14 | #endif |
| 15 | |
| 16 | int x = 1000; |
| 17 | |
| 18 | int main(int argc, char *argv[]) { |
| 19 | int i; |
| 20 | int sum = 0; |
| 21 | for (i = 0; i < x; i++) |
| 22 | sum += i; |
| 23 | printf("%d\n", sum); |
| 24 | return 0; |
| 25 | } |