File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2116,8 +2116,12 @@ unsigned tools::getDwarfVersion(const ToolChain &TC,
2116
2116
const llvm::opt::ArgList &Args) {
2117
2117
unsigned DwarfVersion = ParseDebugDefaultVersion (TC, Args);
2118
2118
if (const Arg *GDwarfN = getDwarfNArg (Args))
2119
- if (int N = DwarfVersionNum (GDwarfN->getSpelling ()))
2119
+ if (int N = DwarfVersionNum (GDwarfN->getSpelling ())) {
2120
2120
DwarfVersion = N;
2121
+ if (DwarfVersion == 5 && TC.getTriple ().isOSAIX ())
2122
+ TC.getDriver ().Diag (diag::err_drv_unsupported_opt_for_target)
2123
+ << GDwarfN->getSpelling () << TC.getTriple ().str ();
2124
+ }
2121
2125
if (DwarfVersion == 0 ) {
2122
2126
DwarfVersion = TC.GetDefaultDwarfVersion ();
2123
2127
assert (DwarfVersion && " toolchain default DWARF version must be nonzero" );
Original file line number Diff line number Diff line change 46
46
// RUN: FileCheck %s --check-prefix=VER3
47
47
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \
48
48
// RUN: FileCheck %s --check-prefix=VER4
49
- // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \
50
- // RUN: FileCheck %s --check-prefix=VER5
49
+ // RUN: not %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s 2>&1 | \
50
+ // RUN: FileCheck %s --check-prefix=UNSUPPORTED-VER5
51
+ // RUN: not %clang -target powerpc64-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s 2>&1| \
52
+ // RUN: FileCheck %s --check-prefix=UNSUPPORTED-VER5
51
53
52
54
int main (void ) {
53
55
return 0 ;
@@ -59,6 +61,7 @@ int main (void) {
59
61
// VER3: !{i32 7, !"Dwarf Version", i32 3}
60
62
// VER4: !{i32 7, !"Dwarf Version", i32 4}
61
63
// VER5: !{i32 7, !"Dwarf Version", i32 5}
64
+ // UNSUPPORTED-VER5: error: unsupported option '-gdwarf-5'
62
65
63
66
// NODWARF-NOT: !"Dwarf Version"
64
67
// CODEVIEW: !{i32 2, !"CodeView", i32 1}
You can’t perform that action at this time.
0 commit comments