summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/debug/dwarf2/short-circuit.c
blob: 7e745ff19d2ba1802152cbe87d5d776774d7c19f (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* { dg-do compile } */
/* { dg-options "-O0 -gdwarf-2 -dA" } */

#define True  1
#define False 0

_Bool F1 (_Bool B1, _Bool B2)
{
  _Bool R;

  if (B1
      && B2)
    R = True;
  else
    R = False;
  return R;
}

_Bool F2 (_Bool B1, _Bool B2)
{
  _Bool R;

  R = B1
      && B2;
  return R;
}

_Bool F3 (_Bool B1, _Bool B2)
{
  _Bool R = False;

  if (B1
      && B2)
    R = True;
  return R;
}

_Bool F4 (_Bool B1, _Bool B2)
{
  _Bool R = False;

  if (B1
      || B2)
    ;
  else
    R = True;
  return R;
}

_Bool F5 (_Bool B1, _Bool B2)
{
  _Bool R = False;

  if (!(B1
        && B2))
    R = True;
  return R;
}

_Bool F8 (_Bool B1, _Bool B2, _Bool B3, _Bool B4, _Bool B5, _Bool B6,
          _Bool B7, _Bool B8)
{
  _Bool R;

  if ((B1
       || B2)
       && B3
       && !(B4
            || B5)
       && (B6
           || (B7
               && B8)))
    R = True;
  else
    R = False;
  return R;
}

/* { dg-final { scan-assembler "short-circuit.c:11" } } */
/* { dg-final { scan-assembler "short-circuit.c:12" } } */
/* { dg-final { scan-assembler "short-circuit.c:13" } } */
/* { dg-final { scan-assembler "short-circuit.c:15" } } */

/* { dg-final { scan-assembler "short-circuit.c:23" } } */
/* { dg-final { scan-assembler "short-circuit.c:24" } } */

/* { dg-final { scan-assembler "short-circuit.c:32" } } */
/* { dg-final { scan-assembler "short-circuit.c:33" } } */
/* { dg-final { scan-assembler "short-circuit.c:34" } } */

/* { dg-final { scan-assembler "short-circuit.c:42" } } */
/* { dg-final { scan-assembler "short-circuit.c:43" } } */
/* { dg-final { scan-assembler "short-circuit.c:46" } } */

/* { dg-final { scan-assembler "short-circuit.c:54" } } */
/* { dg-final { scan-assembler "short-circuit.c:55" } } */
/* { dg-final { scan-assembler "short-circuit.c:56" } } */

/* { dg-final { scan-assembler "short-circuit.c:65" } } */
/* { dg-final { scan-assembler "short-circuit.c:66" } } */
/* { dg-final { scan-assembler "short-circuit.c:67" } } */
/* { dg-final { scan-assembler "short-circuit.c:68" } } */
/* { dg-final { scan-assembler "short-circuit.c:69" } } */
/* { dg-final { scan-assembler "short-circuit.c:70" } } */
/* { dg-final { scan-assembler "short-circuit.c:71" } } */
/* { dg-final { scan-assembler "short-circuit.c:72" } } */
/* { dg-final { scan-assembler "short-circuit.c:73" } } */
/* { dg-final { scan-assembler "short-circuit.c:75" } } */