Debian Codegraph @

gcc/testsuite/g++.dg/ipa/pr118243.C

raw
1 /* { dg-do run } */
2 /* { dg-options "-O3 -std=gnu++11" } */
3
4 using complex_t = int __complex__;
5
6 struct A {
7 complex_t value;
8 A(double r) : value{0, r} {}
9 };
10
11 [[gnu::noipa]]
12 void f(int a)
13 {
14 if (a != 1)
15 __builtin_abort();
16 }
17 [[gnu::noipa]] void g(const char *, int x){}
18
19
20 void test(const complex_t &c, const int &x) {
21 if (x < 0)
22 g("%d\n", x);
23 else
24 {
25 f( __imag__ c);
26 }
27 }
28
29 void f1() {
30 {
31 A a{1};
32 test(a.value, 123);
33 }
34 }
35
36 int main()
37 {
38 f1();
39 return 0;
40 }