[X86] IsNOT - don't fold not(pcmpgt(C1, C2)) -> pcmpgt(C2, C1 - 1)
[llvm-project.git] / llvm / unittests / Demangle / DemangleTest.cpp
blobe60a75ecd76da26bac032f36983092d8ef50fd27
1 //===-- DemangleTest.cpp --------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/Demangle/Demangle.h"
10 #include "gmock/gmock.h"
12 using namespace llvm;
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");
24 EXPECT_EQ(demangle("_RNvC3foo3bar"), "foo::bar");
25 EXPECT_EQ(demangle("__RNvC3foo3bar"), "foo::bar");
26 EXPECT_EQ(demangle("_Dmain"), "D main");
28 // Regression test for demangling of optional template-args for vendor
29 // extended type qualifier (https://bugs.llvm.org/show_bug.cgi?id=48009)
30 EXPECT_EQ(demangle("_Z3fooILi79EEbU7_ExtIntIXT_EEi"),
31 "bool foo<79>(int _ExtInt<79>)");