blob: 69ae55ccbfd2500e95caa87b05b852e01c5adb43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* Check that eliminable compare-instructions are eliminated. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */
/* { dg-final { scan-assembler "\tlsr|\tsmi" } } */
/* Regarding the "lsr", see pr93372-2.c; we get a shift for the
sign-bit. For "<", that's equally optimal to smi; we just want this
test to be different with the "<" instead of ">=". */
int f(int a, int b, int *d)
{
int c = a + b;
*d = (c == 0);
return c < 0;
}
|