[all-commits] [llvm/llvm-project] e39bf3: [Driver] -###: exit with code 1 if hasErrorOccurred
Fangrui Song via All-commits
all-commits at lists.llvm.org
Fri Jul 28 20:31:54 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e39bf32b3bc2f0cc21d783ba789bd82553493875
https://github.com/llvm/llvm-project/commit/e39bf32b3bc2f0cc21d783ba789bd82553493875
Author: Fangrui Song <i at maskray.me>
Date: 2023-07-28 (Fri, 28 Jul 2023)
Changed paths:
M clang/lib/Driver/Driver.cpp
M clang/test/Driver/XRay/xray-instrument.c
M clang/test/Driver/aarch64-ite.c
M clang/test/Driver/aarch64-lrcpc3.c
M clang/test/Driver/aarch64-mcpu.c
M clang/test/Driver/aarch64-security-options.c
M clang/test/Driver/aarch64-sve-vector-bits.c
M clang/test/Driver/aarch64-target-as-march.s
M clang/test/Driver/aarch64-the.c
M clang/test/Driver/aix-err-options.c
M clang/test/Driver/aix-ld.c
M clang/test/Driver/aix-link-options-on-non-aix.c
M clang/test/Driver/aix-maix.c
M clang/test/Driver/aix-quadword-atomics-abi.c
M clang/test/Driver/amdgpu-hip-system-arch.c
M clang/test/Driver/amdgpu-openmp-system-arch-fail.c
M clang/test/Driver/apple-kext-mkernel.c
M clang/test/Driver/arclite-link-external-toolchain.c
M clang/test/Driver/arclite-link.c
M clang/test/Driver/arm-aarch64-bitfield-flags.c
M clang/test/Driver/arm-cmse-cve-2021-35465.c
M clang/test/Driver/arm-compiler-rt.c
M clang/test/Driver/arm-cortex-cpus-2.c
M clang/test/Driver/arm-ias-Wa.s
M clang/test/Driver/arm-implicit-it.s
M clang/test/Driver/arm-mfpu.c
M clang/test/Driver/arm-no-float-regs.c
M clang/test/Driver/arm-security-options.c
M clang/test/Driver/arm-target-as-mimplicit-it.s
M clang/test/Driver/arm-thread-pointer.c
M clang/test/Driver/avr-toolchain.c
M clang/test/Driver/cf-runtime-abi.c
M clang/test/Driver/cl-denorms-are-zero.cl
M clang/test/Driver/cl-eh.cpp
M clang/test/Driver/cl-inputs.c
M clang/test/Driver/cl-link.c
M clang/test/Driver/cl-options.c
M clang/test/Driver/cl-options.cu
M clang/test/Driver/cl-outputs.c
M clang/test/Driver/cl-pch.cpp
M clang/test/Driver/cl-zc.cpp
M clang/test/Driver/clang-translation.c
M clang/test/Driver/clang_f_opts.c
M clang/test/Driver/color-diagnostics.c
M clang/test/Driver/compiler-rt-unwind.c
M clang/test/Driver/compress-noias.c
M clang/test/Driver/compress.c
M clang/test/Driver/cuda-bad-arch.cu
M clang/test/Driver/cuda-bindings.cu
M clang/test/Driver/cuda-detect.cu
M clang/test/Driver/cuda-dwarf-2.cu
M clang/test/Driver/cuda-flush-denormals-to-zero.cu
M clang/test/Driver/cuda-march.cu
M clang/test/Driver/cuda-no-pgo-or-coverage.cu
M clang/test/Driver/cuda-no-sanitizers.cu
M clang/test/Driver/cuda-no-stack-protector.cu
M clang/test/Driver/cuda-not-found.cu
M clang/test/Driver/cuda-omp-unsupported-debug-options.cu
M clang/test/Driver/cuda-openmp-driver.cu
M clang/test/Driver/cuda-options.cu
M clang/test/Driver/cuda-output-asm.cu
M clang/test/Driver/cuda-phases.cu
M clang/test/Driver/cuda-version-check.cu
M clang/test/Driver/darwin-debug-prefix-map.c
M clang/test/Driver/darwin-debug-prefix-map.s
M clang/test/Driver/darwin-ld-platform-version-driverkit.c
M clang/test/Driver/darwin-ld.c
M clang/test/Driver/darwin-mac-catalyst-32bit-not-supported.c
M clang/test/Driver/darwin-maccatalyst.c
M clang/test/Driver/darwin-objc-runtime-maccatalyst.m
M clang/test/Driver/darwin-opt-record-ld.c
M clang/test/Driver/darwin-target-variant.c
M clang/test/Driver/darwin-version.c
M clang/test/Driver/debug-options-as.c
M clang/test/Driver/debug-options.c
M clang/test/Driver/debug-prefix-map.c
M clang/test/Driver/dwarf-target-version-clamp.cu
M clang/test/Driver/dxc_E.hlsl
M clang/test/Driver/dxc_Fo.hlsl
M clang/test/Driver/dxc_O.hlsl
M clang/test/Driver/dxc_fcgl.hlsl
M clang/test/Driver/embed-bitcode.c
M clang/test/Driver/endian.c
M clang/test/Driver/falign-loops.c
M clang/test/Driver/fast-math.c
M clang/test/Driver/fbasic-block-sections.c
M clang/test/Driver/fcs-profile-generate.c
M clang/test/Driver/fexcess-precision.c
M clang/test/Driver/flang/flang.f90
M clang/test/Driver/flang/flang_ucase.F90
M clang/test/Driver/fmemprof.cpp
M clang/test/Driver/fmessage-length.c
M clang/test/Driver/frame-pointer-elim.c
M clang/test/Driver/frame-pointer-elim.cl
M clang/test/Driver/fsanitize-address-destructor.c
M clang/test/Driver/fsanitize-coverage.c
M clang/test/Driver/fsanitize-ignorelist.c
M clang/test/Driver/fsanitize-metadata.c
M clang/test/Driver/fsanitize-use-after-return.c
M clang/test/Driver/fsanitize.c
M clang/test/Driver/fuchsia.c
M clang/test/Driver/fuchsia.cpp
M clang/test/Driver/function-alignment.c
M clang/test/Driver/fuse-ld.c
M clang/test/Driver/gcc-install-dir.cpp
M clang/test/Driver/gcc_forward.c
M clang/test/Driver/hexagon-hvx-ieee-fp.c
M clang/test/Driver/hexagon-hvx-qfloat.c
M clang/test/Driver/hexagon-hvx.c
M clang/test/Driver/hexagon-toolchain-elf.c
M clang/test/Driver/hip-autolink.hip
M clang/test/Driver/hip-binding.hip
M clang/test/Driver/hip-code-object-version.hip
M clang/test/Driver/hip-cuid-hash.hip
M clang/test/Driver/hip-cuid.hip
M clang/test/Driver/hip-default-gpu-arch.hip
M clang/test/Driver/hip-dependent-options.hip
M clang/test/Driver/hip-device-compile.hip
M clang/test/Driver/hip-device-libs.hip
M clang/test/Driver/hip-host-cpu-features.hip
M clang/test/Driver/hip-launch-api.hip
M clang/test/Driver/hip-link-bc-to-bc.hip
M clang/test/Driver/hip-link-bundle-archive.hip
M clang/test/Driver/hip-no-device-libs.hip
M clang/test/Driver/hip-options.hip
M clang/test/Driver/hip-output-file-name.hip
M clang/test/Driver/hip-printf.hip
M clang/test/Driver/hip-rdc-device-only.hip
M clang/test/Driver/hip-sanitize-options.hip
M clang/test/Driver/hip-save-temps.hip
M clang/test/Driver/hip-std.hip
M clang/test/Driver/hip-syntax-only.hip
M clang/test/Driver/hip-target-id.hip
M clang/test/Driver/hip-toolchain-dwarf.hip
M clang/test/Driver/hip-toolchain-features.hip
M clang/test/Driver/hip-toolchain-mllvm.hip
M clang/test/Driver/hip-toolchain-opt.hip
M clang/test/Driver/hipspv-pass-plugin.hip
M clang/test/Driver/ibm-profiling.c
M clang/test/Driver/invalid-offload-options.cpp
M clang/test/Driver/ld-path.c
M clang/test/Driver/linux-ld.c
M clang/test/Driver/loongarch-mfpu-error.c
M clang/test/Driver/lto.cu
M clang/test/Driver/macho-embedded.c
M clang/test/Driver/masm.c
M clang/test/Driver/masm.s
M clang/test/Driver/mbackchain.c
M clang/test/Driver/mbig-obj.c
M clang/test/Driver/mcount.c
M clang/test/Driver/mdefault-visibility-export-mapping.c
M clang/test/Driver/mdouble.c
M clang/test/Driver/memtag-ld.c
M clang/test/Driver/mfentry.c
M clang/test/Driver/miamcu-opt.c
M clang/test/Driver/miamcu-opt.cpp
M clang/test/Driver/mingw-cfguard.c
M clang/test/Driver/mips-indirect-branch.c
M clang/test/Driver/mlong-double-128.c
M clang/test/Driver/mlong-double-64.c
M clang/test/Driver/module-output.cppm
M clang/test/Driver/modules.m
M clang/test/Driver/mprefer-vector-width.c
M clang/test/Driver/mrecip.c
M clang/test/Driver/msp430-hwmult.c
M clang/test/Driver/msp430-mmcu.c
M clang/test/Driver/munaligned-access-unused.c
M clang/test/Driver/myriad-toolchain.c
M clang/test/Driver/native-llvm.c
M clang/test/Driver/no-integrated-as-win.c
M clang/test/Driver/no-integrated-as.c
M clang/test/Driver/nvptx-cuda-system-arch.c
M clang/test/Driver/objc-weak.m
M clang/test/Driver/offloading-interoperability.c
M clang/test/Driver/ohos.c
M clang/test/Driver/ohos.cpp
M clang/test/Driver/opencl.cl
M clang/test/Driver/openmp-offload-gpu.c
M clang/test/Driver/openmp-offload-infer.c
M clang/test/Driver/openmp-offload-jit.c
M clang/test/Driver/openmp-offload.c
M clang/test/Driver/openmp-system-arch.c
M clang/test/Driver/opt-record.c
M clang/test/Driver/p.c
M clang/test/Driver/pic.c
M clang/test/Driver/ppc-cpus.c
M clang/test/Driver/ppc-features.cpp
M clang/test/Driver/ppc-roptr.c
M clang/test/Driver/preserve-uselistorder.c
M clang/test/Driver/ps4-pic.c
M clang/test/Driver/ps4-ps5-linker-non-win.c
M clang/test/Driver/ps4ps5base.c
M clang/test/Driver/ps5-pic.c
M clang/test/Driver/response-file-errs.c
M clang/test/Driver/riscv-abi.c
M clang/test/Driver/riscv-arch.c
M clang/test/Driver/riscv-cpus.c
M clang/test/Driver/riscv-rvv-vector-bits.c
M clang/test/Driver/rocm-detect.cl
M clang/test/Driver/rocm-detect.hip
M clang/test/Driver/rocm-not-found.cl
M clang/test/Driver/ropi-rwpi.c
M clang/test/Driver/rtti-options.cpp
M clang/test/Driver/sanitizer-ld.c
M clang/test/Driver/save-stats.c
M clang/test/Driver/sls-hardening-options.c
M clang/test/Driver/sparc-float.c
M clang/test/Driver/sparc-march.c
M clang/test/Driver/split-debug.c
M clang/test/Driver/split-lto-unit.c
M clang/test/Driver/stack-protector-guard.c
M clang/test/Driver/symbol-partition.c
M clang/test/Driver/systemz-float-01.c
M clang/test/Driver/thread-model.c
M clang/test/Driver/unknown-arg.c
M clang/test/Driver/virtual-function-elimination.cpp
M clang/test/Driver/wasm-toolchain.c
M clang/test/Driver/whole-program-vtables.c
M clang/test/Driver/windows-cross.c
M clang/test/Driver/windows-macho.c
M clang/test/Driver/windows-pic.cpp
M clang/test/Driver/windows-thumbv7em.cpp
M clang/test/Driver/working-directory.c
M clang/test/Driver/x86-mabi.c
M clang/test/Driver/x86-malign-branch.c
M clang/test/Driver/x86-target-features.c
M clang/test/Driver/xcoff-build-id.c
M clang/test/OpenMP/linking.c
M clang/test/Preprocessor/aarch64-target-features.c
Log Message:
-----------
[Driver] -###: exit with code 1 if hasErrorOccurred
The exit code for -### is inconsistent. Unrecognized options lead to
exit code 1, as expected. However, most others errors (including invalid
option value) lead to exit code 0, differing from GCC and most utilities.
This is a longstanding quirk of -###, and we didn't fix it because many
driver tests need adjustment.
Change -### to be similar to -fdriver-only -v and exit with code 1.
This requires fixing many driver tests, but the end result gives us
stronger tests.
* Existing `RUN: %clang -### ...` tests usually don't use `CHECK-NOT: error:` or `--implicit-check-not=error:`.
If a change introduces an error, such a change usually cannot be detected.
* Many folks contributing new tests don't know `-fdriver-only -v`.
To test no driver error/warning for new tests, they can use the familiar `-### -Werror`
instead of `-fdriver-only -v -Werror`.
Reviewed By: jhuber6, yaxunl, dblaikie
Differential Revision: https://reviews.llvm.org/D156363
More information about the All-commits
mailing list