gcc/testsuite/g++.dg/opt/pr122394.C
raw| 1 | // PR tree-optimization/122394 |
| 2 | // { dg-do compile { target c++23 } } |
| 3 | // { dg-options "-O1 -g" } |
| 4 | |
| 5 | #include <compare> |
| 6 | |
| 7 | struct A { |
| 8 | friend auto operator<=> (A, A) = default; |
| 9 | double a; |
| 10 | }; |
| 11 | void foo (); |
| 12 | A b, c; |
| 13 | |
| 14 | void |
| 15 | bar () |
| 16 | { |
| 17 | bool d = c >= b; |
| 18 | if (d) |
| 19 | foo (); |
| 20 | } |