mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fix ocloc options parsing
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
281a23419a
commit
02d8b3a024
@ -370,6 +370,25 @@ TEST_F(OfflineCompilerTests, givenDebugOptionThenInternalOptionShouldContainKern
|
|||||||
EXPECT_THAT(internalOptions, ::testing::HasSubstr("-cl-kernel-debug-enable"));
|
EXPECT_THAT(internalOptions, ::testing::HasSubstr("-cl-kernel-debug-enable"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(OfflineCompilerTests, givenDashGInBiggerOptionStringWhenInitializingThenInternalOptionsShouldNotContainKernelDebugEnable) {
|
||||||
|
|
||||||
|
std::vector<std::string> argv = {
|
||||||
|
"ocloc",
|
||||||
|
"-options",
|
||||||
|
"-gNotRealDashGOption",
|
||||||
|
"-file",
|
||||||
|
"test_files/copybuffer.cl",
|
||||||
|
"-device",
|
||||||
|
gEnvironment->devicePrefix.c_str()};
|
||||||
|
|
||||||
|
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||||
|
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||||
|
mockOfflineCompiler->initialize(argv.size(), argv);
|
||||||
|
|
||||||
|
std::string internalOptions = mockOfflineCompiler->internalOptions;
|
||||||
|
EXPECT_THAT(internalOptions, ::testing::Not(::testing::HasSubstr("-cl-kernel-debug-enable")));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(OfflineCompilerTests, givenVariousClStdValuesWhenCompilingSourceThenCorrectExtensionsArePassed) {
|
TEST_F(OfflineCompilerTests, givenVariousClStdValuesWhenCompilingSourceThenCorrectExtensionsArePassed) {
|
||||||
std::string clStdOptionValues[] = {"", "-cl-std=CL1.2", "-cl-std=CL2.0", "-cl-std=CL3.0"};
|
std::string clStdOptionValues[] = {"", "-cl-std=CL1.2", "-cl-std=CL2.0", "-cl-std=CL3.0"};
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ int OfflineCompiler::initialize(size_t numArgs, const std::vector<std::string> &
|
|||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.find(CompilerOptions::generateDebugInfo.str()) != std::string::npos) {
|
if (CompilerOptions::contains(options, CompilerOptions::generateDebugInfo.str())) {
|
||||||
if (hwInfo.platform.eRenderCoreFamily >= IGFX_GEN9_CORE) {
|
if (hwInfo.platform.eRenderCoreFamily >= IGFX_GEN9_CORE) {
|
||||||
internalOptions = CompilerOptions::concatenate(internalOptions, CompilerOptions::debugKernelEnable);
|
internalOptions = CompilerOptions::concatenate(internalOptions, CompilerOptions::debugKernelEnable);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user