gcc/testsuite/gcc.target/loongarch/strict_align-func-attr-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -mno-strict-align" } */ |
| 3 | extern char a[8]; |
| 4 | extern char b[8]; |
| 5 | |
| 6 | #ifndef TEST_TARGET_PRAGMA |
| 7 | __attribute__ ((target ("strict-align"))) |
| 8 | #else |
| 9 | #pragma GCC target ("strict-align") |
| 10 | #endif |
| 11 | void |
| 12 | test (void) |
| 13 | { |
| 14 | a[0] = b[1]; |
| 15 | a[1] = b[2]; |
| 16 | a[2] = b[3]; |
| 17 | a[3] = b[4]; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | /* { dg-final { scan-assembler-not "ld.w" } } */ |