Core 903
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / ifcvt_avoid_const_materialization_1.c
blobb2a05eaff606a54afc40c3899ad5926c889283dc
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 /* Check that we avoid moving the immediate into a register
5 if comparison has shown that the inverse or negated form is
6 already in one of the registers. */
8 int
9 foo (int a, int b)
11 return a == 5 ? -5 : b;
14 int
15 bar (int a, int b)
17 return a != 5 ? b : ~5;
20 /* { dg-final { scan-assembler-not "mov\\tw\[0-9\]+" } } */
21 /* { dg-final { scan-assembler-times "csneg\\tw\[0-9\]+" 1 } } */
22 /* { dg-final { scan-assembler-times "csinv\\tw\[0-9\]+" 1 } } */