blob: 1186316ad53f7e7b542dff148173b5545829d030 [file] [log] [blame]
Oliver Stannard28ee5d22014-08-28 12:15:49 +00001// The default ABI is aapcs
2// RUN: %clang -target arm--- %s -### -o %t.o 2>&1 \
3// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
4// RUN: %clang -target armeb--- %s -### -o %t.o 2>&1 \
5// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
6// RUN: %clang -target thumb--- %s -### -o %t.o 2>&1 \
7// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
8// RUN: %clang -target thumbeb--- %s -### -o %t.o 2>&1 \
9// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
10
11// MachO targets default to apcs-gnu, except for m-class processors
12// RUN: %clang -target arm--darwin- -arch armv7s %s -### -o %t.o 2>&1 \
13// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
14// RUN: %clang -target thumb--darwin- -arch armv7s %s -### -o %t.o 2>&1 \
15// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
16// RUN: %clang -target thumb--darwin- -arch armv7m %s -### -o %t.o 2>&1 \
17// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
18
19// Windows targets default to AAPCS, regardless of environment
20// RUN: %clang -target arm--windows-gnueabi %s -### -o %t.o 2>&1 \
21// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
22
23// Otherwise, ABI is celected based on environment
24// RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \
25// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
26// RUN: %clang -target arm---gnueabi %s -### -o %t.o 2>&1 \
27// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
28// RUN: %clang -target arm---gnueabihf %s -### -o %t.o 2>&1 \
29// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
30// RUN: %clang -target arm---eabi %s -### -o %t.o 2>&1 \
31// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
32// RUN: %clang -target arm---eabihf %s -### -o %t.o 2>&1 \
33// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
34
35// ABI can be overridden by the -mabi= option
36// RUN: %clang -target arm---eabi -mabi=apcs-gnu %s -### -o %t.o 2>&1 \
37// RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s
38// RUN: %clang -target arm---gnueabi -mabi=aapcs %s -### -o %t.o 2>&1 \
39// RUN: | FileCheck -check-prefix=CHECK-AAPCS %s
40// RUN: %clang -target arm---eabi -mabi=aapcs-linux %s -### -o %t.o 2>&1 \
41// RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s
42
43// CHECK-APCS-GNU: "-target-abi" "apcs-gnu"
44// CHECK-AAPCS: "-target-abi" "aapcs"
45// CHECK-AAPCS-LINUX: "-target-abi" "aapcs-linux"