summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-10-31 15:02:18 -0400
committerGitHub <noreply@github.com>2019-10-31 15:02:18 -0400
commitf59df3814a514cab01f69a24e3330d13de3f9c92 (patch)
treee8178e2ea376556b79d66c342547134f92640f34 /tools
parent72f86c8273b196d204213f02e73ba772201f903d (diff)
Reference IR modules with entry point (#1101)
* Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Use isDefinition - for determining to add decorations to entry point lowering.
Diffstat (limited to 'tools')
-rw-r--r--tools/slang-test/slang-test-main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 79e810224..2000bf617 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -1086,6 +1086,30 @@ TestResult runSimpleTest(TestContext* context, TestInput& input)
return result;
}
+TestResult runCompile(TestContext* context, TestInput& input)
+{
+ // need to execute the stand-alone Slang compiler on the file, and compare its output to what we expect
+ auto outputStem = input.outputStem;
+
+ CommandLine cmdLine;
+ _initSlangCompiler(context, cmdLine);
+
+ for (auto arg : input.testOptions->args)
+ {
+ cmdLine.addArg(arg);
+ }
+
+ ExecuteResult exeRes;
+ TEST_RETURN_ON_DONE(spawnAndWait(context, outputStem, input.spawnType, cmdLine, exeRes));
+ if (context->isCollectingRequirements())
+ {
+ return TestResult::Pass;
+ }
+
+ return TestResult::Pass;
+}
+
+
static SlangResult _loadAsSharedLibrary(const UnownedStringSlice& hexDump, TemporaryFileSet& inOutTemporaryFileSet, SharedLibrary::Handle& outSharedLibrary)
{
// We need to extract the binary
@@ -2406,6 +2430,7 @@ static const TestCommandInfo s_testCommandInfos[] =
{ "CPP_COMPILER_SHARED_LIBRARY", &runCPPCompilerSharedLibrary},
{ "CPP_COMPILER_COMPILE", &runCPPCompilerCompile},
{ "PERFORMANCE_PROFILE", &runPerformanceProfile},
+ { "COMPILE", &runCompile},
};
TestResult runTest(