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
}
// Check the parsed arch when it has no sub arch to allow Clang to
// match thumb to thumbv7 but to prohibit matching thumbv6 to thumbv7.
- return (Arch.getSubArch() == llvm::Triple::NoSubArch &&
- Arch.getArch() == TT.getArch()) ||
- Arch.getArchName() == TT.getArchName();
+ return (Arch.getSubArch() == llvm::Triple::NoSubArch ||
+ Arch.getSubArch() == TT.getSubArch()) &&
+ Arch.getArch() == TT.getArch();
}
/// Implements the __is_target_vendor builtin macro.
--- /dev/null
+// 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