tests: check that clang uses dwarfv4 by default
This commit is contained in:
parent
c00fbc715c
commit
a52939e013
20
tests/use-dwarf4-by-default/main.fmf
Normal file
20
tests/use-dwarf4-by-default/main.fmf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
summary: Test that clang uses DWARFv4 by default
|
||||||
|
test: "$WITH_SCL ./test.sh"
|
||||||
|
require:
|
||||||
|
- libgcc
|
||||||
|
adjust:
|
||||||
|
# Common requirements when LLVM is not SCL-ized
|
||||||
|
- require+:
|
||||||
|
- clang
|
||||||
|
- llvm
|
||||||
|
when: "collection is not defined"
|
||||||
|
|
||||||
|
# Requirements for SCL-ized LLVM
|
||||||
|
- require+:
|
||||||
|
- llvm-toolset-13.0-clang
|
||||||
|
- llvm-toolset-13.0-llvm
|
||||||
|
when: "collection == llvm-toolset-13.0"
|
||||||
|
- require+:
|
||||||
|
- llvm-toolset-14.0-clang
|
||||||
|
- llvm-toolset-14.0-llvm
|
||||||
|
when: "collection == llvm-toolset-14.0"
|
7
tests/use-dwarf4-by-default/test.sh
Executable file
7
tests/use-dwarf4-by-default/test.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh -eux
|
||||||
|
|
||||||
|
echo "int main(){ return 0; }" | clang -g -v -x c - 2> build.log
|
||||||
|
# Make sure that clang is using the expected flag to use DWARF 4
|
||||||
|
grep -q "\-dwarf-version=4" build.log
|
||||||
|
# Inspect the binary to double check expected DWARF version
|
||||||
|
llvm-dwarfdump a.out | grep -i version | grep 0x0004
|
Loading…
Reference in New Issue
Block a user