File tree 3 files changed +13
-1
lines changed
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -790,7 +790,9 @@ template <typename Target>
790
790
class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo<Target> {
791
791
protected:
792
792
void getOSDefines (const LangOptions &Opts, const llvm::Triple &Triple,
793
- MacroBuilder &Builder) const override {}
793
+ MacroBuilder &Builder) const override {
794
+ Builder.defineMacro (" __UEFI__" );
795
+ }
794
796
795
797
public:
796
798
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 2742
2742
// RISCV64-LINUX: #define __unix__ 1
2743
2743
// RISCV64-LINUX: #define linux 1
2744
2744
// 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