summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/target_attr_4.c
blob: e0114084800cbb6b5abcdcd34f194fd0993ea02d (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
/* { dg-do assemble } */
/* { dg-options "-O2 -march=armv8-a+nocrc -mcpu=generic -save-temps" } */

#include "arm_acle.h"

/* Check that enabling an ISA feature using an attribute in a file
   compiled without that attribute works.  */

__attribute__ ((target ("+crc")))
uint32_t
foo (uint32_t a, uint8_t b)
{
  return __crc32b (a, b);
}

__attribute__ ((target ("arch=armv8-a+crc")))
uint32_t
fooarch (uint32_t a, uint8_t b)
{
  return __crc32b (a, b);
}

__attribute__ ((target ("cpu=cortex-a53+crc")))
uint32_t
foocpu (uint32_t a, uint8_t b)
{
  return __crc32b (a, b);
}

/* { dg-final { scan-assembler-times "crc32b\tw..?, w..?, w..?\n" 3 } } */