diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 6ab8bcbe8980c..311b15d39545f 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -2619,9 +2619,9 @@ def fsycl_host_compiler_options_EQ : Joined<["-"], "fsycl-host-compiler-options= Flags<[CoreOption]>, HelpText<"When performing the host compilation with " "-fsycl-host-compiler specified, use the given options during that compile. " "Options are expected to be a quoted list of space separated options.">; -def fsycl_use_footer : Flag<["-"], "fsycl-use-footer">, Flags<[CoreOption]>, - HelpText<"Enable usage of the integration footer during SYCL enabled " - "compilations.">; +def fno_sycl_use_footer : Flag<["-"], "fno-sycl-use-footer">, Flags<[CoreOption]>, + HelpText<"Disable usage of the integration footer during SYCL enabled " + "compilations.">; def fsyntax_only : Flag<["-"], "fsyntax-only">, Flags<[NoXarchOption,CoreOption,CC1Option,FC1Option]>, Group; def ftabstop_EQ : Joined<["-"], "ftabstop=">, Group; diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 2b40c6b83c32f..c0f61b73b67a6 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -5612,7 +5612,7 @@ Action *Driver::ConstructPhaseAction( } types::ID HostPPType = types::getPreprocessedType(Input->getType()); if (Args.hasArg(options::OPT_fsycl) && HostPPType != types::TY_INVALID && - Args.hasArg(options::OPT_fsycl_use_footer) && + !Args.hasArg(options::OPT_fno_sycl_use_footer) && TargetDeviceOffloadKind == Action::OFK_None) { // Performing a host compilation with -fsycl. Append the integration // footer to the preprocessed source file. We then add another diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 9a63505cde14d..d6108b39ea6b1 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -1189,7 +1189,7 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, // When preprocessing using the integration footer, add the comments // to the first preprocessing step. if (JA.isOffloading(Action::OFK_SYCL) && !ContainsAppendFooterAction(&JA) && - Args.hasArg(options::OPT_fsycl_use_footer) && + !Args.hasArg(options::OPT_fno_sycl_use_footer) && JA.isDeviceOffloading(Action::OFK_None)) CmdArgs.push_back("-C"); @@ -4643,7 +4643,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString(HeaderOpt)); } - if (Args.hasArg(options::OPT_fsycl_use_footer)) { + if (!Args.hasArg(options::OPT_fno_sycl_use_footer)) { // Add the integration footer option to generated the footer. StringRef Footer(D.getIntegrationFooter(Input.getBaseInput())); if (!Footer.empty()) { diff --git a/clang/lib/Sema/SemaSYCL.cpp b/clang/lib/Sema/SemaSYCL.cpp index 1170ca0783169..8d9d80eb57913 100644 --- a/clang/lib/Sema/SemaSYCL.cpp +++ b/clang/lib/Sema/SemaSYCL.cpp @@ -4965,6 +4965,8 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) { Policy.SuppressTypedefs = true; Policy.SuppressUnwrittenScope = true; + OS << "#include \n"; + llvm::SmallSet VisitedSpecConstants; // Used to uniquely name the 'shim's as we generate the names in each @@ -4988,7 +4990,7 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) { OS << "namespace sycl {\n"; OS << "namespace detail {\n"; OS << "template<>\n"; - OS << "inline const char *get_spec_constant_symbolic_ID<"; + OS << "inline const char *get_spec_constant_symbolic_ID_impl<"; if (VD->isInAnonymousNamespace()) { OS << TopShim; @@ -5008,6 +5010,7 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) { } OS << "#include \n"; + return true; } diff --git a/clang/test/CodeGenSYCL/anonymous_integration_footer.cpp b/clang/test/CodeGenSYCL/anonymous_integration_footer.cpp index 60d983cebe0b7..ec9f726bd7b50 100644 --- a/clang/test/CodeGenSYCL/anonymous_integration_footer.cpp +++ b/clang/test/CodeGenSYCL/anonymous_integration_footer.cpp @@ -9,7 +9,10 @@ int main() { cl::sycl::kernel_single_task([]() {}); } +// CHECK: #include + using namespace cl; + // Example ways in which the application can declare a "specialization_id" // variable. struct S1 { @@ -18,7 +21,7 @@ struct S1 { // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> - // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::S1::a>() { + // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::S1::a>() { // CHECK-NEXT: return "_ZN2S11aE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -30,7 +33,7 @@ constexpr sycl::specialization_id b{2}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::b>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::b>() { // CHECK-NEXT: return "____ZL1b"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -41,7 +44,7 @@ inline constexpr sycl::specialization_id c{3}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::c>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::c>() { // CHECK-NEXT: return "_Z1c"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -52,7 +55,7 @@ static constexpr sycl::specialization_id d{4}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::d>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::d>() { // CHECK-NEXT: return "____ZL1d"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -73,7 +76,7 @@ struct S2 { // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> - // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { + // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_12S21aE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -91,7 +94,7 @@ template class S3<1>; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::S3<1>::a>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::S3<1>::a>() { // CHECK-NEXT: return "_ZN2S3ILi1EE1aE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -102,7 +105,7 @@ template class S3<2>; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::S3<2>::a>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::S3<2>::a>() { // CHECK-NEXT: return "_ZN2S3ILi2EE1aE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -115,7 +118,7 @@ constexpr sycl::specialization_id same_name{5}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::inner::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::inner::same_name>() { // CHECK-NEXT: return "____ZN5innerL9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -127,7 +130,7 @@ constexpr sycl::specialization_id same_name{6}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::same_name>() { // CHECK-NEXT: return "____ZL9same_name"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -146,7 +149,7 @@ constexpr sycl::specialization_id same_name{7}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -167,7 +170,7 @@ constexpr sycl::specialization_id same_name{8}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_15inner9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -191,7 +194,7 @@ constexpr sycl::specialization_id same_name{9}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::inner::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::inner::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN5inner12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -206,7 +209,7 @@ constexpr sycl::specialization_id same_name{10}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::same_name>() { // CHECK-NEXT: return "____ZN5outerL9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -227,7 +230,7 @@ constexpr sycl::specialization_id same_name{11}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN5outer12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -249,7 +252,7 @@ constexpr sycl::specialization_id same_name{12}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN5outer12_GLOBAL__N_15inner9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -287,7 +290,7 @@ constexpr sycl::specialization_id same_name{13}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID_2]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::__sycl_detail::__spec_id_shim_[[SHIM_ID_2]]()>() { // CHECK-NEXT: return "____ZN5outer12_GLOBAL__N_15inner12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -312,7 +315,7 @@ constexpr sycl::specialization_id same_name{14}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_15outer9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -342,7 +345,7 @@ constexpr sycl::specialization_id same_name{15}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID2]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID2]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_15outer12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -372,7 +375,7 @@ constexpr sycl::specialization_id same_name{16}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID2]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID2]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_15outer12_GLOBAL__N_15inner9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -390,7 +393,7 @@ constexpr sycl::specialization_id same_name{17}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::inner::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::inner::same_name>() { // CHECK-NEXT: return "____ZN5outer5innerL9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail diff --git a/clang/test/CodeGenSYCL/anonymous_integration_footer2.cpp b/clang/test/CodeGenSYCL/anonymous_integration_footer2.cpp index 6e71acce15221..d90f593c4043b 100644 --- a/clang/test/CodeGenSYCL/anonymous_integration_footer2.cpp +++ b/clang/test/CodeGenSYCL/anonymous_integration_footer2.cpp @@ -8,6 +8,9 @@ int main() { cl::sycl::kernel_single_task([]() {}); } + +// CHECK: #include + using namespace cl; struct S1 { @@ -17,7 +20,7 @@ struct S1 { // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::S1::a>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::S1::a>() { // CHECK-NEXT: return "_ZN2S11aE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -29,7 +32,7 @@ constexpr sycl::specialization_id b{202}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::b>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::b>() { // CHECK-NEXT: return "____ZL1b"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -40,7 +43,7 @@ inline constexpr sycl::specialization_id c{3}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::c>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::c>() { // CHECK-NEXT: return "_Z1c"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -51,7 +54,7 @@ static constexpr sycl::specialization_id d{205}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::d>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::d>() { // CHECK-NEXT: return "____ZL1d"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -64,7 +67,7 @@ constexpr sycl::specialization_id same_name{5}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::inner::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::inner::same_name>() { // CHECK-NEXT: return "____ZN5innerL9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -76,7 +79,7 @@ constexpr sycl::specialization_id same_name{6}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::same_name>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::same_name>() { // CHECK-NEXT: return "____ZL9same_name"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -95,7 +98,7 @@ constexpr sycl::specialization_id same_name{207}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -116,7 +119,7 @@ constexpr sycl::specialization_id same_name{208}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_15inner9same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -143,7 +146,7 @@ constexpr sycl::specialization_id same_name{209}; // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::outer::inner::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::outer::inner::__sycl_detail::__spec_id_shim_[[SHIM_ID]]()>() { // CHECK-NEXT: return "____ZN5outer5inner12_GLOBAL__N_19same_nameE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail diff --git a/clang/test/CodeGenSYCL/integration_footer.cpp b/clang/test/CodeGenSYCL/integration_footer.cpp index fe456877991d5..5cacc62004f58 100644 --- a/clang/test/CodeGenSYCL/integration_footer.cpp +++ b/clang/test/CodeGenSYCL/integration_footer.cpp @@ -7,13 +7,15 @@ int main() { cl::sycl::kernel_single_task([]() {}); } +// CHECK: #include + using namespace cl::sycl; cl::sycl::specialization_id GlobalSpecID; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::GlobalSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::GlobalSpecID>() { // CHECK-NEXT: return "_Z12GlobalSpecID"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -24,7 +26,7 @@ struct Wrapper { // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> - // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Wrapper::WrapperSpecID>() { + // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Wrapper::WrapperSpecID>() { // CHECK-NEXT: return "_ZN7Wrapper13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -39,7 +41,7 @@ template class WrapperTemplate; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::WrapperTemplate::WrapperSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::WrapperTemplate::WrapperSpecID>() { // CHECK-NEXT: return "_ZN15WrapperTemplateIiE13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -48,7 +50,7 @@ template class WrapperTemplate; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::WrapperTemplate::WrapperSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::WrapperTemplate::WrapperSpecID>() { // CHECK-NEXT: return "_ZN15WrapperTemplateIdE13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -59,7 +61,7 @@ specialization_id NSSpecID; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::NSSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::NSSpecID>() { // CHECK-NEXT: return "_ZN3Foo8NSSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -69,7 +71,7 @@ specialization_id InlineNSSpecID; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::InlineNSSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::InlineNSSpecID>() { // CHECK-NEXT: return "_ZN3Foo3Bar14InlineNSSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -78,7 +80,7 @@ specialization_id NSSpecID; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::Bar::NSSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::Bar::NSSpecID>() { // CHECK-NEXT: return "_ZN3Foo3Bar8NSSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -89,7 +91,7 @@ struct Wrapper { // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> - // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::Wrapper::WrapperSpecID>() { + // CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::Wrapper::WrapperSpecID>() { // CHECK-NEXT: return "_ZN3Foo3Bar7Wrapper13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -104,7 +106,7 @@ template class WrapperTemplate; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::WrapperTemplate::WrapperSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::WrapperTemplate::WrapperSpecID>() { // CHECK-NEXT: return "_ZN3Foo3Bar15WrapperTemplateIiE13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -113,7 +115,7 @@ template class WrapperTemplate; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::WrapperTemplate::WrapperSpecID>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::WrapperTemplate::WrapperSpecID>() { // CHECK-NEXT: return "_ZN3Foo3Bar15WrapperTemplateIdE13WrapperSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -135,7 +137,7 @@ specialization_id AnonNSSpecID; // CHECK: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::Foo::__sycl_detail::__spec_id_shim_[[SHIM0]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::Foo::__sycl_detail::__spec_id_shim_[[SHIM0]]()>() { // CHECK-NEXT: return "____ZN3Foo12_GLOBAL__N_112AnonNSSpecIDE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail @@ -181,7 +183,7 @@ auto x = HasVarTemplate::VarTempl.getDefaultValue(); // CHECK-NEXT: namespace sycl { // CHECK-NEXT: namespace detail { // CHECK-NEXT: template<> -// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID<::__sycl_detail::__spec_id_shim_[[SHIM1]]()>() { +// CHECK-NEXT: inline const char *get_spec_constant_symbolic_ID_impl<::__sycl_detail::__spec_id_shim_[[SHIM1]]()>() { // CHECK-NEXT: return "____ZN12_GLOBAL__N_114HasVarTemplate8VarTemplIiLi2EEE"; // CHECK-NEXT: } // CHECK-NEXT: } // namespace detail diff --git a/clang/test/Driver/sycl-host-compiler.cpp b/clang/test/Driver/sycl-host-compiler.cpp index 5964359e93b34..b897ed0391c11 100644 --- a/clang/test/Driver/sycl-host-compiler.cpp +++ b/clang/test/Driver/sycl-host-compiler.cpp @@ -2,14 +2,14 @@ // REQUIRES: clang-driver /// enabling with -fsycl-host-compiler -// RUN: %clangxx -fsycl-use-footer -fsycl -fsycl-host-compiler=/some/dir/g++ %s -### 2>&1 \ +// RUN: %clangxx -fsycl -fsycl-host-compiler=/some/dir/g++ %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=HOST_COMPILER %s // HOST_COMPILER: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer={{.*}}" // HOST_COMPILER: g++{{.*}} "-E" "-include" "[[INTHEADER]]" "-I" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"{{.*}} "-o" "[[TMPII:.+\.ii]]" // HOST_COMPILER: g++{{.*}} "-c" "-I" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl"{{.*}} "-o" "[[HOSTOBJ:.+\.o]]"{{.*}} // HOST_COMPILER: ld{{.*}} "[[HOSTOBJ]]" -// RUN: %clang_cl -fsycl-use-footer -fsycl -fsycl-host-compiler=/some/dir/cl %s -### 2>&1 \ +// RUN: %clang_cl -fsycl -fsycl-host-compiler=/some/dir/cl %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=HOST_COMPILER_CL %s // HOST_COMPILER_CL: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer={{.*}}" // HOST_COMPILER_CL: cl{{.*}} "-P" "-Fi[[TMPII:.+\.ii]]" "-FI" "[[INTHEADER]]"{{.*}} "-I" "{{.*}}bin{{[/\\]+}}..{{[/\\]+}}include{{[/\\]+}}sycl" @@ -29,12 +29,16 @@ // RUN: %clangxx -fsycl -fsycl-host-compiler=g++ -E %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=HOST_PREPROCESS %s // HOST_PREPROCESS: g++{{.*}} "-E"{{.*}} "-o" "[[PPOUT:.+\.ii]]" -// HOST_PREPROCESS: clang-offload-bundler{{.*}} "-inputs={{.*}}.ii,[[PPOUT]]" +// HOST_PREPROCESS: append-file{{.*}} "[[PPOUT]]"{{.*}} "--output=[[APPEND:.+\.cpp]]" +// HOST_PREPROCESS: g++{{.*}} "[[APPEND]]"{{.*}} "-E"{{.*}} "-o" "[[PPOUT2:.+\.ii]]" +// HOST_PREPROCESS: clang-offload-bundler{{.*}} "-inputs={{.*}}.ii,[[PPOUT2]]" // RUN: %clang_cl -fsycl -fsycl-host-compiler=cl -E %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=HOST_PREPROCESS_CL %s // HOST_PREPROCESS_CL: cl{{.*}} "-P"{{.*}} "-Fi[[PPOUT:.+\.ii]]" -// HOST_PREPROCESS_CL: clang-offload-bundler{{.*}} "-inputs={{.*}}.ii,[[PPOUT]]" +// HOST_PREPROCESS_CL: append-file{{.*}} "[[PPOUT]]"{{.*}} "--output=[[APPEND:.+\.cpp]]" +// HOST_PREPROCESS_CL: cl{{.*}} "[[APPEND]]"{{.*}} "-P"{{.*}} "-Fi[[PPOUT2:.+\.ii]]" +// HOST_PREPROCESS_CL: clang-offload-bundler{{.*}} "-inputs={{.*}}.ii,[[PPOUT2]]" /// obj output // RUN: %clangxx -fsycl -fsycl-host-compiler=g++ -c %s -### 2>&1 \ diff --git a/clang/test/Driver/sycl-int-footer.cpp b/clang/test/Driver/sycl-int-footer.cpp index f7c15cdca13fe..cc54bf70f28a0 100644 --- a/clang/test/Driver/sycl-int-footer.cpp +++ b/clang/test/Driver/sycl-int-footer.cpp @@ -1,5 +1,5 @@ /// Check compilation tool steps when using the integration footer -// RUN: %clangxx -fsycl -fsycl-use-footer %s -### 2>&1 \ +// RUN: %clangxx -fsycl %s -### 2>&1 \ // RUN: | FileCheck -check-prefix FOOTER %s // FOOTER: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\h]]" "-sycl-std={{.*}}" // FOOTER: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-E"{{.*}} "-C"{{.*}} "-o" "[[PREPROC:.+\.ii]]" @@ -8,7 +8,7 @@ // FOOTER-NOT: "-include" "[[INTHEADER]]" /// Preprocessed file creation with integration footer -// RUN: %clangxx -fsycl -fsycl-use-footer -E %s -### 2>&1 \ +// RUN: %clangxx -fsycl -E %s -### 2>&1 \ // RUN: | FileCheck -check-prefix FOOTER_PREPROC_GEN %s // FOOTER_PREPROC_GEN: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\h]]" "-sycl-std={{.*}}" "-o" "[[PREPROC_DEVICE:.+\.ii]]" // FOOTER_PREPROC_GEN: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-E"{{.*}} "-o" "[[PREPROC1:.+\.ii]]" @@ -18,9 +18,48 @@ /// Preprocessed file use with integration footer // RUN: touch %t.ii -// RUN: %clangxx -fsycl -fsycl-use-footer %t.ii -### 2>&1 \ +// RUN: %clangxx -fsycl %t.ii -### 2>&1 \ // RUN: | FileCheck -check-prefix FOOTER_PREPROC_USE %s // FOOTER_PREPROC_USE: clang-offload-bundler{{.*}} "-outputs=[[HOST1:.+\.ii]],[[DEVICE_PP:.+\.ii]]" // FOOTER_PREPROC_USE: clang{{.*}} "-fsycl-is-device"{{.*}} "[[DEVICE_PP]]" // FOOTER_PREPROC_USE: clang-offload-bundler{{.*}} "-outputs=[[HOST_PP:.+\.ii]],[[DEVICE1:.+\.ii]]" // FOOTER_PREPROC_USE: clang{{.*}} "-fsycl-is-host"{{.*}} "[[HOST_PP]]" + +/// Check that integration footer can be disabled +// RUN: %clangxx -fsycl -fno-sycl-use-footer %s -### 2>&1 \ +// RUN: | FileCheck -check-prefix NO-FOOTER --implicit-check-not "-fsycl-int-footer" %s +// NO-FOOTER: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-sycl-std={{.*}}" +// NO-FOOTER: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-o" + +/// Check phases without integration footer +// RUN: %clangxx -fsycl -fno-sycl-device-lib=all -fno-sycl-use-footer %s -ccc-print-phases 2>&1 \ +// RUN: | FileCheck -check-prefix NO-FOOTER-PHASES -check-prefix COMMON-PHASES %s +// NO-FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) +// NO-FOOTER-PHASES: [[#HOST_PREPROC:]]: preprocessor, {0}, c++-cpp-output, (host-sycl) +// NO-FOOTER-PHASES: 2: input, "{{.*}}", c++, (device-sycl) +// NO-FOOTER-PHASES: 3: preprocessor, {2}, c++-cpp-output, (device-sycl) +// NO-FOOTER-PHASES: [[#DEVICE_IR:]]: compiler, {3}, ir, (device-sycl) + +/// Check phases with integration footer +// RUN: %clangxx -fsycl -fno-sycl-device-lib=all %s -ccc-print-phases 2>&1 \ +// RUN: | FileCheck -check-prefix FOOTER-PHASES -check-prefix COMMON-PHASES %s +// FOOTER-PHASES: 0: input, "{{.*}}", c++, (host-sycl) +// FOOTER-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) +// FOOTER-PHASES: 2: append-footer, {1}, c++, (host-sycl) +// FOOTER-PHASES: [[#HOST_PREPROC:]]: preprocessor, {2}, c++-cpp-output, (host-sycl) +// FOOTER-PHASES: 4: input, "{{.*}}", c++, (device-sycl) +// FOOTER-PHASES: 5: preprocessor, {4}, c++-cpp-output, (device-sycl) +// FOOTER-PHASES: [[#DEVICE_IR:]]: compiler, {5}, ir, (device-sycl) + +// COMMON-PHASES: [[#OFFLOAD:]]: offload, "host-sycl (x86_64-{{.*}})" {[[#HOST_PREPROC]]}, "device-sycl (spir64-unknown-unknown-sycldevice)" {[[#DEVICE_IR]]}, c++-cpp-output +// COMMON-PHASES: [[#OFFLOAD+1]]: compiler, {[[#OFFLOAD]]}, ir, (host-sycl) +// COMMON-PHASES: [[#OFFLOAD+2]]: backend, {[[#OFFLOAD+1]]}, assembler, (host-sycl) +// COMMON-PHASES: [[#OFFLOAD+3]]: assembler, {[[#OFFLOAD+2]]}, object, (host-sycl) +// COMMON-PHASES: [[#OFFLOAD+4]]: linker, {[[#OFFLOAD+3]]}, image, (host-sycl) +// COMMON-PHASES: [[#OFFLOAD+5]]: linker, {[[#DEVICE_IR]]}, ir, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+6]]: sycl-post-link, {[[#OFFLOAD+5]]}, tempfiletable, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+7]]: file-table-tform, {[[#OFFLOAD+6]]}, tempfilelist, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+8]]: llvm-spirv, {[[#OFFLOAD+7]]}, tempfilelist, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+9]]: file-table-tform, {[[#OFFLOAD+6]], [[#OFFLOAD+8]]}, tempfiletable, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+10]]: clang-offload-wrapper, {[[#OFFLOAD+9]]}, object, (device-sycl) +// COMMON-PHASES: [[#OFFLOAD+11]]: offload, "host-sycl (x86_64-{{.*}})" {[[#OFFLOAD+4]]}, "device-sycl (spir64-unknown-unknown-sycldevice)" {[[#OFFLOAD+10]]}, image diff --git a/clang/test/Driver/sycl-intelfpga-aoco-win.cpp b/clang/test/Driver/sycl-intelfpga-aoco-win.cpp index 8e1470aa17a24..29ada59e0cf77 100755 --- a/clang/test/Driver/sycl-intelfpga-aoco-win.cpp +++ b/clang/test/Driver/sycl-intelfpga-aoco-win.cpp @@ -7,9 +7,9 @@ // RUN: clang-offload-wrapper -o %t-aoco.bc -host=x86_64-pc-windows-msvc -kind=sycl -target=fpga_aoco-intel-unknown-sycldevice %t.aoco // RUN: llc -filetype=obj -o %t-aoco.o %t-aoco.bc // RUN: llvm-ar crv %t_aoco.a %t.o %t2.o %t-aoco.o -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco.a %s -ccc-print-phases 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco.a %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-AOCO-PHASES-WIN %s -// RUN: %clangxx -fsycl-use-footer -target x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco.a %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -target x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco.a %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-AOCO-PHASES-WIN %s // CHK-FPGA-AOCO-PHASES-WIN: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl) // CHK-FPGA-AOCO-PHASES-WIN: 1: input, "[[INPUTSRC:.+\.cpp]]", c++, (host-sycl) diff --git a/clang/test/Driver/sycl-intelfpga-aoco.cpp b/clang/test/Driver/sycl-intelfpga-aoco.cpp index e42c15acc5ad7..fbf40140948ab 100755 --- a/clang/test/Driver/sycl-intelfpga-aoco.cpp +++ b/clang/test/Driver/sycl-intelfpga-aoco.cpp @@ -13,7 +13,7 @@ // RUN: llc -filetype=obj -o %t-aoco_cl.o %t-aoco_cl.bc // RUN: llvm-ar crv %t_aoco.a %t.o %t2.o %t-aoco.o // RUN: llvm-ar crv %t_aoco_cl.a %t.o %t2_cl.o %t-aoco_cl.o -// RUN: %clangxx -fsycl-use-footer -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga %t_aoco.a %s -ccc-print-phases 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga %t_aoco.a %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-FPGA-AOCO-PHASES %s // CHK-FPGA-AOCO-PHASES: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl) // CHK-FPGA-AOCO-PHASES: 1: input, "[[INPUTCPP:.+\.cpp]]", c++, (host-sycl) @@ -46,7 +46,7 @@ // CHK-FPGA-AOCO-PHASES: 28: offload, "host-sycl (x86_64-unknown-linux-gnu)" {12}, "device-sycl (spir64_fpga-unknown-unknown-sycldevice)" {27}, image /// FPGA AOCO Windows phases check -// RUN: %clang_cl -fsycl -fsycl-use-footer -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco_cl.a %s -ccc-print-phases 2>&1 \ +// RUN: %clang_cl -fsycl -fno-sycl-device-lib=all -fintelfpga -foffload-static-lib=%t_aoco_cl.a %s -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-AOCO-PHASES-WIN %s // CHK-FPGA-AOCO-PHASES-WIN: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl) // CHK-FPGA-AOCO-PHASES-WIN: 1: input, "[[INPUTSRC:.+\.cpp]]", c++, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-amdgcn.cpp b/clang/test/Driver/sycl-offload-amdgcn.cpp index 627932fc6f026..6824521c9fbe8 100644 --- a/clang/test/Driver/sycl-offload-amdgcn.cpp +++ b/clang/test/Driver/sycl-offload-amdgcn.cpp @@ -13,7 +13,7 @@ // CHK-ACTIONS: clang-offload-wrapper"{{.*}} "-host=x86_64-unknown-linux-gnu" "-target=amdgcn" "-kind=sycl"{{.*}} /// Check phases w/out specifying a compute capability. -// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl -fsycl-use-footer \ +// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \ // RUN: -fsycl-targets=amdgcn-amd-amdhsa-sycldevice -mcpu=gfx906 %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-NO-CC %s // CHK-PHASES-NO-CC: 0: input, "{{.*}}", c++, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-intelfpga-emu.cpp b/clang/test/Driver/sycl-offload-intelfpga-emu.cpp index c86c35a2c8954..aee1557f2ddde 100644 --- a/clang/test/Driver/sycl-offload-intelfpga-emu.cpp +++ b/clang/test/Driver/sycl-offload-intelfpga-emu.cpp @@ -180,9 +180,9 @@ /// -fintelfpga -fsycl-link from source // RUN: touch %t.cpp -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s -// RUN: %clang_cl --target=x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ +// RUN: %clang_cl --target=x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s // CHK-FPGA-LINK-SRC: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) // CHK-FPGA-LINK-SRC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-intelfpga.cpp b/clang/test/Driver/sycl-offload-intelfpga.cpp index 6c1fe42230e63..6014b253d493c 100644 --- a/clang/test/Driver/sycl-offload-intelfpga.cpp +++ b/clang/test/Driver/sycl-offload-intelfpga.cpp @@ -242,9 +242,9 @@ /// -fintelfpga -fsycl-link from source // RUN: touch %t.cpp -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s -// RUN: %clang_cl --target=x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ +// RUN: %clang_cl --target=x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -fsycl-link=early %t.cpp -ccc-print-phases 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-FPGA-LINK-SRC %s // CHK-FPGA-LINK-SRC: 0: input, "[[INPUT:.+\.cpp]]", c++, (host-sycl) // CHK-FPGA-LINK-SRC: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-nvptx.cpp b/clang/test/Driver/sycl-offload-nvptx.cpp index 7f5a52faf4325..c53dc49c8a10c 100644 --- a/clang/test/Driver/sycl-offload-nvptx.cpp +++ b/clang/test/Driver/sycl-offload-nvptx.cpp @@ -13,7 +13,7 @@ // CHK-ACTIONS: clang-offload-wrapper"{{.*}} "-host=x86_64-unknown-linux-gnu" "-target=nvptx64" "-kind=sycl"{{.*}} /// Check phases w/out specifying a compute capability. -// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl -fsycl-use-footer \ +// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \ // RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-NO-CC %s // CHK-PHASES-NO-CC: 0: input, "{{.*}}", c++, (host-sycl) @@ -35,7 +35,7 @@ // CHK-PHASES-NO-CC: 16: offload, "host-sycl (x86_64-unknown-linux-gnu)" {11}, "device-sycl (nvptx64-nvidia-nvcl-sycldevice:sm_50)" {15}, image /// Check phases specifying a compute capability. -// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl -fsycl-use-footer \ +// RUN: %clangxx -ccc-print-phases -std=c++11 -target x86_64-unknown-linux-gnu -fsycl \ // RUN: -fsycl-targets=nvptx64-nvidia-nvcl-sycldevice \ // RUN: -Xsycl-target-backend "--cuda-gpu-arch=sm_35" %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES %s diff --git a/clang/test/Driver/sycl-offload-static-lib-2.cpp b/clang/test/Driver/sycl-offload-static-lib-2.cpp index 1e36e7a145242..bb57e769afd3c 100644 --- a/clang/test/Driver/sycl-offload-static-lib-2.cpp +++ b/clang/test/Driver/sycl-offload-static-lib-2.cpp @@ -45,7 +45,7 @@ /// test behaviors of fat static lib from source // RUN: touch %t_lib.a -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl-use-footer -fno-sycl-device-lib=all -fsycl %t_lib.a -ccc-print-phases %s 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fno-sycl-device-lib=all -fsycl %t_lib.a -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=STATIC_LIB_SRC // STATIC_LIB_SRC: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl) // STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.cpp]]", c++, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-static-lib.cpp b/clang/test/Driver/sycl-offload-static-lib.cpp index 447c56a06491d..93a2d6956112c 100644 --- a/clang/test/Driver/sycl-offload-static-lib.cpp +++ b/clang/test/Driver/sycl-offload-static-lib.cpp @@ -48,7 +48,7 @@ /// test behaviors of -foffload-static-lib= from source // RUN: touch %t.a -// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -foffload-static-lib=%t.a -ccc-print-phases %s 2>&1 \ +// RUN: %clangxx -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -foffload-static-lib=%t.a -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC // FOFFLOAD_STATIC_LIB_SRC: 0: input, "[[INPUTA:.+\.a]]", object, (host-sycl) diff --git a/clang/test/Driver/sycl-offload-win.c b/clang/test/Driver/sycl-offload-win.c index b2a7e35d43b5b..25c6209bcbaeb 100644 --- a/clang/test/Driver/sycl-offload-win.c +++ b/clang/test/Driver/sycl-offload-win.c @@ -57,9 +57,9 @@ /// Test behaviors of -foffload-static-lib= from source. // RUN: touch %t-orig.lib -// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ +// RUN: %clang --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC -// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ +// RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all %t-orig.lib -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=FOFFLOAD_STATIC_LIB_SRC // FOFFLOAD_STATIC_LIB_SRC: 0: input, "[[INPUTLIB:.+\.lib]]", object, (host-sycl) // FOFFLOAD_STATIC_LIB_SRC: 1: input, "[[INPUTC:.+\.c]]", c++, (host-sycl) @@ -101,5 +101,7 @@ // RUN: %clang_cl --target=x86_64-pc-windows-msvc -fsycl -P %s -### 2>&1 | FileCheck -check-prefix=FSYCL_P %s // FSYCL_P: clang{{.*}} "-cc1" "-triple" "spir64-unknown-unknown-sycldevice" {{.*}} "-E" {{.*}} "-o" "[[DEVICEPP:.+\.ii]]" // FSYCL_P: clang{{.*}} "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" {{.*}} "-E" {{.*}} "-o" "[[HOSTPP:.+\.ii]]" +// FSYCL_P: append-file{{.*}} "[[HOSTPP]]"{{.*}} "--output=[[APPEND:.+\.cpp]]" +// FSYCL_P: clang{{.*}} "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" {{.*}} "-E" {{.*}} "-o" "[[HOSTPP:.+\.ii]]"{{.*}} "[[APPEND]]" // FSYCL_P: clang-offload-bundler{{.*}} "-type=ii" "-targets=sycl-spir64-unknown-unknown-sycldevice,host-x86_64-pc-windows-msvc" {{.*}} "-inputs=[[DEVICEPP]],[[HOSTPP]]" diff --git a/clang/test/Driver/sycl-offload-with-split.c b/clang/test/Driver/sycl-offload-with-split.c index 3bd20045baab2..69192e9e90b2f 100644 --- a/clang/test/Driver/sycl-offload-with-split.c +++ b/clang/test/Driver/sycl-offload-with-split.c @@ -12,17 +12,17 @@ /// preprocessor and another one joining the device linking outputs to the host /// action. The same graph should be generated when no -fsycl-targets is used /// The same phase graph will be used with -fsycl-use-bitcode -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fno-sycl-use-bitcode %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fno-sycl-use-bitcode %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fno-sycl-use-bitcode %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fno-sycl-use-bitcode %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-use-bitcode %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-use-bitcode %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-use-bitcode %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-use-bitcode %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s // CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -50,7 +50,7 @@ /// Check the phases also add a library to make sure it is treated as input by /// the device. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-LIB %s // CHK-PHASES-LIB: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-LIB: 1: input, "[[INPUT:.+\.c]]", c++, (host-sycl) @@ -77,7 +77,7 @@ /// Check the phases when using and multiple source files // RUN: echo " " > %t.c -// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl -fsycl-use-footer -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s %t.c 2>&1 \ +// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice %s %t.c 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-FILES %s // CHK-PHASES-FILES: 0: input, "somelib", object, (host-sycl) @@ -138,7 +138,7 @@ /// Check separate compilation with offloading - unbundling with source // RUN: touch %t.o -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl -fsycl-use-footer -fno-sycl-device-lib=all -fsycl-device-code-split %t.o -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split %t.o -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBUACTIONS %s // CHK-UBUACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBUACTIONS: 1: input, "[[INPUT1:.+\.o]]", object, (host-sycl) @@ -166,11 +166,11 @@ /// ########################################################################### /// Ahead of Time compilation for fpga, gen, cpu -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-FPGA -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU // CHK-PHASES-AOT: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES-AOT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -200,13 +200,13 @@ /// ########################################################################### /// Ahead of Time compilation for fpga, gen, cpu - tool invocation -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xshardware %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xshardware %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fintelfpga -Xshardware %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fintelfpga -Xshardware %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU // CHK-TOOLS-AOT: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]" // CHK-TOOLS-AOT: llvm-link{{.*}} "[[OUTPUT1]]" "-o" "[[OUTPUT2:.+\.bc]]" @@ -228,7 +228,7 @@ /// ########################################################################### /// offload with multiple targets, including AOT -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG %s // CHK-PHASE-MULTI-TARG: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) diff --git a/clang/test/Driver/sycl-offload.c b/clang/test/Driver/sycl-offload.c index 286c73500655f..6de33b42711ad 100644 --- a/clang/test/Driver/sycl-offload.c +++ b/clang/test/Driver/sycl-offload.c @@ -169,17 +169,17 @@ /// preprocessor and another one joining the device linking outputs to the host /// action. The same graph should be generated when no -fsycl-targets is used /// The same phase graph will be used with -fsycl-use-bitcode -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fno-sycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fno-sycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fsycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -fsycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s -// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl-use-footer -fsycl -fsycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl -fsycl-use-bitcode -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s // CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -206,7 +206,7 @@ /// ########################################################################### /// Check the compilation flow to verify that the integrated header is filtered -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -c %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -c %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefix=CHK-INT-HEADER // CHK-INT-HEADER: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]" // CHK-INT-HEADER: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-include" "[[INPUT1]]" "-dependency-filter" "[[INPUT1]]" {{.*}} "-o" "[[TMPII:.+\.ii]]" @@ -217,7 +217,7 @@ /// Check the phases also add a library to make sure it is treated as input by /// the device. -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl-use-footer -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-LIB %s // CHK-PHASES-LIB: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-LIB: 1: input, "[[INPUT:.+\.c]]", c++, (host-sycl) @@ -251,7 +251,7 @@ /// Check the phases when using and multiple source files // RUN: echo " " > %t.c -// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s %t.c 2>&1 \ +// RUN: %clang -ccc-print-phases -lsomelib -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64-unknown-unknown-sycldevice -fno-sycl-device-lib=all %s %t.c 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASES-FILES %s // CHK-PHASES-FILES: 0: input, "somelib", object, (host-sycl) // CHK-PHASES-FILES: 1: input, "[[INPUT1:.+\.c]]", c++, (host-sycl) @@ -288,7 +288,7 @@ /// ########################################################################### /// Check separate compilation with offloading - bundling actions -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -c -o %t.o -lsomelib -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -c -o %t.o -lsomelib -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-BUACTIONS %s // CHK-BUACTIONS: 0: input, "[[INPUT:.+\.c]]", c++, (device-sycl) // CHK-BUACTIONS: 1: preprocessor, {0}, c++-cpp-output, (device-sycl) @@ -332,7 +332,7 @@ /// Check separate compilation with offloading - unbundling with source // RUN: touch %t.o -// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl-use-footer -fsycl -fno-sycl-device-lib=all %t.o -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -lsomelib -fsycl -fno-sycl-device-lib=all %t.o -fsycl-targets=spir64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-UBUACTIONS %s // CHK-UBUACTIONS: 0: input, "somelib", object, (host-sycl) // CHK-UBUACTIONS: 1: input, "[[INPUT1:.+\.o]]", object, (host-sycl) @@ -476,7 +476,7 @@ /// Check offload with multiple triples, multiple binaries passed through -fsycl-add-targets -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -o %t.out -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy.spv,spir64_fpga-unknown-unknown-sycldevice:dummy.aocx,spir64_gen-unknown-unknown-sycldevice:dummy_Gen9core.bin %s 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -o %t.out -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy.spv,spir64_fpga-unknown-unknown-sycldevice:dummy.aocx,spir64_gen-unknown-unknown-sycldevice:dummy_Gen9core.bin %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-ADD-TARGETS-MUL %s // CHK-ADD-TARGETS-MUL: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-ADD-TARGETS-MUL: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -502,7 +502,7 @@ /// Check offload with single triple, multiple binaries passed through -fsycl-add-targets -// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -o %t.out -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy0.spv,spir64-unknown-unknown-sycldevice:dummy1.spv,spir64-unknown-unknown-sycldevice:dummy2.spv %s 2>&1 \ +// RUN: %clang -### -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl -o %t.out -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy0.spv,spir64-unknown-unknown-sycldevice:dummy1.spv,spir64-unknown-unknown-sycldevice:dummy2.spv %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-ADD-TARGETS-MUL-BINS %s // CHK-ADD-TARGETS-MUL-BINS: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-ADD-TARGETS-MUL-BINS: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -528,7 +528,7 @@ /// Check regular offload with an additional AOT binary passed through -fsycl-add-targets (same triple) -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy.spv -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -fsycl-add-targets=spir64-unknown-unknown-sycldevice:dummy.spv -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-ADD-TARGETS-REG %s // CHK-ADD-TARGETS-REG: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-ADD-TARGETS-REG: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -555,7 +555,7 @@ /// ########################################################################### /// Check regular offload with multiple additional AOT binaries passed through -fsycl-add-targets -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -fsycl-add-targets=spir64_fpga-unknown-unknown-sycldevice:dummy.aocx,spir64_gen-unknown-unknown-sycldevice:dummy_Gen9core.bin,spir64_x86_64-unknown-unknown-sycldevice:dummy.ir -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -fsycl-add-targets=spir64_fpga-unknown-unknown-sycldevice:dummy.aocx,spir64_gen-unknown-unknown-sycldevice:dummy_Gen9core.bin,spir64_x86_64-unknown-unknown-sycldevice:dummy.ir -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-ADD-TARGETS-REG-MUL %s // CHK-ADD-TARGETS-REG-MUL: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-ADD-TARGETS-REG-MUL: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -633,17 +633,17 @@ /// ########################################################################### /// Ahead of Time compilation for fpga, gen, cpu -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-FPGA -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-FPGA -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU -// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64 %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -ccc-print-phases -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64 %s 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-PHASES-AOT,CHK-PHASES-CPU // CHK-PHASES-AOT: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASES-AOT: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -675,29 +675,29 @@ /// ########################################################################### /// Ahead of Time compilation for fpga, gen, cpu - tool invocation -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-EMU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-EMU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xshardware %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xshardware %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-HW -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -Xshardware %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -Xshardware %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-HW -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xssimulation %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xssimulation %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-HW -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -Xssimulation %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -Xssimulation %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-HW -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xsemulator %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_fpga-unknown-unknown-sycldevice -Xsemulator %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-EMU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fintelfpga -Xsemulator %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fintelfpga -Xsemulator %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-FPGA,CHK-TOOLS-FPGA-EMU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_gen-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-GEN -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %s -### 2>&1 \ // RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-AOT,CHK-TOOLS-CPU // CHK-TOOLS-FPGA: clang{{.*}} "-triple" "spir64_fpga-unknown-unknown-sycldevice" // CHK-TOOLS-GEN: clang{{.*}} "-triple" "spir64_gen-unknown-unknown-sycldevice" @@ -831,7 +831,7 @@ /// ########################################################################### /// offload with multiple targets, including AOT -// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice -ccc-print-phases %s 2>&1 \ +// RUN: %clang -target x86_64-unknown-linux-gnu -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice,spir64_fpga-unknown-unknown-sycldevice,spir64_gen-unknown-unknown-sycldevice -ccc-print-phases %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-PHASE-MULTI-TARG %s // CHK-PHASE-MULTI-TARG: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl) // CHK-PHASE-MULTI-TARG: 1: preprocessor, {0}, c++-cpp-output, (host-sycl) @@ -875,9 +875,9 @@ /// ########################################################################### /// Verify that -save-temps does not crash -// RUN: %clang -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 -// RUN: %clang -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 -// RUN: %clangxx -fsycl-use-footer -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ +// RUN: %clang -fsycl -fno-sycl-device-lib=all -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 +// RUN: %clang -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 +// RUN: %clangxx -fsycl -fno-sycl-device-lib=all -fsycl-targets=spir64-unknown-unknown-sycldevice -target x86_64-unknown-linux-gnu -save-temps %s -### 2>&1 \ // RUN: | FileCheck %s --check-prefixes=CHK-FSYCL-SAVE-TEMPS,CHK-FSYCL-SAVE-TEMPS-CONFL // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-o" "[[DEVICE_BASE_NAME:[a-z0-9-]+]].ii" // CHK-FSYCL-SAVE-TEMPS: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[HEADER_NAME:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[DEVICE_BASE_NAME]].bc"{{.*}} "[[DEVICE_BASE_NAME]].ii" @@ -898,7 +898,7 @@ // CHK-FSYCL-SAVE-TEMPS: ld{{.*}} "[[HOST_BASE_NAME]].o"{{.*}} "[[DEVICE_OBJ_NAME]]" /// -fsycl with /Fo testing -// RUN: %clang_cl -fsycl-use-footer -fsycl /Fosomefile.obj -c %s -### 2>&1 \ +// RUN: %clang_cl -fsycl /Fosomefile.obj -c %s -### 2>&1 \ // RUN: | FileCheck -check-prefix=FO-CHECK %s // FO-CHECK: clang{{.*}} "-fsycl-int-header=[[HEADER:.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]" // FO-CHECK: clang{{.*}} "-include" "[[HEADER]]" {{.*}} "-o" "[[TMPII:.+\.ii]]" diff --git a/clang/test/Driver/sycl-preprocess.cpp b/clang/test/Driver/sycl-preprocess.cpp index 11a7bd7d836dc..beb8dd4b483fe 100644 --- a/clang/test/Driver/sycl-preprocess.cpp +++ b/clang/test/Driver/sycl-preprocess.cpp @@ -6,8 +6,10 @@ // RUN: %clang_cl -fsycl -P -Fi%t_output.ii %s -### 2>&1 \ // RUN: | FileCheck -check-prefix PREPROC_ONLY %s // PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-E"{{.*}} "-o" "[[DEVICE_OUT:.+\.ii]]" -// PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]"{{.*}} "-fsyntax-only" -// PREPROC_ONLY: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_OUT:.+\.ii]]" +// PREPROC_ONLY: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INTHEADER:.+\.h]]" "-fsycl-int-footer=[[INTFOOTER:.+\.h]]"{{.*}} "-fsyntax-only" +// PREPROC_ONLY: clang{{.*}} "-include" "[[INTHEADER]]"{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_TEMP:.+\.ii]]" +// PREPROC_ONLY: append-file{{.*}} "[[HOST_TEMP]]" "--append=[[INTFOOTER]]" "--output=[[HOST_APPENDED:.+\.cpp]]" +// PREPROC_ONLY: clang{{.*}} "-fsycl-is-host"{{.*}} "-o" "[[HOST_OUT:.+\.ii]]"{{.*}} "[[HOST_APPENDED]]" // PREPROC_ONLY: clang-offload-bundler{{.*}} "-type=ii"{{.*}} "-outputs={{.+_output.ii}}" "-inputs=[[DEVICE_OUT]],[[HOST_OUT]]" /// When compiling from preprocessed file, no integration header is expected @@ -26,4 +28,6 @@ // PREPROC_PHASES: 4: compiler, {1}, none, (device-sycl) // PREPROC_PHASES: 5: offload, "host-sycl (x86_64-unknown-linux-gnu)" {3}, "device-sycl (spir64-unknown-unknown-sycldevice)" {4}, c++ // PREPROC_PHASES: 6: preprocessor, {5}, c++-cpp-output, (host-sycl) -// PREPROC_PHASES: 7: clang-offload-bundler, {2, 6}, c++-cpp-output, (host-sycl) +// PREPROC_PHASES: 7: append-footer, {6}, c++, (host-sycl) +// PREPROC_PHASES: 8: preprocessor, {7}, c++-cpp-output, (host-sycl) +// PREPROC_PHASES: 9: clang-offload-bundler, {2, 8}, c++-cpp-output, (host-sycl) diff --git a/sycl/include/CL/sycl/detail/kernel_desc.hpp b/sycl/include/CL/sycl/detail/kernel_desc.hpp index 6841f7de5de71..3182e9c5de431 100644 --- a/sycl/include/CL/sycl/detail/kernel_desc.hpp +++ b/sycl/include/CL/sycl/detail/kernel_desc.hpp @@ -17,13 +17,6 @@ __SYCL_INLINE_NAMESPACE(cl) { namespace sycl { namespace detail { -// This guard is needed because the libsycl.so can be compiled with C++ <=14 -// while the code requires C++17. This code is not supposed to be used by the -// libsycl.so so it should not be a problem. -#if __cplusplus > 201402L -template struct specialization_id_name_generator {}; -#endif - #ifndef __SYCL_DEVICE_ONLY__ #define _Bool bool #endif @@ -57,16 +50,19 @@ template struct SpecConstantInfo { static constexpr const char *getName() { return ""; } }; +// This guard is needed because the libsycl.so can be compiled with C++ <=14 +// while the code requires C++17. This code is not supposed to be used by the +// libsycl.so so it should not be a problem. #if __cplusplus >= 201703L -// Translates SYCL 2020 specialization constant type to its name. -template const char *get_spec_constant_symbolic_ID() { -#ifdef SYCL_LANGUAGE_VERSION - return __builtin_sycl_unique_stable_name( - specialization_id_name_generator); -#else - return ""; -#endif -} +// Translates SYCL 2020 `specialization_id` to a unique symbolic identifier. +// There are no primary definition, only specializations in the integration +// footer. +template const char *get_spec_constant_symbolic_ID_impl(); +// Wrapper is needed to delay instantiation of +// 'get_spec_constant_symbolic_ID_impl' until after we have encountered all +// specializations for it generated by the compiler in the integration footer. +// Definition in spec_const_integration.hpp. +template const char *get_spec_constant_symbolic_ID(); #endif #ifndef __SYCL_UNNAMED_LAMBDA__ diff --git a/sycl/include/CL/sycl/detail/spec_const_integration.hpp b/sycl/include/CL/sycl/detail/spec_const_integration.hpp new file mode 100644 index 0000000000000..056e197eeac72 --- /dev/null +++ b/sycl/include/CL/sycl/detail/spec_const_integration.hpp @@ -0,0 +1,28 @@ +//==---------------------- spec_const_integration.hpp ----------------------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once + +// This header file must not be included to any DPC++ headers. +// This header file should only be included to integration footer. + +__SYCL_INLINE_NAMESPACE(cl) { +namespace sycl { +namespace detail { + +#if __cplusplus >= 201703L +// Translates SYCL 2020 `specialization_id` to a unique symbolic identifier +// which is used internally by the toolchain +template const char *get_spec_constant_symbolic_ID() { + return get_spec_constant_symbolic_ID_impl(); +} +#endif + +} // namespace detail +} // namespace sycl +} // __SYCL_INLINE_NAMESPACE(cl) diff --git a/sycl/include/CL/sycl/kernel_handler.hpp b/sycl/include/CL/sycl/kernel_handler.hpp index 9a1fbaf15efb6..26d164944330f 100644 --- a/sycl/include/CL/sycl/kernel_handler.hpp +++ b/sycl/include/CL/sycl/kernel_handler.hpp @@ -49,8 +49,7 @@ class kernel_handler { typename T = typename std::remove_reference_t::value_type, std::enable_if_t> * = nullptr> T getSpecializationConstantOnDevice() { - const char *SymbolicID = __builtin_sycl_unique_stable_name( - detail::specialization_id_name_generator); + const char *SymbolicID = __builtin_sycl_unique_stable_id(S); return __sycl_getScalar2020SpecConstantValue( SymbolicID, &S, MSpecializationConstantsBuffer); } @@ -59,8 +58,7 @@ class kernel_handler { typename T = typename std::remove_reference_t::value_type, std::enable_if_t> * = nullptr> T getSpecializationConstantOnDevice() { - const char *SymbolicID = __builtin_sycl_unique_stable_name( - detail::specialization_id_name_generator); + const char *SymbolicID = __builtin_sycl_unique_stable_id(S); return __sycl_getComposite2020SpecConstantValue( SymbolicID, &S, MSpecializationConstantsBuffer); } diff --git a/sycl/test/basic_tests/SYCL-2020-spec-const-ids-order.cpp b/sycl/test/basic_tests/SYCL-2020-spec-const-ids-order.cpp index b71d70defd625..ecb8b1c6850ba 100644 --- a/sycl/test/basic_tests/SYCL-2020-spec-const-ids-order.cpp +++ b/sycl/test/basic_tests/SYCL-2020-spec-const-ids-order.cpp @@ -46,13 +46,13 @@ int main() { } // CHECK-PROP: [SYCL/specialization constants] -// CHECK-PROP-NEXT: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL5Val23EEE -// CHECK-PROP-NEXT: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL10ConstantIdEEE -// CHECK-PROP-NEXT: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL11SecondValueEEE -// CHECK-PROP-NEXT: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL11SpecConst42EEE +// CHECK-PROP-NEXT: [[UNIQUE_PREFIX:[a-z0-9]+]]____ZL5Val23 +// CHECK-PROP-NEXT: [[UNIQUE_PREFIX]]____ZL10ConstantId +// CHECK-PROP-NEXT: [[UNIQUE_PREFIX]]____ZL11SecondValue +// CHECK-PROP-NEXT: [[UNIQUE_PREFIX]]____ZL11SpecConst42 // // CHECK-IR: !sycl.specialization-constants = !{![[#MD0:]], ![[#MD1:]], ![[#MD2:]], ![[#MD3:]]} -// CHECK-IR: ![[#MD0]] = !{!"_ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL5Val23EEE", i32 [[#ID:]] -// CHECK-IR: ![[#MD1]] = !{!"_ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL10ConstantIdEEE", i32 [[#ID+1]] -// CHECK-IR: ![[#MD2]] = !{!"_ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL11SecondValueEEE", i32 [[#ID+2]] -// CHECK-IR: ![[#MD3]] = !{!"_ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL11SpecConst42EEE", i32 [[#ID+3]] +// CHECK-IR: ![[#MD0]] = !{!"[[UNIQUE_PREFIX:[a-z0-9]+]]____ZL5Val23", i32 [[#ID:]] +// CHECK-IR: ![[#MD1]] = !{!"[[UNIQUE_PREFIX]]____ZL10ConstantId", i32 [[#ID+1]] +// CHECK-IR: ![[#MD2]] = !{!"[[UNIQUE_PREFIX]]____ZL11SecondValue", i32 [[#ID+2]] +// CHECK-IR: ![[#MD3]] = !{!"[[UNIQUE_PREFIX]]____ZL11SpecConst42", i32 [[#ID+3]] diff --git a/sycl/test/basic_tests/SYCL-2020-spec-constants.cpp b/sycl/test/basic_tests/SYCL-2020-spec-constants.cpp index 1db6b8f2587da..83b9e854e98dd 100644 --- a/sycl/test/basic_tests/SYCL-2020-spec-constants.cpp +++ b/sycl/test/basic_tests/SYCL-2020-spec-constants.cpp @@ -86,19 +86,19 @@ int main() { } // CHECK: [SYCL/specialization constants] -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL12composite_idEEE=2| +// CHECK-DAG: [[UNIQUE_PREFIX:[a-z0-9]+]]____ZL12composite_id=2| // See FIXME above about bool type support -// CHECK-disabled: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL7bool_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL7int8_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL8float_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL8int16_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL8int32_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL8int64_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL8uint8_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL9double_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL9uint16_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL9uint32_idEEE=2| -// CHECK-DAG: _ZTSN2cl4sycl6detail32specialization_id_name_generatorIL_ZL9uint64_idEEE=2| +// CHECK-disabled: [[UNIQUE_PREFIX]]____IL_ZL7bool_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL7int8_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL8float_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL8int16_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL8int32_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL8int64_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL8uint8_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL9double_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL9uint16_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL9uint32_id=2| +// CHECK-DAG: [[UNIQUE_PREFIX]]____ZL9uint64_id=2| // FIXME: check line for half constant // CHECK-RT-NOT: [SYCL/specialization constants default values]