| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mriscv-attribute" } */ |
| 3 |
int foo() |
| 4 |
{ |
| 5 |
|
| 6 |
/* In absence of -m[no-]strict-align, default mcpu is currently |
| 7 |
set to rocket. rocket has slow_misaligned_access=true. */ |
| 8 |
#if !defined(__riscv_misaligned_slow) |
| 9 |
#error "__riscv_misaligned_slow is not set" |
| 10 |
#endif |
| 11 |
|
| 12 |
#if defined(__riscv_misaligned_avoid) || defined(__riscv_misaligned_fast) |
| 13 |
#error "__riscv_misaligned_avoid or __riscv_misaligned_fast is unexpectedly set" |
| 14 |
#endif |
| 15 |
|
| 16 |
return 0; |
| 17 |
} |
| 18 |
/* { dg-final { scan-assembler ".attribute arch" } } */ |