Debian Codegraph @

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

raw
1 // PR target/6043
2 // This testcase ICEd on IA-64 because emit_group_store
3 // did not handle loading CONCAT from register group
4 // { dg-do compile }
5
6 struct C
7 {
8 C (double y, double z) { __real__ x = y; __imag__ x = z; }
9 double r () const { return __real__ x; }
10 double i () const { return __imag__ x; }
11 __complex__ double x;
12 };
13
14 inline C conj (const C& x)
15 {
16 return C (x.r (), - x.i ());
17 }
18
19 void foo (void)
20 {
21 C x (1.0, 1.0);
22 conj (x);
23 }