tests: check that clang uses dwarfv4 by default

This commit is contained in:
Jesus Checa Hidalgo 2022-05-03 13:55:08 +02:00
parent c00fbc715c
commit a52939e013
2 changed files with 27 additions and 0 deletions

View 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"

View 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