diff --git a/clang/lib/Driver/ToolChains/AIX.h b/clang/lib/Driver/ToolChains/AIX.h --- a/clang/lib/Driver/ToolChains/AIX.h +++ b/clang/lib/Driver/ToolChains/AIX.h @@ -74,6 +74,9 @@ RuntimeLibType GetDefaultRuntimeLibType() const override; + // Set default DWARF version to 3 for now as latest AIX OS supports version 3. + unsigned GetDefaultDwarfVersion() const override { return 3; } + protected: Tool *buildAssembler() const override; Tool *buildLinker() const override; diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c --- a/clang/test/CodeGen/dwarf-version.c +++ b/clang/test/CodeGen/dwarf-version.c @@ -32,6 +32,17 @@ // Explicitly request both. // RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \ // RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW +// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefix=VER3 +// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefix=VER2 +// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefix=VER3 +// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefix=VER4 +// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \ +// RUN: FileCheck %s --check-prefix=VER5 + int main (void) { return 0; }