Skip to content

Commit afa76fe

Browse files
author
Chen Zheng
committed
[XCOFF][DWARF] set default DWARF version to 3.
Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D98010
1 parent ef3e4b3 commit afa76fe

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

clang/lib/Driver/ToolChains/AIX.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class LLVM_LIBRARY_VISIBILITY AIX : public ToolChain {
7474

7575
RuntimeLibType GetDefaultRuntimeLibType() const override;
7676

77+
// Set default DWARF version to 3 for now as latest AIX OS supports version 3.
78+
unsigned GetDefaultDwarfVersion() const override { return 3; }
79+
7780
protected:
7881
Tool *buildAssembler() const override;
7982
Tool *buildLinker() const override;

clang/test/CodeGen/dwarf-version.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
// Explicitly request both.
3333
// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \
3434
// RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
35+
// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
36+
// RUN: FileCheck %s --check-prefix=VER3
37+
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \
38+
// RUN: FileCheck %s --check-prefix=VER2
39+
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \
40+
// RUN: FileCheck %s --check-prefix=VER3
41+
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \
42+
// RUN: FileCheck %s --check-prefix=VER4
43+
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \
44+
// RUN: FileCheck %s --check-prefix=VER5
45+
3546
int main (void) {
3647
return 0;
3748
}

0 commit comments

Comments
 (0)