1*0a6a1f1dSLionel Sambuc // The default ABI is aapcs 2*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--- %s -### -o %t.o 2>&1 \ 3*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 4*0a6a1f1dSLionel Sambuc // RUN: %clang -target armeb--- %s -### -o %t.o 2>&1 \ 5*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 6*0a6a1f1dSLionel Sambuc // RUN: %clang -target thumb--- %s -### -o %t.o 2>&1 \ 7*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 8*0a6a1f1dSLionel Sambuc // RUN: %clang -target thumbeb--- %s -### -o %t.o 2>&1 \ 9*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 10*0a6a1f1dSLionel Sambuc 11*0a6a1f1dSLionel Sambuc // MachO targets default to apcs-gnu, except for m-class processors 12*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--darwin- -arch armv7s %s -### -o %t.o 2>&1 \ 13*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s 14*0a6a1f1dSLionel Sambuc // RUN: %clang -target thumb--darwin- -arch armv7s %s -### -o %t.o 2>&1 \ 15*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s 16*0a6a1f1dSLionel Sambuc // RUN: %clang -target thumb--darwin- -arch armv7m %s -### -o %t.o 2>&1 \ 17*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 18*0a6a1f1dSLionel Sambuc 19*0a6a1f1dSLionel Sambuc // Windows targets default to AAPCS, regardless of environment 20*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--windows-gnueabi %s -### -o %t.o 2>&1 \ 21*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 22*0a6a1f1dSLionel Sambuc 23*0a6a1f1dSLionel Sambuc // NetBSD defaults to apcs-gnu, but can also use aapcs 24*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--netbsd- %s -### -o %t.o 2>&1 \ 25*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s 26*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--netbsd-eabi %s -### -o %t.o 2>&1 \ 27*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 28*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm--netbsd-eabihf %s -### -o %t.o 2>&1 \ 29*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 30*0a6a1f1dSLionel Sambuc 31*0a6a1f1dSLionel Sambuc // Otherwise, ABI is celected based on environment 32*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---android %s -### -o %t.o 2>&1 \ 33*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s 34*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---gnueabi %s -### -o %t.o 2>&1 \ 35*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s 36*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---gnueabihf %s -### -o %t.o 2>&1 \ 37*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s 38*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---eabi %s -### -o %t.o 2>&1 \ 39*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 40*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---eabihf %s -### -o %t.o 2>&1 \ 41*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 42*0a6a1f1dSLionel Sambuc 43*0a6a1f1dSLionel Sambuc // ABI can be overridden by the -mabi= option 44*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---eabi -mabi=apcs-gnu %s -### -o %t.o 2>&1 \ 45*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-APCS-GNU %s 46*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---gnueabi -mabi=aapcs %s -### -o %t.o 2>&1 \ 47*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS %s 48*0a6a1f1dSLionel Sambuc // RUN: %clang -target arm---eabi -mabi=aapcs-linux %s -### -o %t.o 2>&1 \ 49*0a6a1f1dSLionel Sambuc // RUN: | FileCheck -check-prefix=CHECK-AAPCS-LINUX %s 50*0a6a1f1dSLionel Sambuc 51*0a6a1f1dSLionel Sambuc // CHECK-APCS-GNU: "-target-abi" "apcs-gnu" 52*0a6a1f1dSLionel Sambuc // CHECK-AAPCS: "-target-abi" "aapcs" 53*0a6a1f1dSLionel Sambuc // CHECK-AAPCS-LINUX: "-target-abi" "aapcs-linux" 54