File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -1944,15 +1944,12 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1944
1944
llvm::outs () << " Emitting help information for " << std::get<1 >(HA) << ' \n '
1945
1945
<< " Use triple of '" << std::get<0 >(HA).normalize () <<
1946
1946
" ' to enable ahead of time compilation\n " ;
1947
+ // Flush out the buffer before calling the external tool.
1948
+ llvm::outs ().flush ();
1947
1949
std::vector<StringRef> ToolArgs = {std::get<1 >(HA), std::get<2 >(HA),
1948
1950
std::get<3 >(HA)};
1949
1951
SmallString<128 > ExecPath (
1950
1952
C.getDefaultToolChain ().GetProgramPath (std::get<1 >(HA).data ()));
1951
- auto ToolBinary = llvm::sys::findProgramByName (ExecPath);
1952
- if (ToolBinary.getError ()) {
1953
- C.getDriver ().Diag (diag::err_drv_command_failure) << ExecPath;
1954
- continue ;
1955
- }
1956
1953
// do not run the tools with -###.
1957
1954
if (C.getArgs ().hasArg (options::OPT__HASH_HASH_HASH)) {
1958
1955
llvm::errs () << " \" " << ExecPath << " \" \" " << ToolArgs[1 ] << " \" " ;
@@ -1961,6 +1958,11 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1961
1958
llvm::errs () << " \n " ;
1962
1959
continue ;
1963
1960
}
1961
+ auto ToolBinary = llvm::sys::findProgramByName (ExecPath);
1962
+ if (ToolBinary.getError ()) {
1963
+ C.getDriver ().Diag (diag::err_drv_command_failure) << ExecPath;
1964
+ continue ;
1965
+ }
1964
1966
// Run the Tool.
1965
1967
llvm::sys::ExecuteAndWait (ToolBinary.get (), ToolArgs);
1966
1968
}
Original file line number Diff line number Diff line change 97
97
// SYCL-HELP-BADARG: unsupported argument 'foo' to option 'fsycl-help='
98
98
// SYCL-HELP-GEN: Emitting help information for ocloc
99
99
// SYCL-HELP-GEN: Use triple of 'spir64_gen-unknown-unknown' to enable ahead of time compilation
100
- // SYCL-HELP-FPGA-OUT: "[[DIR]]{{[/\\]+}}aoc" "-help" "-sycl"
101
100
// SYCL-HELP-FPGA: Emitting help information for aoc
102
101
// SYCL-HELP-FPGA: Use triple of 'spir64_fpga-unknown-unknown' to enable ahead of time compilation
102
+ // SYCL-HELP-FPGA-OUT: "[[DIR]]{{[/\\]+}}aoc" "-help" "-sycl"
103
103
// SYCL-HELP-CPU: Emitting help information for opencl-aot
104
104
// SYCL-HELP-CPU: Use triple of 'spir64_x86_64-unknown-unknown' to enable ahead of time compilation
105
105
106
+ // -fsycl-help redirect to file should retain proper information ordering
107
+ // RUN: %clang -### -fsycl-help %s > %t.help-out 2>&1
108
+ // RUN: FileCheck %s -check-prefix SYCL_HELP_ORDER --input-file=%t.help-out
109
+ // SYCL_HELP_ORDER: Emitting help information for ocloc
110
+ // SYCL_HELP_ORDER: ocloc{{(\.exe)?}}" "--help"
111
+ // SYCL_HELP_ORDER: Emitting help information for aoc
112
+ // SYCL_HELP_ORDER: aoc{{(\.exe)?}}" "-help" "-sycl"
113
+ // SYCL_HELP_ORDER: Emitting help information for opencl-aot
114
+ // SYCL_HELP_ORDER: opencl-aot{{(\.exe)?}}" "--help"
115
+
106
116
// -fsycl-id-queries-fit-in-int
107
117
// RUN: %clang -### -fsycl -fsycl-id-queries-fit-in-int %s 2>&1 | FileCheck %s --check-prefix=ID_QUERIES
108
118
// RUN: %clang_cl -### -fsycl -fsycl-id-queries-fit-in-int %s 2>&1 | FileCheck %s --check-prefix=ID_QUERIES
You can’t perform that action at this time.
0 commit comments