Debian Codegraph @

gcc/testsuite/g++.dg/opt/icf1.C

raw
1 // Test that -fipa-icf combines i and j.
2 // { dg-do run { target c++11 } }
3 // { dg-options -fipa-icf }
4
5 [[no_unique_address]] extern const int i[] = { 1,2,3 };
6 [[no_unique_address]] extern const int j[] = { 1,2,3 };
7
8 [[gnu::noipa]] void f (const void *a, const void *b)
9 {
10 if (a != b) __builtin_abort();
11 }
12
13 int main()
14 {
15 f (&i, &j);
16 }