|
21 | 21 | #include "clang/Frontend/CompilerInstance.h"
|
22 | 22 | #include "llvm/ADT/ArrayRef.h"
|
23 | 23 | #include "llvm/ADT/StringExtras.h"
|
| 24 | +#include "llvm/Frontend/Debug/Options.h" |
24 | 25 | #include "llvm/MC/TargetRegistry.h"
|
25 | 26 | #include "llvm/Support/TargetSelect.h"
|
26 | 27 | #include "llvm/Support/VirtualFileSystem.h"
|
@@ -595,6 +596,22 @@ TEST(ToolChainTest, UEFICallingConventionTest) {
|
595 | 596 | TargetInfo::CallingConvKind::CCK_MicrosoftWin64);
|
596 | 597 | }
|
597 | 598 |
|
| 599 | +TEST(ToolChainTest, UEFIDefaultDebugFormatTest) { |
| 600 | + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); |
| 601 | + IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); |
| 602 | + struct TestDiagnosticConsumer : public DiagnosticConsumer {}; |
| 603 | + DiagnosticsEngine Diags(DiagID, &*DiagOpts, new TestDiagnosticConsumer); |
| 604 | + IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( |
| 605 | + new llvm::vfs::InMemoryFileSystem); |
| 606 | + Driver CCDriver("/home/test/bin/clang", "x86_64-unknown-uefi", Diags, |
| 607 | + "clang LLVM compiler", InMemoryFileSystem); |
| 608 | + CCDriver.setCheckInputsExist(false); |
| 609 | + std::unique_ptr<Compilation> CC( |
| 610 | + CCDriver.BuildCompilation({"/home/test/bin/clang", "foo.cpp"})); |
| 611 | + EXPECT_EQ(CC->getDefaultToolChain().getDefaultDebugFormat(), |
| 612 | + llvm::codegenoptions::DIF_CodeView); |
| 613 | +} |
| 614 | + |
598 | 615 | TEST(GetDriverMode, PrefersLastDriverMode) {
|
599 | 616 | static constexpr const char *Args[] = {"clang-cl", "--driver-mode=foo",
|
600 | 617 | "--driver-mode=bar", "foo.cpp"};
|
|
0 commit comments