|
18 | 18 | #include "clang/Driver/Driver.h"
|
19 | 19 | #include "llvm/ADT/ArrayRef.h"
|
20 | 20 | #include "llvm/MC/TargetRegistry.h"
|
21 |
| -#include "llvm/Support/Host.h" |
22 | 21 | #include "llvm/Support/TargetSelect.h"
|
23 | 22 | #include "llvm/Support/VirtualFileSystem.h"
|
24 | 23 | #include "llvm/Support/raw_ostream.h"
|
@@ -570,95 +569,4 @@ TEST(DxcModeTest, ValidatorVersionValidation) {
|
570 | 569 | Diags.Clear();
|
571 | 570 | DiagConsumer->clear();
|
572 | 571 | }
|
573 |
| - |
574 |
| -TEST(ToolChainTest, Toolsets) { |
575 |
| - // Ignore this test on Windows hosts. |
576 |
| - llvm::Triple Host(llvm::sys::getProcessTriple()); |
577 |
| - if (Host.isOSWindows()) |
578 |
| - GTEST_SKIP(); |
579 |
| - |
580 |
| - IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions(); |
581 |
| - IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs()); |
582 |
| - |
583 |
| - // Check (newer) GCC toolset installation. |
584 |
| - { |
585 |
| - IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( |
586 |
| - new llvm::vfs::InMemoryFileSystem); |
587 |
| - |
588 |
| - // These should be ignored. |
589 |
| - InMemoryFileSystem->addFile("/opt/rh/gcc-toolset-2", 0, |
590 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
591 |
| - InMemoryFileSystem->addFile("/opt/rh/gcc-toolset-", 0, |
592 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
593 |
| - InMemoryFileSystem->addFile("/opt/rh/gcc-toolset--", 0, |
594 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
595 |
| - InMemoryFileSystem->addFile("/opt/rh/gcc-toolset--1", 0, |
596 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
597 |
| - |
598 |
| - // File needed for GCC installation detection. |
599 |
| - InMemoryFileSystem->addFile("/opt/rh/gcc-toolset-12/root/usr/lib/gcc/" |
600 |
| - "x86_64-redhat-linux/11/crtbegin.o", |
601 |
| - 0, llvm::MemoryBuffer::getMemBuffer("\n")); |
602 |
| - |
603 |
| - DiagnosticsEngine Diags(DiagID, &*DiagOpts, new SimpleDiagnosticConsumer); |
604 |
| - Driver TheDriver("/bin/clang", "x86_64-redhat-linux", Diags, |
605 |
| - "clang LLVM compiler", InMemoryFileSystem); |
606 |
| - std::unique_ptr<Compilation> C( |
607 |
| - TheDriver.BuildCompilation({"clang", "--gcc-toolchain="})); |
608 |
| - ASSERT_TRUE(C); |
609 |
| - std::string S; |
610 |
| - { |
611 |
| - llvm::raw_string_ostream OS(S); |
612 |
| - C->getDefaultToolChain().printVerboseInfo(OS); |
613 |
| - } |
614 |
| - EXPECT_EQ("Found candidate GCC installation: " |
615 |
| - "/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/11\n" |
616 |
| - "Selected GCC installation: " |
617 |
| - "/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/11\n" |
618 |
| - "Candidate multilib: .;@m64\n" |
619 |
| - "Selected multilib: .;@m64\n", |
620 |
| - S); |
621 |
| - } |
622 |
| - |
623 |
| - // And older devtoolset. |
624 |
| - { |
625 |
| - IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem( |
626 |
| - new llvm::vfs::InMemoryFileSystem); |
627 |
| - |
628 |
| - // These should be ignored. |
629 |
| - InMemoryFileSystem->addFile("/opt/rh/devtoolset-2", 0, |
630 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
631 |
| - InMemoryFileSystem->addFile("/opt/rh/devtoolset-", 0, |
632 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
633 |
| - InMemoryFileSystem->addFile("/opt/rh/devtoolset--", 0, |
634 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
635 |
| - InMemoryFileSystem->addFile("/opt/rh/devtoolset--1", 0, |
636 |
| - llvm::MemoryBuffer::getMemBuffer("\n")); |
637 |
| - |
638 |
| - // File needed for GCC installation detection. |
639 |
| - InMemoryFileSystem->addFile("/opt/rh/devtoolset-12/root/usr/lib/gcc/" |
640 |
| - "x86_64-redhat-linux/11/crtbegin.o", |
641 |
| - 0, llvm::MemoryBuffer::getMemBuffer("\n")); |
642 |
| - |
643 |
| - DiagnosticsEngine Diags(DiagID, &*DiagOpts, new SimpleDiagnosticConsumer); |
644 |
| - Driver TheDriver("/bin/clang", "x86_64-redhat-linux", Diags, |
645 |
| - "clang LLVM compiler", InMemoryFileSystem); |
646 |
| - std::unique_ptr<Compilation> C( |
647 |
| - TheDriver.BuildCompilation({"clang", "--gcc-toolchain="})); |
648 |
| - ASSERT_TRUE(C); |
649 |
| - std::string S; |
650 |
| - { |
651 |
| - llvm::raw_string_ostream OS(S); |
652 |
| - C->getDefaultToolChain().printVerboseInfo(OS); |
653 |
| - } |
654 |
| - EXPECT_EQ("Found candidate GCC installation: " |
655 |
| - "/opt/rh/devtoolset-12/root/usr/lib/gcc/x86_64-redhat-linux/11\n" |
656 |
| - "Selected GCC installation: " |
657 |
| - "/opt/rh/devtoolset-12/root/usr/lib/gcc/x86_64-redhat-linux/11\n" |
658 |
| - "Candidate multilib: .;@m64\n" |
659 |
| - "Selected multilib: .;@m64\n", |
660 |
| - S); |
661 |
| - } |
662 |
| -} |
663 |
| - |
664 | 572 | } // end anonymous namespace.
|
0 commit comments