[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 6 16:31:42 PST 2017
tra added a comment.
In https://reviews.llvm.org/D39502#917267, @steven_wu wrote:
> Improve testcase according to review feedback.
> In order to let compilation to be successful for one input, I need to use
> -fsyntax-only because I don't have nvptx assembler. Enable -fsyntax-only
> changes the order of the compilation somehow so I need to reorder the
> errors and warnings a little bit.
Right. With -fsyntax-only host compilation no longer depends on device-side binary. You may want to add a comment in the test explaining peculiar order of checks.
Comment at: test/Driver/cuda-bail-out.cu:47
+// CHECK-HOST-ERROR: Error during compilation for host
+// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35
To make it more robust, I'd add another copy of the last line before CHECK-HOST-ERROR: so it would catch device-side errors if they were to happen ahead of the host.
Generally speaking, expected behavior is "I want to see an error from one compilation only". We don't really care which CUDA compilation phase produces it. Perhaps all we need in all test cases is:
CHECK: Error during compilation
CHECK-NOT: Error during compilation
This way we don't need to depend on specific phase order.
More information about the cfe-commits