summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/init.c
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@imgtec.com>2017-02-21 16:01:00 +0000
committerSimon Dardis <simon.dardis@imgtec.com>2017-02-21 16:01:00 +0000
commitdf827a7165d325d85eeaeb1969ad1b23364f5dc0 (patch)
tree6a4f9e8523757c94653496906425eb40be8914c4 /clang/test/Preprocessor/init.c
parent78ef645f949dfa1f8be8c99fc04169267d2c5e36 (diff)
downloadbcm5719-llvm-df827a7165d325d85eeaeb1969ad1b23364f5dc0.tar.gz
bcm5719-llvm-df827a7165d325d85eeaeb1969ad1b23364f5dc0.zip
[mips] Define macros related to -mabicalls in the preprocessor
Summary: Historically, NetBSD, FreeBSD and OpenBSD have defined the macro ABICALLS in the preprocessor when -mabicalls is in effect. Mainline GCC later defined __mips_abicalls when -mabicalls is in effect. This patch teaches the preprocessor to define these macros when appropriate. NetBSD does not require the ABICALLS macro. This resolves PR/31694. Thanks to Sean Bruno for highlighting this issue! Reviewers: slthakur, seanbruno Reviewed By: seanbruno Subscribers: joerg, brad, emaste, seanbruno, cfe-commits Differential Revision: https://reviews.llvm.org/D29032 llvm-svn: 295728
Diffstat (limited to 'clang/test/Preprocessor/init.c')
-rw-r--r--clang/test/Preprocessor/init.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index a7726e3111f..cb8f509224d 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -3040,6 +3040,7 @@
// MIPS32BE:#define __llvm__ 1
// MIPS32BE:#define __mips 32
// MIPS32BE:#define __mips__ 1
+// MIPS32BE:#define __mips_abicalls 1
// MIPS32BE:#define __mips_fpr 32
// MIPS32BE:#define __mips_hard_float 1
// MIPS32BE:#define __mips_o32 1
@@ -3246,6 +3247,7 @@
// MIPS32EL:#define __llvm__ 1
// MIPS32EL:#define __mips 32
// MIPS32EL:#define __mips__ 1
+// MIPS32EL:#define __mips_abicalls 1
// MIPS32EL:#define __mips_fpr 32
// MIPS32EL:#define __mips_hard_float 1
// MIPS32EL:#define __mips_o32 1
@@ -3555,6 +3557,7 @@
// MIPSN32BE: #define __mips64 1
// MIPSN32BE: #define __mips64__ 1
// MIPSN32BE: #define __mips__ 1
+// MIPSN32BE: #define __mips_abicalls 1
// MIPSN32BE: #define __mips_fpr 64
// MIPSN32BE: #define __mips_hard_float 1
// MIPSN32BE: #define __mips_isa_rev 2
@@ -3861,6 +3864,7 @@
// MIPSN32EL: #define __mips64 1
// MIPSN32EL: #define __mips64__ 1
// MIPSN32EL: #define __mips__ 1
+// MIPSN32EL: #define __mips_abicalls 1
// MIPSN32EL: #define __mips_fpr 64
// MIPSN32EL: #define __mips_hard_float 1
// MIPSN32EL: #define __mips_isa_rev 2
@@ -4073,6 +4077,7 @@
// MIPS64BE:#define __mips64 1
// MIPS64BE:#define __mips64__ 1
// MIPS64BE:#define __mips__ 1
+// MIPS64BE:#define __mips_abicalls 1
// MIPS64BE:#define __mips_fpr 64
// MIPS64BE:#define __mips_hard_float 1
// MIPS64BE:#define __mips_n64 1
@@ -4282,6 +4287,7 @@
// MIPS64EL:#define __mips64 1
// MIPS64EL:#define __mips64__ 1
// MIPS64EL:#define __mips__ 1
+// MIPS64EL:#define __mips_abicalls 1
// MIPS64EL:#define __mips_fpr 64
// MIPS64EL:#define __mips_hard_float 1
// MIPS64EL:#define __mips_n64 1
@@ -4513,6 +4519,45 @@
// MIPS-XXR6:#define __mips_fpr 64
// MIPS-XXR6:#define __mips_nan2008 1
//
+// RUN: %clang_cc1 -target-cpu mips32 \
+// RUN: -E -dM -triple=mips-unknown-netbsd -mrelocation-model pic < /dev/null \
+// RUN: | FileCheck -match-full-lines -check-prefix MIPS-ABICALLS-NETBSD %s
+// MIPS-ABICALLS-NETBSD-NOT: #define __ABICALLS__ 1
+// MIPS-ABICALLS-NETBSD: #define __mips_abicalls 1
+//
+// RUN: %clang_cc1 -target-cpu mips64 \
+// RUN: -E -dM -triple=mips64-unknown-netbsd -mrelocation-model pic < \
+// RUN: /dev/null | FileCheck -match-full-lines \
+// RUN: -check-prefix MIPS-ABICALLS-NETBSD64 %s
+// MIPS-ABICALLS-NETBSD64-NOT: #define __ABICALLS__ 1
+// MIPS-ABICALLS-NETBSD64: #define __mips_abicalls 1
+//
+// RUN: %clang_cc1 -target-cpu mips32 \
+// RUN: -E -dM -triple=mips-unknown-freebsd -mrelocation-model pic < /dev/null \
+// RUN: | FileCheck -match-full-lines -check-prefix MIPS-ABICALLS-FREEBSD %s
+// MIPS-ABICALLS-FREEBSD: #define __ABICALLS__ 1
+// MIPS-ABICALLS-FREEBSD: #define __mips_abicalls 1
+//
+// RUN: %clang_cc1 -target-cpu mips64 \
+// RUN: -E -dM -triple=mips64-unknown-freebsd -mrelocation-model pic < \
+// RUN: /dev/null | FileCheck -match-full-lines \
+// RUN: -check-prefix MIPS-ABICALLS-FREEBSD64 %s
+// MIPS-ABICALLS-FREEBSD64: #define __ABICALLS__ 1
+// MIPS-ABICALLS-FREEBSD64: #define __mips_abicalls 1
+//
+// RUN: %clang_cc1 -target-cpu mips32 \
+// RUN: -E -dM -triple=mips-unknown-openbsd -mrelocation-model pic < /dev/null \
+// RUN: | FileCheck -match-full-lines -check-prefix MIPS-ABICALLS-OPENBSD %s
+// MIPS-ABICALLS-OPENBSD: #define __ABICALLS__ 1
+// MIPS-ABICALLS-OPENBSD: #define __mips_abicalls 1
+//
+// RUN: %clang_cc1 -target-cpu mips64 \
+// RUN: -E -dM -triple=mips64-unknown-openbsd -mrelocation-model pic < \
+// RUN: /dev/null | FileCheck -match-full-lines \
+// RUN: -check-prefix MIPS-ABICALLS-OPENBSD64 %s
+// MIPS-ABICALLS-OPENBSD64: #define __ABICALLS__ 1
+// MIPS-ABICALLS-OPENBSD64: #define __mips_abicalls 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MSP430 %s
// RUN: %clang_cc1 -x c++ -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -match-full-lines -check-prefix MSP430 -check-prefix MSP430-CXX %s
//
OpenPOWER on IntegriCloud