1 //===-- DemangleTest.cpp --------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/Demangle/Demangle.h"
10 #include "gmock/gmock.h"
14 TEST(Demangle
, demangleTest
) {
15 EXPECT_EQ(demangle("_"), "_");
16 EXPECT_EQ(demangle("_Z3fooi"), "foo(int)");
17 EXPECT_EQ(demangle("__Z3fooi"), "foo(int)");
18 EXPECT_EQ(demangle("___Z3fooi_block_invoke"),
19 "invocation function for block in foo(int)");
20 EXPECT_EQ(demangle("____Z3fooi_block_invoke"),
21 "invocation function for block in foo(int)");
22 EXPECT_EQ(demangle("?foo@@YAXH@Z"), "void __cdecl foo(int)");
23 EXPECT_EQ(demangle("foo"), "foo");