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