Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/lib/Driver/ToolChains/UEFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class LLVM_LIBRARY_VISIBILITY UEFI : public ToolChain {
void
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;

llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override {
return llvm::codegenoptions::DIF_CodeView;
}
};

} // namespace toolchains
Expand Down
17 changes: 17 additions & 0 deletions clang/unittests/Driver/ToolChainTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "clang/Frontend/CompilerInstance.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Frontend/Debug/Options.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/VirtualFileSystem.h"
Expand Down Expand Up @@ -595,6 +596,22 @@ TEST(ToolChainTest, UEFICallingConventionTest) {
TargetInfo::CallingConvKind::CCK_MicrosoftWin64);
}

TEST(ToolChainTest, UEFIDefaultDebugFormatTest) {
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
struct TestDiagnosticConsumer : public DiagnosticConsumer {};
DiagnosticsEngine Diags(DiagID, &*DiagOpts, new TestDiagnosticConsumer);
IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
new llvm::vfs::InMemoryFileSystem);
Driver CCDriver("/home/test/bin/clang", "x86_64-unknown-uefi", Diags,
"clang LLVM compiler", InMemoryFileSystem);
CCDriver.setCheckInputsExist(false);
std::unique_ptr<Compilation> CC(
CCDriver.BuildCompilation({"/home/test/bin/clang", "foo.cpp"}));
EXPECT_EQ(CC->getDefaultToolChain().getDefaultDebugFormat(),
llvm::codegenoptions::DIF_CodeView);
}

TEST(GetDriverMode, PrefersLastDriverMode) {
static constexpr const char *Args[] = {"clang-cl", "--driver-mode=foo",
"--driver-mode=bar", "foo.cpp"};
Expand Down
Loading