]> granicus.if.org Git - clang/commit
Driver must return non-zero code on errors in command line
authorSerge Pavlov <sepavloff@gmail.com>
Wed, 24 May 2017 14:57:17 +0000 (14:57 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 24 May 2017 14:57:17 +0000 (14:57 +0000)
commit4e7d2c5899111acfe11abe83878e59ff6ae1cae7
treec4ab8d8d6a62ecde77a5ed42f57fd3856b86a228
parent1ec9218f787b092c64791059904c2c51c4cd798c
Driver must return non-zero code on errors in command line

This is recommit of r302775, reverted in r302777 due to a fail in
clang-tidy. Original mesage is below.

Now if clang driver is given wrong arguments, in some cases it
continues execution and returns zero code. This change fixes this
behavior.

The fix revealed some errors in clang test set.

File test/Driver/gfortran.f90 added in r118203 checks forwarding
gfortran flags to GCC. Now driver reports error on this file, because
the option -working-directory implemented in clang differs from the
option with the same name implemented in gfortran, in clang the option
requires argument, in gfortran does not.

In the file test/Driver/arm-darwin-builtin.c clang is called with
options -fbuiltin-strcat and -fbuiltin-strcpy. These option were removed
in r191435 and now clang reports error on this test.

File arm-default-build-attributes.s uses option -verify, which is not
supported by driver, it is cc1 option.

Similarly, the file split-debug.h uses options -fmodules-embed-all-files
and -fmodule-format=obj, which are not supported by driver.

Other revealed errors are mainly mistypes.

Differential Revision: https://reviews.llvm.org/D33013

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303756 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
lib/Driver/Driver.cpp
test/Driver/aarch64-cpus.c
test/Driver/amdgpu-features.c
test/Driver/arm-darwin-builtin.c [deleted file]
test/Driver/arm-default-build-attributes.s
test/Driver/cl-outputs.c
test/Driver/clang_f_opts.c
test/Driver/cuda-external-tools.cu
test/Driver/debug-options.c
test/Driver/gfortran.f90
test/Driver/split-debug.h
test/Driver/unknown-arg.c
test/Index/index-attrs.c
test/Index/index-attrs.cpp
tools/driver/driver.cpp
unittests/Driver/ToolChainTest.cpp