================ @@ -51,6 +51,16 @@ // RUN: not %clang -target powerpc64-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s 2>&1| \ // RUN: FileCheck %s --check-prefix=UNSUPPORTED-VER5 +// Check what version of dwarf is used to emit debug info when compiling ir with clang. +// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s \ +// RUN: | %clang -target x86_64-linux-gnu -gdwarf-4 -x ir -c -o - - \ +// RUN: | llvm-dwarfdump -v - \ +// RUN: | FileCheck %s --check-prefix=SINGLE-4 +// RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s \ +// RUN: | %clang -target x86_64-linux-gnu -g -x ir -c -o - - \ +// RUN: | llvm-dwarfdump -v - \ +// RUN: | FileCheck %s --check-prefix=SINGLE-5 ---------------- efriedma-quic wrote:
Is this actually the behavior we want? Normally, I'd expect bitcode files to already have a version specified; when clang generates LLVM IR, it generates the DWARF version as metadata. This patch explicitly overrides that version in favor of whatever is specified on the command-line when the bitcode is lowered to asm. Overriding the version won't really work right, anyway: clang generates different debug info depending on the version it's targeting. https://github.com/llvm/llvm-project/pull/146666 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits