summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/target_attr_3.c
blob: 9f9c27654f6cfcceb65f32d1c4cf3f8fd8b13bfb (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
/* { dg-do compile } */
/* { dg-options "-O2 -mno-fix-cortex-a53-835769 -save-temps" } */

/* Check that the attribute overrides the command line option
   and the fix is applied once.  */

__attribute__ ((target ("fix-cortex-a53-835769")))
unsigned long long
test (unsigned long long a, double b, unsigned long long c,
      unsigned long long d, unsigned long  long *e)
{
  double result;
  volatile unsigned long long tmp = *e;
  __asm__ __volatile ("// %0, %1"
			: "=w" (result)
			: "0" (b)
			:    /* No clobbers.  */);
  return c * d + d;
}

unsigned long long
test2 (unsigned long long a, double b, unsigned long long c,
       unsigned long long d, unsigned long long *e)
{
  double result;
  volatile unsigned long long tmp = *e;
  __asm__ __volatile ("// %0, %1"
			: "=w" (result)
			: "0" (b)
			:   /* No clobbers.  */);
  return c * d + d;
}

/* { dg-final { scan-assembler-times "between mem op and" 1 } } */