1 // RUN: %clang -target arm-none-gnueabi -munaligned-access -### %s 2> %t
2 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
4 // RUN: %clang -target arm-none-gnueabi -mstrict-align -munaligned-access -### %s 2> %t
5 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
7 // RUN: %clang -target arm-none-gnueabi -mno-unaligned-access -munaligned-access -### %s 2> %t
8 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
10 // RUN: %clang -target armv6-apple-darwin -### %s 2> %t
11 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
13 // RUN: %clang -target armv6-netbsd-eabi -### %s 2> %t
14 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
16 // RUN: %clang -target armv7-unknown-linux -### %s 2> %t
17 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
19 // RUN: %clang -target armv7-unknown-nacl-gnueabihf -### %s 2> %t
20 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
22 // RUN: %clang -target armv7-windows -### %s 2> %t
23 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-ARM < %t %s
25 // RUN: %clang -target aarch64-none-gnueabi -munaligned-access -### %s 2> %t
26 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s
28 // RUN: %clang -target aarch64-none-gnueabi -mstrict-align -munaligned-access -### %s 2> %t
29 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s
31 // RUN: %clang -target aarch64-none-gnueabi -mno-unaligned-access -munaligned-access -### %s 2> %t
32 // RUN: FileCheck --check-prefix=CHECK-UNALIGNED-AARCH64 < %t %s
34 // CHECK-UNALIGNED-ARM-NOT: "-target-feature" "+strict-align"
35 // CHECK-UNALIGNED-AARCH64-NOT: "-target-feature" "+strict-align"
38 // RUN: %clang -target arm-none-gnueabi -mno-unaligned-access -### %s 2> %t
39 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
41 // RUN: %clang -target arm-none-gnueabi -mstrict-align -### %s 2> %t
42 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
44 // RUN: %clang -target arm-none-gnueabi -munaligned-access -mno-unaligned-access -### %s 2> %t
45 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
47 // RUN: %clang -target arm-none-gnueabi -munaligned-access -mstrict-align -### %s 2> %t
48 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
50 // RUN: %clang -target arm-none-gnueabi -### %s 2> %t
51 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
53 // RUN: %clang -target armv5-apple-darwin -### %s 2> %t
54 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
56 // RUN: %clang -target armv5t-netbsd-eabi -### %s 2> %t
57 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
59 // RUN: %clang -target armv6-unknown-linux -### %s 2> %t
60 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
62 // RUN: %clang -target armv6-unknown-nacl-gnueabihf -### %s 2> %t
63 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
65 // RUN: %clang -target armv6m-apple-darwin -### %s 2> %t
66 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
68 // RUN: %clang -target armv6m-netbsd-eabi -### %s 2> %t
69 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s
71 // RUN: %clang -target aarch64-none-gnueabi -mno-unaligned-access -### %s 2> %t
72 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
74 // RUN: %clang -target aarch64-none-gnueabi -mstrict-align -### %s 2> %t
75 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
77 // RUN: %clang -target aarch64-none-gnueabi -munaligned-access -mno-unaligned-access -### %s 2> %t
78 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
80 // RUN: %clang -target aarch64-none-gnueabi -munaligned-access -mstrict-align -### %s 2> %t
81 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
83 // RUN: %clang -target aarch64-none-gnueabi -mkernel -mno-unaligned-access -### %s 2> %t
84 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
86 // RUN: %clang -target aarch64-unknown-openbsd -### %s 2> %t
87 // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s
89 // CHECK-ALIGNED-ARM: "-target-feature" "+strict-align" {{.*}} "-Wunaligned-access"
90 // CHECK-ALIGNED-AARCH64: "-target-feature" "+strict-align" {{.*}} "-Wunaligned-access"
92 // Make sure that v6M cores and v8M Baseline always trigger the unsupported
93 // aligned accesses error for all supported architecture triples.
94 // RUN: not %clang -c -target thumbv6m-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \
95 // RUN: FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s
96 // RUN: not %clang -c -target thumb-none-gnueabi -mcpu=cortex-m0 -munaligned-access %s 2>&1 | \
97 // RUN: FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s
98 // RUN: not %clang -c -target thumbv8m.base-none-gnueabi -munaligned-access %s 2>&1 | \
99 // RUN: FileCheck --check-prefix CHECK-UNALIGN-NOT-SUPPORTED %s
101 // CHECK-UNALIGN-NOT-SUPPORTED: error: the {{.*}} sub-architecture does not support unaligned accesses