Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 1 | // 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 | // NetBSD defaults to apcs-gnu, but can also use aapcs |
| 24 | // RUN: %clang -target arm--netbsd- %s -### -o %t.o 2>&1 \ |
| 25 | // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s |
| 26 | // RUN: %clang -target arm--netbsd-eabi %s -### -o %t.o 2>&1 \ |
| 27 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s |
| 28 | // RUN: %clang -target arm--netbsd-eabihf %s -### -o %t.o 2>&1 \ |
| 29 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s |
| 30 | |
| 31 | // Otherwise, ABI is celected based on environment |
| 32 | // RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \ |
| 33 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s |
| 34 | // RUN: %clang -target arm---gnueabi %s -### -o %t.o 2>&1 \ |
| 35 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s |
| 36 | // RUN: %clang -target arm---gnueabihf %s -### -o %t.o 2>&1 \ |
| 37 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s |
| 38 | // RUN: %clang -target arm---eabi %s -### -o %t.o 2>&1 \ |
| 39 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s |
| 40 | // RUN: %clang -target arm---eabihf %s -### -o %t.o 2>&1 \ |
| 41 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s |
| 42 | |
| 43 | // ABI can be overridden by the -mabi= option |
| 44 | // RUN: %clang -target arm---eabi -mabi=apcs-gnu %s -### -o %t.o 2>&1 \ |
| 45 | // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s |
| 46 | // RUN: %clang -target arm---gnueabi -mabi=aapcs %s -### -o %t.o 2>&1 \ |
| 47 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s |
| 48 | // RUN: %clang -target arm---eabi -mabi=aapcs-linux %s -### -o %t.o 2>&1 \ |
| 49 | // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s |
| 50 | |
| 51 | // CHECK-APCS-GNU: "-target-abi" "apcs-gnu" |
| 52 | // CHECK-AAPCS: "-target-abi" "aapcs" |
| 53 | // CHECK-AAPCS-LINUX: "-target-abi" "aapcs-linux" |