diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-12 13:22:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-12 13:22:53 -0400 |
| commit | 2ce42a25d9732650cfac72211aa918e2fa82b8de (patch) | |
| tree | 7ed6e7272c18563af8a763a898b2b7f23377e365 /tools | |
| parent | eda9dd33647b271dd5ea5256e87cb23ad269b19f (diff) | |
Fix for crashes around FileCheck (#2793)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Fix scoping issue for filecheck lib.
* Small fix for file check issue.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 6 | ||||
| -rw-r--r-- | tools/slang-test/test-context.cpp | 15 | ||||
| -rw-r--r-- | tools/slang-test/test-context.h | 1 |
3 files changed, 6 insertions, 16 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 053201c70..cfd61d97b 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -636,13 +636,9 @@ static TestResult _fileCheckTest( if(!fc) { // TODO(JS): - // For now if IFileCheck isn't available ignore... -#if 0 + // Do we want to fail or ignore if we don't find file check? testReporter.message(TestMessageType::RunError, "FileCheck is not available"); return TestResult::Fail; -#else - return TestResult::Ignored; -#endif } const bool coloredOutput = true; diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp index 97c53679e..15b07444c 100644 --- a/tools/slang-test/test-context.cpp +++ b/tools/slang-test/test-context.cpp @@ -61,29 +61,22 @@ TestReporter* TestContext::getTestReporter() SlangResult TestContext::locateFileCheck() { - // TODO(JS): - // Hack for now, disabling IFileCheck, as appears to cause crashes. - -#if 0 DefaultSharedLibraryLoader* loader = DefaultSharedLibraryLoader::getSingleton(); - ComPtr<ISlangSharedLibrary> library; - SLANG_RETURN_ON_FAIL(loader->loadSharedLibrary("slang-llvm", library.writeRef())); + + SLANG_RETURN_ON_FAIL(loader->loadSharedLibrary("slang-llvm", m_fileCheckLibrary.writeRef())); - if (!library) + if (!m_fileCheckLibrary) { return SLANG_FAIL; } using CreateFileCheckFunc = SlangResult (*)(const SlangUUID&, void**); - auto fn = reinterpret_cast<CreateFileCheckFunc>(library->findFuncByName("createLLVMFileCheck_V1")); + auto fn = reinterpret_cast<CreateFileCheckFunc>(m_fileCheckLibrary->findFuncByName("createLLVMFileCheck_V1")); if(!fn) { return SLANG_FAIL; } return fn(SLANG_IID_PPV_ARGS(m_fileCheck.writeRef())); -#else - return SLANG_FAIL; -#endif } Result TestContext::init(const char* inExePath) diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h index 0abc6906f..00aad5888 100644 --- a/tools/slang-test/test-context.h +++ b/tools/slang-test/test-context.h @@ -193,6 +193,7 @@ protected: Slang::Dictionary<Slang::String, SharedLibraryTool> m_sharedLibTools; + Slang::ComPtr<ISlangSharedLibrary> m_fileCheckLibrary; Slang::ComPtr<Slang::IFileCheck> m_fileCheck; }; |
