diff --git a/clang/lib/DPCT/AnalysisInfo.cpp b/clang/lib/DPCT/AnalysisInfo.cpp index 67fe389b928e..18f7bd23ded7 100644 --- a/clang/lib/DPCT/AnalysisInfo.cpp +++ b/clang/lib/DPCT/AnalysisInfo.cpp @@ -872,8 +872,14 @@ void DpctFileInfo::insertHeader(HeaderType Type, unsigned Offset, if (Type == HT_DPL_Algorithm || Type == HT_DPL_Execution || Type == HT_SYCL) { if (auto MF = DpctGlobalInfo::getInstance().getMainFile()) if (this != MF.get() && FirstIncludeOffset.count(MF)) { - DpctGlobalInfo::getInstance().getMainFile()->insertHeader( - Type, FirstIncludeOffset.at(MF)); + // If is included before , the + // compilation will fail. + auto Iter = + DpctGlobalInfo::getAfterBitsStdcxxFilesMap().find(MF->FilePath); + if (Iter != DpctGlobalInfo::getAfterBitsStdcxxFilesMap().end()) { + if (Iter->second.count(this->FilePath)) + MF->insertHeader(Type, FirstIncludeOffset.at(MF)); + } } } if (DpctGlobalInfo::getHeaderInsertedBitMap()[FilePath][Type]) @@ -2537,6 +2543,10 @@ std::unordered_set DpctGlobalInfo::CustomHelperFunctionAddtionalIncludes = {}; std::unordered_map> DpctGlobalInfo::HeaderInsertedBitMap = {}; +bool DpctGlobalInfo::IsAfterBitsStdcxx = false; +std::map> + DpctGlobalInfo::AfterBitsStdcxxFiles; ///// class DpctNameGenerator ///// void DpctNameGenerator::printName(const FunctionDecl *FD, llvm::raw_ostream &OS) { diff --git a/clang/lib/DPCT/AnalysisInfo.h b/clang/lib/DPCT/AnalysisInfo.h index a04c596dc344..0cd7432b6591 100644 --- a/clang/lib/DPCT/AnalysisInfo.h +++ b/clang/lib/DPCT/AnalysisInfo.h @@ -1394,6 +1394,12 @@ class DpctGlobalInfo { getHeaderInsertedBitMap() { return HeaderInsertedBitMap; } + static bool &getIsAfterBitsStdcxxStatus() { return IsAfterBitsStdcxx; } + static std::map> & + getAfterBitsStdcxxFilesMap() { + return AfterBitsStdcxxFiles; + } std::shared_ptr insertFile(const clang::tooling::UnifiedPath &FilePath) { return insertObject(FileMap, FilePath); @@ -1403,7 +1409,10 @@ class DpctGlobalInfo { return findObject(FileMap, FilePath); } std::shared_ptr getMainFile() const { return MainFile; } - void setMainFile(std::shared_ptr Main) { MainFile = Main; } + void setMainFile(std::shared_ptr Main) { + getIsAfterBitsStdcxxStatus() = false; + MainFile = Main; + } void recordIncludingRelationship( const clang::tooling::UnifiedPath &CurrentFileName, const clang::tooling::UnifiedPath &IncludedFileName); @@ -1721,6 +1730,17 @@ class DpctGlobalInfo { static std::unordered_set CustomHelperFunctionAddtionalIncludes; static std::unordered_map> HeaderInsertedBitMap; + // `IsAfterBitsStdcxx` is used as a flag. It is set to true when PP meet + // . It is reset to false when starting to process a new + // translation unit. + static bool IsAfterBitsStdcxx; + // If `IsAfterBitsStdcxx` is true, it means is already + // included, so the tool will record all files included since this time point. + // When inserting `sycl.hpp`, the tool can check if the insert location is in + // the map, if it is, the tool will also insert `sycl.hpp` at the main file. + static std::map> + AfterBitsStdcxxFiles; }; /// Generate mangle name of FunctionDecl as key of DeviceFunctionInfo. diff --git a/clang/lib/DPCT/PreProcessor.cpp b/clang/lib/DPCT/PreProcessor.cpp index f966eece729e..e20c5c0dc284 100644 --- a/clang/lib/DPCT/PreProcessor.cpp +++ b/clang/lib/DPCT/PreProcessor.cpp @@ -825,6 +825,11 @@ void IncludesCallbacks::FileChanged(SourceLocation Loc, FileChangeReason Reason, } clang::tooling::UnifiedPath InFile = SM.getFilename(Loc).str(); + if (DpctGlobalInfo::getIsAfterBitsStdcxxStatus()) { + DpctGlobalInfo::getAfterBitsStdcxxFilesMap() + [DpctGlobalInfo::getInstance().getMainFile()->getFilePath()] + .insert(InFile); + } if (IsFileInCmd || ProcessAll || GetSourceFileType(InFile.getCanonicalPath()) & SPT_CudaSource) { IncludeFileMap[DpctGlobalInfo::removeSymlinks( diff --git a/clang/lib/DPCT/RulesInclude/InclusionHeaders.cpp b/clang/lib/DPCT/RulesInclude/InclusionHeaders.cpp index 898a6aee6c61..67375ef33a80 100644 --- a/clang/lib/DPCT/RulesInclude/InclusionHeaders.cpp +++ b/clang/lib/DPCT/RulesInclude/InclusionHeaders.cpp @@ -132,6 +132,10 @@ void IncludesCallbacks::InclusionDirective( FileInfo->setFirstIncludeOffset(LocInfo.second); LastInclusionLocationUpdater Updater(FileInfo, FilenameRange.getEnd()); + if (FileName == "bits/stdc++.h") { + DpctGlobalInfo::getInstance().getIsAfterBitsStdcxxStatus() = true; + } + clang::tooling::UnifiedPath IncludedFile; if (auto OptionalAbs = Global.getAbsolutePath(*File)) IncludedFile = OptionalAbs.value(); diff --git a/clang/test/dpct/d_dh_constant_db.cpp b/clang/test/dpct/d_dh_constant_db.cpp index b4dc82903b86..647de13fa3f7 100644 --- a/clang/test/dpct/d_dh_constant_db.cpp +++ b/clang/test/dpct/d_dh_constant_db.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/d_dh_constant_db/d_dh_constant_db.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/d_dh_constant_db/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/d_dh_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/d_dh_constant_db_win.cpp b/clang/test/dpct/d_dh_constant_db_win.cpp index a2e3a5978aa0..486977b777c3 100644 --- a/clang/test/dpct/d_dh_constant_db_win.cpp +++ b/clang/test/dpct/d_dh_constant_db_win.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/d_dh_constant_db_win/d_dh_constant_db_win.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/d_dh_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/d_dh_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/d_hd_constant_db.cpp b/clang/test/dpct/d_hd_constant_db.cpp index aacc5117c8d0..1f64901cb520 100644 --- a/clang/test/dpct/d_hd_constant_db.cpp +++ b/clang/test/dpct/d_hd_constant_db.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/d_hd_constant_db/d_hd_constant_db.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/d_hd_constant_db/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/d_hd_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/d_hd_constant_db_win.cpp b/clang/test/dpct/d_hd_constant_db_win.cpp index be2a1b8be8be..7919fc465261 100644 --- a/clang/test/dpct/d_hd_constant_db_win.cpp +++ b/clang/test/dpct/d_hd_constant_db_win.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/d_hd_constant_db_win/d_hd_constant_db_win.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/d_hd_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/d_hd_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/dh_d_constant_db.cpp b/clang/test/dpct/dh_d_constant_db.cpp index 935035a019e4..b8e9bde433ff 100644 --- a/clang/test/dpct/dh_d_constant_db.cpp +++ b/clang/test/dpct/dh_d_constant_db.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/dh_d_constant_db/out/MainSourceFiles.yaml // RUN: dpct dh_d_constant_db.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/dh_d_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/dh_d_constant_db_win.cpp b/clang/test/dpct/dh_d_constant_db_win.cpp index 3a3f94dc2b8e..e4f68f10746d 100644 --- a/clang/test/dpct/dh_d_constant_db_win.cpp +++ b/clang/test/dpct/dh_d_constant_db_win.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/dh_d_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct dh_d_constant_db_win.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/dh_d_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/dh_h_constant_db.cpp b/clang/test/dpct/dh_h_constant_db.cpp index 3ba726ad57ce..73f35a1a7d2d 100644 --- a/clang/test/dpct/dh_h_constant_db.cpp +++ b/clang/test/dpct/dh_h_constant_db.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/dh_h_constant_db/out/MainSourceFiles.yaml // RUN: dpct dh_h_constant_db.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x c --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/dh_h_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/dh_h_constant_db_win.cpp b/clang/test/dpct/dh_h_constant_db_win.cpp index 318373d01362..640df41e6d1c 100644 --- a/clang/test/dpct/dh_h_constant_db_win.cpp +++ b/clang/test/dpct/dh_h_constant_db_win.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/dh_h_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct dh_h_constant_db_win.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x c --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/dh_h_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/h_dh_constant_db.cpp b/clang/test/dpct/h_dh_constant_db.cpp index b486c8f12423..2130f1d84a8a 100644 --- a/clang/test/dpct/h_dh_constant_db.cpp +++ b/clang/test/dpct/h_dh_constant_db.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/h_dh_constant_db/h_dh_constant_db.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/h_dh_constant_db/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/h_dh_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/h_dh_constant_db_win.cpp b/clang/test/dpct/h_dh_constant_db_win.cpp index 52a350b7a696..748e42ea7402 100644 --- a/clang/test/dpct/h_dh_constant_db_win.cpp +++ b/clang/test/dpct/h_dh_constant_db_win.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/h_dh_constant_db_win/h_dh_constant_db_win.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/h_dh_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/h_dh_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/h_hd_constant_db.cpp b/clang/test/dpct/h_hd_constant_db.cpp index 23085564fdd3..b8c6e6595adb 100644 --- a/clang/test/dpct/h_hd_constant_db.cpp +++ b/clang/test/dpct/h_hd_constant_db.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/h_hd_constant_db/h_hd_constant_db.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/h_hd_constant_db/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/h_hd_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/h_hd_constant_db_win.cpp b/clang/test/dpct/h_hd_constant_db_win.cpp index b172565902e4..f56ebd3eb174 100644 --- a/clang/test/dpct/h_hd_constant_db_win.cpp +++ b/clang/test/dpct/h_hd_constant_db_win.cpp @@ -17,7 +17,6 @@ // RUN: echo " \"file\": \"%/T/h_hd_constant_db_win/h_hd_constant_db_win.cpp\"" >> compile_commands.json // RUN: echo " }" >> compile_commands.json // RUN: echo "]" >> compile_commands.json -// RUN: rm %T/h_hd_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: FileCheck %s --match-full-lines --input-file %T/h_hd_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/hd_d_constant_db.cpp b/clang/test/dpct/hd_d_constant_db.cpp index fd65ccb7df1e..2da7b4da50d7 100644 --- a/clang/test/dpct/hd_d_constant_db.cpp +++ b/clang/test/dpct/hd_d_constant_db.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/hd_d_constant_db/out/MainSourceFiles.yaml // RUN: dpct hd_d_constant_db.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/hd_d_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/hd_d_constant_db_win.cpp b/clang/test/dpct/hd_d_constant_db_win.cpp index 4da746d1beaf..92e59c71aeeb 100644 --- a/clang/test/dpct/hd_d_constant_db_win.cpp +++ b/clang/test/dpct/hd_d_constant_db_win.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/hd_d_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct hd_d_constant_db_win.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x cuda --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/hd_d_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/hd_h_constant_db.cpp b/clang/test/dpct/hd_h_constant_db.cpp index e6b917db43df..3f110a90e88e 100644 --- a/clang/test/dpct/hd_h_constant_db.cpp +++ b/clang/test/dpct/hd_h_constant_db.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/hd_h_constant_db/out/MainSourceFiles.yaml // RUN: dpct hd_h_constant_db.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x c --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/hd_h_constant_db/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/hd_h_constant_db_win.cpp b/clang/test/dpct/hd_h_constant_db_win.cpp index b647fd8aba0d..e6b4c16eed9f 100644 --- a/clang/test/dpct/hd_h_constant_db_win.cpp +++ b/clang/test/dpct/hd_h_constant_db_win.cpp @@ -18,7 +18,6 @@ // RUN: echo "]" >> compile_commands.json // RUN: dpct -p=. --out-root=./out --cuda-include-path="%cuda-path/include" // RUN: rm compile_commands.json -// RUN: rm %T/hd_h_constant_db_win/out/MainSourceFiles.yaml // RUN: dpct hd_h_constant_db_win.cpp --out-root=./out --cuda-include-path="%cuda-path/include" -- -x c --cuda-host-only // RUN: FileCheck %s --match-full-lines --input-file %T/hd_h_constant_db_win/out/constant_header.h // RUN: cd .. diff --git a/clang/test/dpct/header_insert/a.cpp b/clang/test/dpct/header_insert/a.cpp index 0902b01e6b1c..2bac759ea717 100644 --- a/clang/test/dpct/header_insert/a.cpp +++ b/clang/test/dpct/header_insert/a.cpp @@ -1,3 +1,4 @@ +// UNSUPPORTED: system-windows // RUN: dpct --out-root %T/ %s --cuda-include-path="%cuda-path/include" // RUN: FileCheck --input-file %T/a.cpp.dp.cpp --match-full-lines %s diff --git a/clang/test/dpct/header_insert_2/a.cpp b/clang/test/dpct/header_insert_2/a.cpp new file mode 100644 index 000000000000..7490720f3a8f --- /dev/null +++ b/clang/test/dpct/header_insert_2/a.cpp @@ -0,0 +1,9 @@ +// RUN: dpct --out-root %T/ %s --cuda-include-path="%cuda-path/include" +// RUN: FileCheck --input-file %T/a.cpp --match-full-lines %s + +// CHECK: #include "h1.h" +#include "h1.h" + +int main() { + return 0; +} diff --git a/clang/test/dpct/header_insert_2/h1.h b/clang/test/dpct/header_insert_2/h1.h new file mode 100644 index 000000000000..2771cad12725 --- /dev/null +++ b/clang/test/dpct/header_insert_2/h1.h @@ -0,0 +1,5 @@ + +#include +#include +#include "h2.h" +#include "h3.h" diff --git a/clang/test/dpct/header_insert_2/h2.h b/clang/test/dpct/header_insert_2/h2.h new file mode 100644 index 000000000000..a18a13a42d1e --- /dev/null +++ b/clang/test/dpct/header_insert_2/h2.h @@ -0,0 +1,3 @@ + +// is not included +//#include diff --git a/clang/test/dpct/header_insert_2/h3.h b/clang/test/dpct/header_insert_2/h3.h new file mode 100644 index 000000000000..41fe537aac16 --- /dev/null +++ b/clang/test/dpct/header_insert_2/h3.h @@ -0,0 +1,4 @@ + +#include +#include +#include diff --git a/clang/test/dpct/header_insert_3/a.cpp b/clang/test/dpct/header_insert_3/a.cpp new file mode 100644 index 000000000000..7490720f3a8f --- /dev/null +++ b/clang/test/dpct/header_insert_3/a.cpp @@ -0,0 +1,9 @@ +// RUN: dpct --out-root %T/ %s --cuda-include-path="%cuda-path/include" +// RUN: FileCheck --input-file %T/a.cpp --match-full-lines %s + +// CHECK: #include "h1.h" +#include "h1.h" + +int main() { + return 0; +} diff --git a/clang/test/dpct/header_insert_3/h1.h b/clang/test/dpct/header_insert_3/h1.h new file mode 100644 index 000000000000..2771cad12725 --- /dev/null +++ b/clang/test/dpct/header_insert_3/h1.h @@ -0,0 +1,5 @@ + +#include +#include +#include "h2.h" +#include "h3.h" diff --git a/clang/test/dpct/header_insert_3/h2.h b/clang/test/dpct/header_insert_3/h2.h new file mode 100644 index 000000000000..41fe537aac16 --- /dev/null +++ b/clang/test/dpct/header_insert_3/h2.h @@ -0,0 +1,4 @@ + +#include +#include +#include diff --git a/clang/test/dpct/header_insert_3/h3.h b/clang/test/dpct/header_insert_3/h3.h new file mode 100644 index 000000000000..017f2b32daae --- /dev/null +++ b/clang/test/dpct/header_insert_3/h3.h @@ -0,0 +1,3 @@ + +// is included after sycl.hpp +#include diff --git a/clang/test/dpct/uncanonical_path/test.cpp b/clang/test/dpct/uncanonical_path/test.cpp index a4414e407a2f..04256d8ab25b 100644 --- a/clang/test/dpct/uncanonical_path/test.cpp +++ b/clang/test/dpct/uncanonical_path/test.cpp @@ -1,10 +1,8 @@ // RUN: dpct --out-root %T/uncanonical_path %s --cuda-include-path="%cuda-path/include" -// RUN: FileCheck --input-file %T/uncanonical_path/test.cpp.dp.cpp --match-full-lines %s -// RUN: %if build_lit %{icpx -c -fsycl %T/uncanonical_path/test.cpp.dp.cpp -o %T/uncanonical_path/test.o %} +// RUN: FileCheck --input-file %T/uncanonical_path/test.cpp --match-full-lines %s +// RUN: %if build_lit %{icpx -c -fsycl %T/uncanonical_path/test.cpp -o %T/uncanonical_path/test.o %} -// CHECK: #include -// CHECK-NEXT: #include -// CHECK-NEXT: #include "../uncanonical_path//test.h" +// CHECK: #include "../uncanonical_path//test.h" #include "../uncanonical_path//test.h" int main() { diff --git a/clang/test/dpct/user_define_rule_header_order1.cu b/clang/test/dpct/user_define_rule_header_order1.cu index c2968831590a..9371e08e6b20 100644 --- a/clang/test/dpct/user_define_rule_header_order1.cu +++ b/clang/test/dpct/user_define_rule_header_order1.cu @@ -10,7 +10,7 @@ // RUN: FileCheck --input-file %T/user_define_rule_header_order1_output/user_define_rule_header_order1.dp.cpp --match-full-lines user_define_rule_header_order1.cu // RUN: %if build_lit %{icpx -c -fsycl -DNO_BUILD_TEST %T/user_define_rule_header_order1_output/user_define_rule_header_order1.dp.cpp -o %T/user_define_rule_header_order1_output/user_define_rule_header_orde1r.dp.o %} -// CHECK: #include -// CHECK: #include +// CHECK: #include +// CHECK-NEXT: #include "user_define_rule_header_order1.h" #include #include "user_define_rule_header_order1.h"