[clang][XCore] Define __xcore__ for XCore target.

The headers shipped with the XMOS XCore compiler expect __xcore__ to be defined.
The __XS1B__ macro, already defined, is for the default subtarget.

No other targets affected.
This commit is contained in:
Nigel Perks 2021-04-21 18:41:19 +01:00
parent ff0ddd5ce4
commit e7b6c0f398
2 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ const Builtin::Info XCoreTargetInfo::BuiltinInfo[] = {
void XCoreTargetInfo::getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const {
Builder.defineMacro("__xcore__");
Builder.defineMacro("__XS1B__");
}

View File

@ -1468,6 +1468,7 @@
// XCORE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// XCORE:#define __LITTLE_ENDIAN__ 1
// XCORE:#define __XS1B__ 1
// XCORE:#define __xcore__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=wasm32-unknown-unknown \
// RUN: < /dev/null \