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 @@ -1938,15 +1938,12 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1938
1938
llvm::outs () << " Emitting help information for " << std::get<1 >(HA) << ' \n '
1939
1939
<< " Use triple of '" << std::get<0 >(HA).normalize () <<
1940
1940
" ' to enable ahead of time compilation\n " ;
1941
+ // Flush out the buffer before calling the external tool.
1942
+ llvm::outs ().flush ();
1941
1943
std::vector<StringRef> ToolArgs = {std::get<1 >(HA), std::get<2 >(HA),
1942
1944
std::get<3 >(HA)};
1943
1945
SmallString<128 > ExecPath (
1944
1946
C.getDefaultToolChain ().GetProgramPath (std::get<1 >(HA).data ()));
1945
- auto ToolBinary = llvm::sys::findProgramByName (ExecPath);
1946
- if (ToolBinary.getError ()) {
1947
- C.getDriver ().Diag (diag::err_drv_command_failure) << ExecPath;
1948
- continue ;
1949
- }
1950
1947
// do not run the tools with -###.
1951
1948
if (C.getArgs ().hasArg (options::OPT__HASH_HASH_HASH)) {
1952
1949
llvm::errs () << " \" " << ExecPath << " \" \" " << ToolArgs[1 ] << " \" " ;
@@ -1955,6 +1952,11 @@ void Driver::PrintSYCLToolHelp(const Compilation &C) const {
1955
1952
llvm::errs () << " \n " ;
1956
1953
continue ;
1957
1954
}
1955
+ auto ToolBinary = llvm::sys::findProgramByName (ExecPath);
1956
+ if (ToolBinary.getError ()) {
1957
+ C.getDriver ().Diag (diag::err_drv_command_failure) << ExecPath;
1958
+ continue ;
1959
+ }
1958
1960
// Run the Tool.
1959
1961
llvm::sys::ExecuteAndWait (ToolBinary.get (), ToolArgs);
1960
1962
}
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" "--help"
111
+ // SYCL_HELP_ORDER: Emitting help information for aoc
112
+ // SYCL_HELP_ORDER: aoc" "-help" "-sycl"
113
+ // SYCL_HELP_ORDER: Emitting help information for opencl-aot
114
+ // SYCL_HELP_ORDER: opencl-aot" "--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