Files
llvm-mirror/test/Demangle/rust.test
T
Tomasz Miąsko 46d5d397d9 [demangler] Initial support for the new Rust mangling scheme
Add a demangling support for a small subset of a new Rust mangling
scheme, with complete support planned as a follow up work.

Intergate Rust demangling into llvm-cxxfilt and use llvm-cxxfilt for
end-to-end testing. The new Rust mangling scheme uses "_R" as a prefix,
which makes it easy to disambiguate it from other mangling schemes.

The public API is modeled after __cxa_demangle / llvm::itaniumDemangle,
since potential candidates for further integration use those.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D101444
2021-05-03 16:44:30 -07:00

44 lines
804 B
Plaintext

RUN: llvm-cxxfilt -n < %s | FileCheck --match-full-lines %s
CHECK: a::main
_RNvC1a4main
CHECK: hello::rust
_RNvCshGpAVYOtgW1_5hello4rust
CHECK: a::b::c
_RNvNvC1a1b1c
; Invalid mangled characters
CHECK: _RNvC2a.1c
_RNvC2a.1c
CHECK: _RNvC2a$1c
_RNvC2a$1c
; Invalid identifier length (UINT64_MAX + 3, which happens to be ok after a wraparound).
CHECK: _RNvC2ab18446744073709551618xy
_RNvC2ab18446744073709551618xy
; Mangling scheme includes an optional encoding version. When present it would
; indicate an encoding we don't support yet. Check that it is rejected:
CHECK: _R0NvC1a4main
_R0NvC1a4main
; Early EOF
CHECK: _RNv
_RNv
CHECK: _RNvC
_RNvC
CHECK: _RNvC1a5main
_RNvC1a5main
CHECK: _RNvC1a20abc
_RNvC1a20abc