diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-12-15 19:58:38 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-12-15 19:58:38 +0000 |
commit | 3adf7e6c06c9e886fbc5f33a6c786344931ca2c9 (patch) | |
tree | 59c6ae755292f43260d2260fc24effd585fc1374 /test/Preprocessor | |
parent | 5857036e6f0e54ff49a0be5627f2576151804a06 (diff) |
__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
Diffstat (limited to 'test/Preprocessor')
-rw-r--r-- | test/Preprocessor/is_target_arm64.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 |