aboutsummaryrefslogtreecommitdiff
path: root/test/Preprocessor
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2019-02-18 12:39:47 +0000
committerOliver Stannard <oliver.stannard@arm.com>2019-02-18 12:39:47 +0000
commit8569f81b8c187d185c2663120832668c18dbb550 (patch)
tree46e2ee44247fd26d7d2f1167a357f4d685b455b9 /test/Preprocessor
parente0d7fd13fb8cb655b7bc7d51d6e03414469a1ca1 (diff)
[ARM] Add pre-defined macros for ROPI and RWPI
This adds ACLE-defined macros to test for code being compiled in the ROPI and RWPI position-independence modes. Differential revision: https://reviews.llvm.org/D23610 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Preprocessor')
-rw-r--r--test/Preprocessor/arm-pic-predefines.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Preprocessor/arm-pic-predefines.c b/test/Preprocessor/arm-pic-predefines.c
new file mode 100644
index 0000000000..9082d79485
--- /dev/null
+++ b/test/Preprocessor/arm-pic-predefines.c
@@ -0,0 +1,14 @@
+// REQUIRES: arm-registered-target
+
+// RUN: %clang -target armv8--none-eabi -x c -E -dM %s -o - | FileCheck %s --check-prefix=NO-ROPI --check-prefix=NO-RWPI
+// RUN: %clang -target armv8--none-eabi -x c -E -dM %s -o - -fropi | FileCheck %s --check-prefix=ROPI --check-prefix=NO-RWPI
+// RUN: %clang -target armv8--none-eabi -x c -E -dM %s -o - -frwpi | FileCheck %s --check-prefix=NO-ROPI --check-prefix=RWPI
+// RUN: %clang -target armv8--none-eabi -x c -E -dM %s -o - -fropi -frwpi | FileCheck %s --check-prefix=ROPI --check-prefix=RWPI
+
+// Pre-defined macros for position-independence modes
+
+// NO-ROPI-NOT: #define __APCS_ROPI
+// ROPI: #define __ARM_ROPI
+
+// NO-RWPI-NOT: #define __APCS_RWPI
+// RWPI: #define __ARM_RWPI