[PATCH] D92617: [DWARF] Allow toolchain to adjust specified DWARF version.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 12:57:05 PST 2020


tra added inline comments.


================
Comment at: clang/test/Driver/cuda-unsupported-debug-options.cu:18
+// RUN: %clang -### -target x86_64-linux-gnu -c %s -gdwarf-5 -gembed-source 2>&1 | FileCheck %s --check-prefix=DWARF-CLAMP
+// CHECK: debug information option '{{-gz|-fdebug-info-for-profiling|-gsplit-dwarf|-glldb|-gcodeview|-gmodules|-gembed-source|-fdebug-macro|-ggnu-pubnames|-gdwarf-aranges|-fdebug-types-section}}' is not supported{{.*}} target 'nvptx64-nvidia-cuda'
 // CHECK-NOT: debug information option '{{.*}}' is not supported for target 'x86
----------------
dblaikie wrote:
> tra wrote:
> > dblaikie wrote:
> > > What's the purpose of the {{.*}} in this line? 
> > The wildcard eats the differences between two warnings -- a generic one:
> >  - `warning: debug information option '-glldb' is not supported for target 'nvptx64-nvidia-cuda'` 
> > and the more specific one for `-gembed-source` : 
> >  - `warning: debug information option '-gembed-source' is not supported. It needs DWARF-5 but target 'nvptx64-nvidia-cuda' only provides DWARF-2.`
> > 
> > 
> Is that necessary? Or is the -gembed-source+CHECK test redundant with/less precise than the -gembed-source+DWARF-CLAMP test? (ie: would it be effective (not a loss in test coverage) to remove the gembed-source+CHECK test and only have the gembed-source+DWARF-CLAMP test, and keep the CHECK line precise as it was before for all the CHECK tests)
> 
> Effectively: Rather than adding a new RUN line, and generalizing the CHECK over the new/old message and checking the new message separately - instead, change the existing gembed-source test to use DWARF-CLAMP instead of CHECK, and leave everything the same?
`CHECK` lines test that an option was ignored for the right target (nvptx, not x86). So, both warning variants should participate.

`DWARF-CLAMP` verify that the correct DWARF version was used.

`-gembed-source` shoud participate in both tests. The options here is to either include `-gembed-source` in the `CHECK` tests and make it accept both pattern variants, or replicate the `target of the warning` check within DWARF-CLAMP.

I would prefer to keep these two kinds of tests separate.

I've just updated the patch and moved DWARF clamping tests into a separate file and consolidated nearly-identical cuda/omp unsupported option warnings tests into the same file.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92617/new/

https://reviews.llvm.org/D92617



More information about the cfe-commits mailing list