From 3adf7e6c06c9e886fbc5f33a6c786344931ca2c9 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Fri, 15 Dec 2017 19:58:38 +0000 Subject: __is_target_arch: Check the arch and subarch instead of the arch name This ensures that when compiling for "arm64" __is_target_arch will succeed for both "arm64" and "aarch64". Thanks to Bob Wilson who pointed this out! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320853 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Preprocessor/is_target_arm64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/Preprocessor/is_target_arm64.c (limited to 'test/Preprocessor') diff --git a/test/Preprocessor/is_target_arm64.c b/test/Preprocessor/is_target_arm64.c new file mode 100644 index 0000000000..87ebe94d18 --- /dev/null +++ b/test/Preprocessor/is_target_arm64.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -triple arm64-apple-ios11 -verify %s +// expected-no-diagnostics + +#if !__is_target_arch(arm64) || !__is_target_arch(aarch64) + #error "mismatching arch" +#endif + +#if __is_target_arch(aarch64_be) + #error "mismatching arch" +#endif -- cgit v1.2.3