mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 10:01:42 +00:00
Decl printing: add tests for typedefs
Patch by Konrad Kleine. llvm-svn: 202709
This commit is contained in:
parent
530fb9414b
commit
5ea34fcc8d
@ -170,6 +170,40 @@ public:
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
TEST(DeclPrinter, TestTypedef1) {
|
||||
ASSERT_TRUE(PrintedDeclCXX98Matches(
|
||||
"typedef int A;",
|
||||
"A",
|
||||
"typedef int A"));
|
||||
// Should be: with semicolon
|
||||
}
|
||||
|
||||
TEST(DeclPrinter, TestTypedef2) {
|
||||
ASSERT_TRUE(PrintedDeclCXX98Matches(
|
||||
"typedef const char *A;",
|
||||
"A",
|
||||
"typedef const char *A"));
|
||||
// Should be: with semicolon
|
||||
}
|
||||
|
||||
TEST(DeclPrinter, TestTypedef3) {
|
||||
ASSERT_TRUE(PrintedDeclCXX98Matches(
|
||||
"template <typename Y> class X {};"
|
||||
"typedef X<int> A;",
|
||||
"A",
|
||||
"typedef X<int> A"));
|
||||
// Should be: with semicolon
|
||||
}
|
||||
|
||||
TEST(DeclPrinter, TestTypedef4) {
|
||||
ASSERT_TRUE(PrintedDeclCXX98Matches(
|
||||
"namespace X { class Y {}; }"
|
||||
"typedef X::Y A;",
|
||||
"A",
|
||||
"typedef X::Y A"));
|
||||
// Should be: with semicolon
|
||||
}
|
||||
|
||||
TEST(DeclPrinter, TestNamespace1) {
|
||||
ASSERT_TRUE(PrintedDeclCXX98Matches(
|
||||
"namespace A { int B; }",
|
||||
|
Loading…
Reference in New Issue
Block a user