summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr43299.c
blob: d71c896893fc904b45c695a85ca8e31f584e19fd (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
/* PR debug/43299 */
/* { dg-do assemble } */
/* { dg-options "-g -O2" } */

extern void *emit_insn (void *);

__attribute__((noinline))
void *gen_load_locked_si (void *x, void *y)
{
  return x;
}

__attribute__((noinline))
void *gen_load_locked_di (void *x, void *y)
{
  return x;
}

void
emit_load_locked (int mode, void *reg, void *mem)
{
  void * (*fn) (void *, void *) = ((void *)0);
  if (mode == 9)
    fn = gen_load_locked_si;
  else if (mode == 10)
    fn = gen_load_locked_di;
  emit_insn (fn (reg, mem));
}