1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-ipa-icf" } */
7 int gcd(int x
, int y
) __attribute__ ((pure
));
9 __attribute__ ((noinline
))
39 int nsd(int x
, int y
) __attribute__ ((pure
));
41 __attribute__ ((noinline
))
71 int nsd_different_result(int x
, int y
) __attribute__ ((pure
));
73 __attribute__ ((noinline
))
74 int nsd_different_result(int x
, int y
)
110 int nsd_different_result2(int x
, int y
) __attribute__ ((pure
));
112 __attribute__ ((noinline
))
113 int nsd_different_result2(int x
, int y
)
149 __attribute__ ((noinline
))
164 __attribute__ ((noinline
))
178 int main(int argc
, char **argv
)
183 int a
= atoi(argv
[1]);
184 int b
= atoi(argv
[2]);
186 printf("Test1: %d, %d, gdc: %d\n", a
, b
, gcd(a
, b
));
187 printf("Test2: %d, %d, gdc: %d\n", a
, b
, nsd(a
, b
));
190 /* { dg-final { scan-ipa-dump "Semantic equality hit:s2->s1" "icf" } } */
191 /* { dg-final { scan-ipa-dump "Semantic equality hit:nsd_different_result2->nsd_different_result" "icf" } } */
192 /* { dg-final { scan-ipa-dump "Semantic equality hit:nsd->gcd" "icf" } } */
193 /* { dg-final { scan-ipa-dump "Equal symbols: 3" "icf" } } */
194 /* { dg-final { cleanup-ipa-dump "icf" } } */