gcc/testsuite/g++.dg/opt/icf2.C
raw| 1 | // Test that -fipa-icf combines the backing arrays for a and b. |
| 2 | // { dg-do run { target c++11 } } |
| 3 | // { dg-options -fipa-icf } |
| 4 | |
| 5 | #include <initializer_list> |
| 6 | |
| 7 | [[gnu::noipa]] void f (const void *a, const void *b) |
| 8 | { |
| 9 | if (a != b) __builtin_abort(); |
| 10 | } |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | auto a = { 1, 2 }; |
| 15 | auto b = { 1, 2 }; |
| 16 | f (a.begin(), b.begin()); |
| 17 | } |