summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/asmgoto-4.c
blob: 4532bf196eee1a29a7816db8f1dd0c0572985000 (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
/* PR middle-end/44071 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

static inline int
f1 (void)
{
  asm goto ("" : : : : l1, l2);
  __builtin_unreachable ();
 l1:
  return 1;
 l2:
  return 0;
}

int
b1 (int x)
{
  if (f1 () || x == 6)
    x = 1;
  else
    x = 2;
  return x;
}

static inline int
f2 (void)
{
  asm goto ("" : : : : l1, l2);
 l1:
  return 1;
 l2:
  return 0;
}

int
b2 (int x)
{
  if (f2 () || x == 6)
    x = 1;
  else
    x = 2;
  return x;
}