mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 20:04:03 +00:00
llvm-undname: More no-op changes to increase test coverage
- Add test coverage around invalid anon namespaces and for error paths in demanglePrimitiveType() and in demangleFullyQualifiedTypeName() - Use DEMANGLE_UNREACHABLE in two more unreachable places llvm-svn: 362514
This commit is contained in:
parent
e5b1b0458e
commit
715df35aef
@ -238,10 +238,10 @@ demanglePointerCVQualifiers(StringView &MangledName) {
|
||||
case 'S':
|
||||
return std::make_pair(Qualifiers(Q_Const | Q_Volatile),
|
||||
PointerAffinity::Pointer);
|
||||
default:
|
||||
assert(false && "Ty is not a pointer type!");
|
||||
}
|
||||
return std::make_pair(Q_None, PointerAffinity::Pointer);
|
||||
// This function is only called if isPointerType() returns true,
|
||||
// and it only returns true for the six cases listed above.
|
||||
DEMANGLE_UNREACHABLE;
|
||||
}
|
||||
|
||||
StringView Demangler::copyString(StringView Borrowed) {
|
||||
@ -1694,7 +1694,7 @@ CallingConv Demangler::demangleCallingConvention(StringView &MangledName) {
|
||||
}
|
||||
|
||||
StorageClass Demangler::demangleVariableStorageClass(StringView &MangledName) {
|
||||
assert(std::isdigit(MangledName.front()));
|
||||
assert(MangledName.front() >= '0' && MangledName.front() <= '4');
|
||||
|
||||
switch (MangledName.popFront()) {
|
||||
case '0':
|
||||
@ -1708,8 +1708,7 @@ StorageClass Demangler::demangleVariableStorageClass(StringView &MangledName) {
|
||||
case '4':
|
||||
return StorageClass::FunctionLocalStatic;
|
||||
}
|
||||
Error = true;
|
||||
return StorageClass::None;
|
||||
DEMANGLE_UNREACHABLE;
|
||||
}
|
||||
|
||||
std::pair<Qualifiers, bool>
|
||||
|
@ -249,3 +249,28 @@
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?x@@3PEAY02$$CRHEA
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
?foo@@3_
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?foo@@3_
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
?foo@@3_XA
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?foo@@3_XA
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
?foo@@3Vbar
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?foo@@3Vbar
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
?foo@@3Vbar@
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?foo@@3Vbar@
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
?foo@?A
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?foo@?A
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
Loading…
Reference in New Issue
Block a user