Index: cfe/trunk/lib/Driver/ToolChains.h =================================================================== --- cfe/trunk/lib/Driver/ToolChains.h +++ cfe/trunk/lib/Driver/ToolChains.h @@ -943,6 +943,7 @@ public: AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args); + unsigned GetDefaultDwarfVersion() const override { return 2; } bool IsIntegratedAssemblerDefault() const override { return true; } }; Index: cfe/trunk/test/Driver/amdgpu-toolchain.c =================================================================== --- cfe/trunk/test/Driver/amdgpu-toolchain.c +++ cfe/trunk/test/Driver/amdgpu-toolchain.c @@ -1,3 +1,6 @@ // RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s // AS_LINK: clang{{.*}} "-cc1as" // AS_LINK: ld.lld{{.*}} "-shared" + +// RUN: %clang -### -g -target amdgcn--amdhsa -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s +// DWARF_VER: "-dwarf-version=2"