@@ -1143,6 +1143,30 @@ HWTEST_F(ModuleTranslationUnitTest, WhenBuildOptionsAreNullThenReuseExistingOpti
11431143 EXPECT_NE (pMockCompilerInterface->inputInternalOptions .find (" cl-intel-greater-than-4GB-buffer-required" ), std::string::npos);
11441144}
11451145
1146+ HWTEST_F (ModuleTranslationUnitTest, givenSystemSharedAllocationAllowedWhenBuildingModuleThen4GbBuffersAreRequired) {
1147+ struct MockCompilerInterface : CompilerInterface {
1148+ TranslationOutput::ErrorCode build (const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) override {
1149+ inputInternalOptions = input.internalOptions .begin ();
1150+ return TranslationOutput::ErrorCode::Success;
1151+ }
1152+ std::string inputInternalOptions;
1153+ };
1154+
1155+ auto mockCompilerInterface = new MockCompilerInterface;
1156+ auto &rootDeviceEnvironment = neoDevice->executionEnvironment ->rootDeviceEnvironments [neoDevice->getRootDeviceIndex ()];
1157+ rootDeviceEnvironment->compilerInterface .reset (mockCompilerInterface);
1158+
1159+ MockModuleTranslationUnit moduleTu (device);
1160+ auto ret = moduleTu.buildFromSpirV (" " , 0U , nullptr , " " , nullptr );
1161+ EXPECT_TRUE (ret);
1162+
1163+ if (neoDevice->areSharedSystemAllocationsAllowed ()) {
1164+ EXPECT_NE (mockCompilerInterface->inputInternalOptions .find (" cl-intel-greater-than-4GB-buffer-required" ), std::string::npos);
1165+ } else {
1166+ EXPECT_EQ (mockCompilerInterface->inputInternalOptions .find (" cl-intel-greater-than-4GB-buffer-required" ), std::string::npos);
1167+ }
1168+ }
1169+
11461170using PrintfModuleTest = Test<DeviceFixture>;
11471171
11481172HWTEST_F (PrintfModuleTest, GivenModuleWithPrintfWhenKernelIsCreatedThenPrintfAllocationIsPlacedInResidencyContainer) {
0 commit comments