aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr110079.c
blob: f87064d5f2ce50e5f3a3e89b54e79e96ad607282 (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
/* PR rtl-optimization/110079 */
/* { dg-do compile { target { nvptx-*-* || lra } } } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-freorder-blocks-and-partition" { target freorder } } */

int a;
__attribute__((cold)) int bar (char *);
__attribute__((hot)) int baz (char *);

void
foo (void)
{
l1:
  while (a)
    ;
  bar ("");
  asm goto ("" : : : : l2);
  asm ("");
l2:
  goto l1;
}

void
qux (void)
{
  asm goto ("" : : : : l1);
  bar ("");
  goto l1;
l1:
  baz ("");
}

void
corge (void)
{
  asm goto ("" : : : : l1);
  baz ("");
l2:
  return;
l1:
  bar ("");
  goto l2;
}