PR libfortran/64770 Segfault when trying to open existing file with status="new".
[official-gcc.git] / gcc / testsuite / gcc.dg / ipa / ipa-icf-8.c
blobd35df907005c2800afb03deb44902c21ad855b67
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf" } */
4 #include <stdio.h>
6 __attribute__ ((noinline))
7 int fce1(int a, int b)
9 int swap;
11 if(a < b)
13 swap = a;
14 a = b;
15 b = swap;
18 return a / b;
21 __attribute__ ((noinline))
22 int fce2(int x, int y)
24 int tmp;
26 if(x < y)
28 tmp = x;
29 x = y;
30 y = tmp;
33 return x / y;
37 int main(int argc, char **argv)
39 printf("fce1: %d\n", fce1(argc, argc + 2));
40 printf("fce2: %d\n", fce2(argc, 2 * argc));
43 /* { dg-final { scan-ipa-dump "Semantic equality hit:fce2->fce1" "icf" } } */
44 /* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */
45 /* { dg-final { cleanup-ipa-dump "icf" } } */