File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -790,7 +790,9 @@ template <typename Target>
790790class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo<Target> {
791791protected:
792792 void getOSDefines (const LangOptions &Opts, const llvm::Triple &Triple,
793- MacroBuilder &Builder) const override {}
793+ MacroBuilder &Builder) const override {
794+ Builder.defineMacro (" __UEFI__" );
795+ }
794796
795797public:
796798 UEFITargetInfo (const llvm::Triple &Triple, const TargetOptions &Opts)
Original file line number Diff line number Diff line change 1+ // RUN: %clang -target x86_64-unknown-uefi %s -emit-llvm -S -c -o - | FileCheck %s
2+
3+ // CHECK: __UEFI__defined
4+ #ifdef __UEFI__
5+ void __UEFI__defined () {}
6+ #endif
Original file line number Diff line number Diff line change 27422742// RISCV64-LINUX: #define __unix__ 1
27432743// RISCV64-LINUX: #define linux 1
27442744// RISCV64-LINUX: #define unix 1
2745+
2746+ // RUN: %clang_cc1 -dM -triple=x86_64-uefi -E /dev/null | FileCheck -match-full-lines -check-prefix UEFI %s
2747+
2748+ // UEFI: #define __UEFI__ 1
You can’t perform that action at this time.
0 commit comments