Page MenuHomePhabricator

[Clang test] Update to allow passing extra default clang arguments in use_clang

Authored by guiand on Aug 11 2020, 2:35 PM.



Prerequisite to a later patch that will add a default codegen option to the tests, for the sake of allowing clang to emit noundef without requiring changes to (nearly) every codegen test.

This adds a new clang substitution, '%clang_bin', that expands to the clang binary
with no extra arguments appended. This allows us
to replace uses of '%clang' where it's precisely required to use the pure binary,
and enables adding additional_flags to the test corpus.

Diff Detail

Unit TestsFailed

140 mswindows >
Script: -- : 'RUN: at line 7'; sed -e "s,SRC_COMPDIR,/Inputs,g" C:\ws\w16n2-1\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\X86/Inputs/source-interleave.ll > C:\ws\w16n2-1\llvm-project\premerge-checks\build\test\tools\llvm-objdump\X86\Output\source-interleave-prefix-windows.test.tmp.ll
160 mswindows >
Script: -- : 'RUN: at line 5'; sed -e "s,SRC_COMPDIR,./Inputs,g" C:\ws\w16n2-1\llvm-project\premerge-checks\llvm\test\tools\llvm-objdump\X86/Inputs/source-interleave.ll > C:\ws\w16n2-1\llvm-project\premerge-checks\build\test\tools\llvm-objdump\X86\Output\source-interleave-prefix.test.tmp-relative-path.ll

Event Timeline

guiand created this revision.Aug 11 2020, 2:35 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 11 2020, 2:35 PM
guiand requested review of this revision.Aug 11 2020, 2:35 PM
guiand updated this revision to Diff 284929.Aug 11 2020, 4:18 PM

Allows passing different extra arguments for different clang expansions

eugenis updated this revision to Diff 298693.Oct 16 2020, 11:35 AM

update tests

This revision is now accepted and ready to land.Oct 16 2020, 11:38 AM

Did we decide that we wanted this change then? I remember there being discussion around whether it's the right approach.

I don't like the %clang_bin substitution - imho it's unclear for the test authors when to use it instead of %clang, but I can't come up with a better idea.

Is it true that %clang_bin is only necessary when the automatically added -disable-noundef-analysis flag triggers an unused argument warning, or are there other reasons?

I wonder it can be avoided by

  • disable noundef analysis by default in cc1
  • always add -enable-noundef-analysis in the driver when invoking cc1