ocloc - don't require device for src->spv

Change-Id: Idb2acd9af4e09f59958e3bc622885423a3f79227
This commit is contained in:
Jaroslaw Chodor
2020-11-02 17:49:56 +01:00
parent 4d2750161d
commit a07be76146
2 changed files with 24 additions and 5 deletions

View File

@@ -1358,4 +1358,21 @@ TEST(OclocCompile, whenDetectedPotentialInputTypeMismatchThenEmitsWarning) {
}
}
TEST(OclocCompile, givenCommandLineWithoutDeviceWhenCompilingToSpirvThenSucceedsButUsesEmptyExtensionString) {
MockOfflineCompiler ocloc;
std::vector<std::string> argv = {
"ocloc",
"-q",
"-file",
"test_files/copybuffer.cl",
"-spv_only"};
int retVal = ocloc.initialize(argv.size(), argv);
ASSERT_EQ(0, retVal);
retVal = ocloc.build();
EXPECT_EQ(0, retVal);
EXPECT_THAT(ocloc.internalOptions.c_str(), testing::HasSubstr("-cl-ext=-all,+cl_khr_3d_image_writes"));
}
} // namespace NEO