Add an option to undefine __IMAGE_SUPPORT__ (#353)
Clang now defines it by default (was picked up in the update)
and the conformance tests check that this is defined if and only
if the runtime advertises support.
Signed-off-by: Kévin Petit <kpet@free.fr>
diff --git a/lib/Compiler.cpp b/lib/Compiler.cpp
index e94eb59..c222a1e 100644
--- a/lib/Compiler.cpp
+++ b/lib/Compiler.cpp
@@ -429,7 +429,9 @@
instance.getLangOpts().FastRelaxedMath = cl_fast_relaxed_math;
// Preprocessor options
- instance.getPreprocessorOpts().addMacroDef("__IMAGE_SUPPORT__");
+ if (!clspv::Option::ImageSupport()) {
+ instance.getPreprocessorOpts().addMacroUndef("__IMAGE_SUPPORT__");
+ }
if (cl_fast_relaxed_math) {
instance.getPreprocessorOpts().addMacroDef("__FAST_RELAXED_MATH__");
}