blob: 7e69d862c3f450e24e7bad1738c3e3a8d9b78c50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
/* Check that eliminable compare-instructions are eliminated. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */
#ifndef t
#define t short int
#endif
#ifndef t2
#define t2 t
#endif
#ifndef op
#define op +
#endif
#ifndef do_f
#define do_f 1
#endif
#ifndef do_g
#define do_g 1
#endif
extern void foo(void);
#if do_f
void f(t a, t b)
{
t2 c = a op b;
if (c == 0)
foo();
}
#endif
#if do_g
void g(t a, t b)
{
t2 c = a op b;
if (c >= 0)
foo();
}
#endif
|