[llvm-branch-commits] [clang-tools-extra] [clang-doc] Try to make testing more uniform (PR #205586)
Paul Kirth via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jun 24 09:03:15 PDT 2026
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/205586
None
>From a7e1afd3020c7727fc0f66903c938c0bdf08b11d Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Fri, 19 Jun 2026 00:45:28 +0000
Subject: [PATCH] [clang-doc] Try to make testing more uniform
Today clang-doc has tests for its various backends that use the same
input files, and mix the checks for each format. This leads to very
large test files that are quite hard to update or maintain. Thus far
we've assumed that this is better than updating several files, but as we
leverage mustache and JSON more and more to test feature completeness,
much of the output complexity is now limited to each backend and its
mustache templates. To make this simpler to maintain, we can lean into
common test Inputs keeping the annotate source separate from the test
checks, and split the checks out into their own directory hierarchy.
This patch is mostly mechanical rewriting of code. This was done with
the assistance of an LLM, but was checked by me, and verified with
instrumentation based coverage that we did not lose any line coverage.
---
.../test/clang-doc/Inputs/DR-141990.cpp | 0
.../Inputs/basic-project/src/Calculator.cpp | 17 +-
.../Inputs/basic-project/src/Circle.cpp | 8 +-
.../Inputs/basic-project/src/Rectangle.cpp | 8 +-
.../test/clang-doc/Inputs/builtin_types.cpp | 8 +
.../Inputs/class-partial-specialization.cpp | 4 +-
.../test/clang-doc/Inputs/class-requires.cpp | 8 +
.../clang-doc/Inputs/class-specialization.cpp | 3 +
.../test/clang-doc/Inputs/class-template.cpp | 4 +
.../test/clang-doc/Inputs/class.cpp | 31 +
.../clang-doc/Inputs/comments-in-macros.cpp | 10 +
.../test/clang-doc/Inputs/compact.cpp | 1 +
.../clang-doc/Inputs/compound-constraints.cpp | 40 +
.../test/clang-doc/Inputs/concept.cpp | 6 +
.../clang-doc/Inputs/conversion_function.cpp | 3 +
.../test/clang-doc/Inputs/enum.cpp | 12 +-
.../clang-doc/Inputs/function-requires.cpp | 11 +
.../clang-doc/Inputs/function-specifiers.cpp | 9 +
.../test/clang-doc/Inputs/index.cpp | 5 +
.../test/clang-doc/Inputs/inheritance.cpp | 7 +
.../test/clang-doc/Inputs/long-name.cpp | 8 +
.../test/clang-doc/Inputs/method-template.cpp | 3 +
.../clang-doc/Inputs/multiple-namespaces.cpp | 11 +
.../test/clang-doc/Inputs/mustache-index.cpp | 3 +
.../Inputs/mustache-separate-namespace.cpp | 3 +
.../clang-doc/Inputs/namespace-html-md.cpp | 29 +
.../test/clang-doc/Inputs/namespace.cpp | 11 +
.../clang-doc/Inputs/nested-namespace.cpp | 7 +
.../Inputs/nested-pointer-qualifiers.cpp | 2 +-
.../clang-doc/Inputs/single-file-public.cpp | 11 +
.../test/clang-doc/Inputs/single-file.cpp | 3 +
.../test/clang-doc/Inputs/templates.cpp | 20 +
.../test/clang-doc/Inputs/typedef-alias.cpp | 14 +
.../clang-doc/basic-project.mustache.test | 10 +-
.../test/clang-doc/basic-project.test | 11 +-
.../class-partial-specialization.cpp | 13 -
.../test/clang-doc/comments-in-macros.cpp | 43 -
clang-tools-extra/test/clang-doc/enum.cpp | 839 ------------------
.../test/clang-doc/html/array-type.cpp | 6 +
.../html/class-partial-specialization.cpp | 7 +
.../clang-doc/html/class-specialization.cpp | 19 +
.../test/clang-doc/html/class.cpp | 59 ++
.../clang-doc/html/comments-in-macros.cpp | 12 +
.../clang-doc/html/compound-constraints.cpp | 83 ++
.../{ => html}/conversion_function.cpp | 12 +-
.../test/clang-doc/html/enum.cpp | 368 ++++++++
.../clang-doc/html/function-pointer-type.cpp | 6 +
.../test/clang-doc/{ => html}/index.cpp | 26 +-
.../test/clang-doc/html/long-name.cpp | 6 +
.../html/member-function-pointer-type.cpp | 6 +
.../clang-doc/{ => html}/mustache-index.cpp | 12 +-
.../mustache-separate-namespace.cpp | 7 +-
.../test/clang-doc/html/namespace.cpp | 148 +++
.../html/nested-pointer-qualifiers.cpp | 6 +
.../test/clang-doc/html/templates.cpp | 73 ++
.../clang-doc/{ => html}/typedef-alias.cpp | 29 +-
.../json/class-partial-specialization.cpp | 2 +-
.../test/clang-doc/json/class-requires.cpp | 11 +-
.../clang-doc/json/class-specialization.cpp | 23 +-
.../test/clang-doc/json/class-template.cpp | 7 +-
.../test/clang-doc/json/class.cpp | 99 +--
.../test/clang-doc/{ => json}/compact.cpp | 6 +-
.../clang-doc/json/compound-constraints.cpp | 119 +--
.../test/clang-doc/json/concept.cpp | 11 +-
.../clang-doc/json/conversion_function.cpp | 5 +
.../test/clang-doc/json/enum.cpp | 377 ++++++++
.../test/clang-doc/json/function-requires.cpp | 12 +-
.../clang-doc/json/function-specifiers.cpp | 12 +-
.../test/clang-doc/json/index.cpp | 18 +
.../test/clang-doc/json/inheritance.cpp | 10 +-
.../test/clang-doc/json/long-name.cpp | 7 +
.../test/clang-doc/json/method-template.cpp | 9 +-
.../clang-doc/json/multiple-namespaces.cpp | 14 +-
.../test/clang-doc/json/namespace.cpp | 36 +-
.../test/clang-doc/json/nested-namespace.cpp | 14 +-
.../test/clang-doc/json/templates.cpp | 196 ++++
.../test/clang-doc/long-name.cpp | 16 -
.../test/clang-doc/{ => md}/array-type.cpp | 8 +-
.../test/clang-doc/md/builtin_types.cpp | 60 ++
.../md/class-partial-specialization.cpp | 8 +
.../test/clang-doc/md/comments-in-macros.cpp | 18 +
clang-tools-extra/test/clang-doc/md/enum.cpp | 120 +++
.../{ => md}/function-pointer-type.cpp | 8 +-
.../{ => md}/member-function-pointer-type.cpp | 8 +-
.../test/clang-doc/md/namespace.cpp | 194 ++++
.../{ => md}/nested-pointer-qualifiers.cpp | 8 +-
.../test/clang-doc/md/templates.cpp | 49 +
.../test/clang-doc/namespace.cpp | 380 --------
.../test/clang-doc/single-file-public.cpp | 62 --
.../test/clang-doc/templates.cpp | 491 ----------
.../clang-doc/{ => yaml}/builtin_types.cpp | 95 +-
.../clang-doc/yaml/conversion_function.cpp | 7 +
.../clang-doc/yaml/single-file-public.cpp | 6 +
.../test/clang-doc/{ => yaml}/single-file.cpp | 10 +-
.../test/clang-doc/yaml/templates.cpp | 148 +++
95 files changed, 2365 insertions(+), 2440 deletions(-)
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/DR-141990.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/builtin_types.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/class-requires.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/class-specialization.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/class-template.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/class.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/comments-in-macros.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/compact.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/compound-constraints.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/concept.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/conversion_function.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/function-requires.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/function-specifiers.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/index.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/inheritance.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/long-name.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/method-template.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/multiple-namespaces.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/mustache-index.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/mustache-separate-namespace.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/namespace-html-md.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/namespace.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/nested-namespace.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/single-file-public.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/single-file.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/templates.cpp
create mode 100644 clang-tools-extra/test/clang-doc/Inputs/typedef-alias.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/class-partial-specialization.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/comments-in-macros.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/enum.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/array-type.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/class-partial-specialization.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/class-specialization.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/class.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/comments-in-macros.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/compound-constraints.cpp
rename clang-tools-extra/test/clang-doc/{ => html}/conversion_function.cpp (59%)
create mode 100644 clang-tools-extra/test/clang-doc/html/enum.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/function-pointer-type.cpp
rename clang-tools-extra/test/clang-doc/{ => html}/index.cpp (78%)
create mode 100644 clang-tools-extra/test/clang-doc/html/long-name.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/member-function-pointer-type.cpp
rename clang-tools-extra/test/clang-doc/{ => html}/mustache-index.cpp (95%)
rename clang-tools-extra/test/clang-doc/{ => html}/mustache-separate-namespace.cpp (95%)
create mode 100644 clang-tools-extra/test/clang-doc/html/namespace.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/nested-pointer-qualifiers.cpp
create mode 100644 clang-tools-extra/test/clang-doc/html/templates.cpp
rename clang-tools-extra/test/clang-doc/{ => html}/typedef-alias.cpp (83%)
rename clang-tools-extra/test/clang-doc/{ => json}/compact.cpp (96%)
create mode 100644 clang-tools-extra/test/clang-doc/json/conversion_function.cpp
create mode 100644 clang-tools-extra/test/clang-doc/json/enum.cpp
create mode 100644 clang-tools-extra/test/clang-doc/json/index.cpp
create mode 100644 clang-tools-extra/test/clang-doc/json/long-name.cpp
create mode 100644 clang-tools-extra/test/clang-doc/json/templates.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/long-name.cpp
rename clang-tools-extra/test/clang-doc/{ => md}/array-type.cpp (54%)
create mode 100644 clang-tools-extra/test/clang-doc/md/builtin_types.cpp
create mode 100644 clang-tools-extra/test/clang-doc/md/class-partial-specialization.cpp
create mode 100644 clang-tools-extra/test/clang-doc/md/comments-in-macros.cpp
create mode 100644 clang-tools-extra/test/clang-doc/md/enum.cpp
rename clang-tools-extra/test/clang-doc/{ => md}/function-pointer-type.cpp (52%)
rename clang-tools-extra/test/clang-doc/{ => md}/member-function-pointer-type.cpp (51%)
create mode 100644 clang-tools-extra/test/clang-doc/md/namespace.cpp
rename clang-tools-extra/test/clang-doc/{ => md}/nested-pointer-qualifiers.cpp (51%)
create mode 100644 clang-tools-extra/test/clang-doc/md/templates.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/namespace.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/single-file-public.cpp
delete mode 100644 clang-tools-extra/test/clang-doc/templates.cpp
rename clang-tools-extra/test/clang-doc/{ => yaml}/builtin_types.cpp (63%)
create mode 100644 clang-tools-extra/test/clang-doc/yaml/conversion_function.cpp
create mode 100644 clang-tools-extra/test/clang-doc/yaml/single-file-public.cpp
rename clang-tools-extra/test/clang-doc/{ => yaml}/single-file.cpp (85%)
create mode 100644 clang-tools-extra/test/clang-doc/yaml/templates.cpp
diff --git a/clang-tools-extra/test/clang-doc/Inputs/DR-141990.cpp b/clang-tools-extra/test/clang-doc/Inputs/DR-141990.cpp
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Calculator.cpp b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Calculator.cpp
index 483d050e3225a..aac9b2f48a826 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Calculator.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Calculator.cpp
@@ -1,18 +1,9 @@
#include "Calculator.h"
-int Calculator::add(int a, int b) {
- return a + b;
-}
+int Calculator::add(int a, int b) { return a + b; }
-int Calculator::subtract(int a, int b) {
- return a - b;
-}
+int Calculator::subtract(int a, int b) { return a - b; }
-int Calculator::multiply(int a, int b) {
- return a * b;
-}
-
-double Calculator::divide(int a, int b) {
- return static_cast<double>(a) / b;
-}
+int Calculator::multiply(int a, int b) { return a * b; }
+double Calculator::divide(int a, int b) { return static_cast<double>(a) / b; }
diff --git a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Circle.cpp b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Circle.cpp
index 811aac4989bd0..c43299e809ba4 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Circle.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Circle.cpp
@@ -2,10 +2,6 @@
Circle::Circle(double radius) : radius_(radius) {}
-double Circle::area() const {
- return 3.141 * radius_ * radius_;
-}
+double Circle::area() const { return 3.141 * radius_ * radius_; }
-double Circle::perimeter() const {
- return 3.141 * radius_;
-}
+double Circle::perimeter() const { return 3.141 * radius_; }
diff --git a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Rectangle.cpp b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Rectangle.cpp
index a2b253b750aa8..7b0fb2aa1c024 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Rectangle.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Rectangle.cpp
@@ -3,10 +3,6 @@
Rectangle::Rectangle(double width, double height)
: width_(width), height_(height) {}
-double Rectangle::area() const {
- return width_ * height_;
-}
+double Rectangle::area() const { return width_ * height_; }
-double Rectangle::perimeter() const {
- return 2 * (width_ + height_);
-}
\ No newline at end of file
+double Rectangle::perimeter() const { return 2 * (width_ + height_); }
\ No newline at end of file
diff --git a/clang-tools-extra/test/clang-doc/Inputs/builtin_types.cpp b/clang-tools-extra/test/clang-doc/Inputs/builtin_types.cpp
new file mode 100644
index 0000000000000..c792bffd8f9f6
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/builtin_types.cpp
@@ -0,0 +1,8 @@
+extern bool b();
+char c();
+double d();
+float f();
+int i();
+long l();
+long long ll();
+short s();
diff --git a/clang-tools-extra/test/clang-doc/Inputs/class-partial-specialization.cpp b/clang-tools-extra/test/clang-doc/Inputs/class-partial-specialization.cpp
index f36b320138691..d27e275ce180e 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/class-partial-specialization.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/class-partial-specialization.cpp
@@ -1,2 +1,2 @@
-template<typename T> struct MyClass {};
-template<typename T> struct MyClass<T*> {};
+template <typename T> struct MyClass {};
+template <typename T> struct MyClass<T *> {};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/class-requires.cpp b/clang-tools-extra/test/clang-doc/Inputs/class-requires.cpp
new file mode 100644
index 0000000000000..b3eeb0c43994d
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/class-requires.cpp
@@ -0,0 +1,8 @@
+template <typename T>
+concept Addable = requires(T a, T b) {
+ { a + b };
+};
+
+template <typename T>
+ requires Addable<T>
+struct MyClass;
diff --git a/clang-tools-extra/test/clang-doc/Inputs/class-specialization.cpp b/clang-tools-extra/test/clang-doc/Inputs/class-specialization.cpp
new file mode 100644
index 0000000000000..482c533cd4f35
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/class-specialization.cpp
@@ -0,0 +1,3 @@
+template <typename T> struct MyClass {};
+
+template <> struct MyClass<int> {};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/class-template.cpp b/clang-tools-extra/test/clang-doc/Inputs/class-template.cpp
new file mode 100644
index 0000000000000..6ed0eb353acc2
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/class-template.cpp
@@ -0,0 +1,4 @@
+template <typename T> struct MyClass {
+ T MemberTemplate;
+ T method(T Param);
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/class.cpp b/clang-tools-extra/test/clang-doc/Inputs/class.cpp
new file mode 100644
index 0000000000000..07869652522b5
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/class.cpp
@@ -0,0 +1,31 @@
+/// This is a struct friend.
+struct Foo;
+
+// This is a nice class.
+// It has some nice methods and fields.
+// @brief This is a brief description.
+struct MyClass {
+ int PublicField;
+
+ int myMethod(int MyParam);
+ static void staticMethod();
+ const int &getConst();
+
+ enum Color { RED, GREEN, BLUE = 5 };
+
+ typedef int MyTypedef;
+
+ class NestedClass;
+
+ friend struct Foo;
+ /// This is a function template friend.
+ template <typename T> friend void friendFunction(int);
+
+protected:
+ int protectedMethod();
+
+ int ProtectedField;
+
+private:
+ int PrivateField;
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/comments-in-macros.cpp b/clang-tools-extra/test/clang-doc/Inputs/comments-in-macros.cpp
new file mode 100644
index 0000000000000..783956d3d99fb
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/comments-in-macros.cpp
@@ -0,0 +1,10 @@
+#define DECLARE_METHODS \
+ /** \
+ * @brief Declare a method to calculate the sum of two numbers \
+ */ \
+ int Add(int a, int b) { return a + b; }
+
+class MyClass {
+public:
+ DECLARE_METHODS
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/compact.cpp b/clang-tools-extra/test/clang-doc/Inputs/compact.cpp
new file mode 100644
index 0000000000000..6247fa0e73911
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/compact.cpp
@@ -0,0 +1 @@
+class Foo {};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/compound-constraints.cpp b/clang-tools-extra/test/clang-doc/Inputs/compound-constraints.cpp
new file mode 100644
index 0000000000000..f8aa2955314c5
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/compound-constraints.cpp
@@ -0,0 +1,40 @@
+/// \brief Concept for an incrementable value
+///
+/// \tparam T A value that can be incremented.
+template <typename T>
+concept Incrementable = requires(T a) { a++; };
+
+/// \brief Concept for a decrementable value
+///
+/// \tparam T A value that can be decremented
+template <typename T>
+concept Decrementable = requires(T a) { a--; };
+
+/// \brief Concept for a pre-incrementable value
+///
+/// \tparam T A value that can be pre-incremented
+template <typename T>
+concept PreIncrementable = requires(T a) { ++a; };
+
+/// \brief Concept for a -pre-decrementable value
+///
+/// \tparam T A value that can be pre-decremented
+template <typename T>
+concept PreDecrementable = requires(T a) { --a; };
+
+template <typename T>
+ requires Incrementable<T> && Decrementable<T>
+void One();
+
+template <typename T>
+ requires(Incrementable<T> && Decrementable<T>)
+void Two();
+
+template <typename T>
+ requires(Incrementable<T> && Decrementable<T>) ||
+ (PreIncrementable<T> && PreDecrementable<T>)
+void Three();
+
+template <typename T>
+ requires(Incrementable<T> && Decrementable<T>) || PreIncrementable<T>
+void Four();
diff --git a/clang-tools-extra/test/clang-doc/Inputs/concept.cpp b/clang-tools-extra/test/clang-doc/Inputs/concept.cpp
new file mode 100644
index 0000000000000..b230b9aa4f5bc
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/concept.cpp
@@ -0,0 +1,6 @@
+// Requires that T suports post and pre-incrementing.
+template <typename T>
+concept Incrementable = requires(T x) {
+ ++x;
+ x++;
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/conversion_function.cpp b/clang-tools-extra/test/clang-doc/Inputs/conversion_function.cpp
new file mode 100644
index 0000000000000..ee6a21f9108da
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/conversion_function.cpp
@@ -0,0 +1,3 @@
+template <typename T> struct MyStruct {
+ operator T();
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/enum.cpp b/clang-tools-extra/test/clang-doc/Inputs/enum.cpp
index 04291865a3c09..1a376fb232184 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/enum.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/enum.cpp
@@ -41,7 +41,7 @@ enum Size : uint8_t {
* @brief Very long number
*/
enum : long long {
- BigVal = 999999999999 ///< A very large value
+ BigVal = 999999999999 ///< A very large value
};
enum ColorUserSpecified {
@@ -56,9 +56,9 @@ class FilePermissions {
* @brief File permission flags
*/
enum {
- Read = 1, ///< Permission to READ r
- Write = 2, ///< Permission to WRITE w
- Execute = 4 ///< Permission to EXECUTE x
+ Read = 1, ///< Permission to READ r
+ Write = 2, ///< Permission to WRITE w
+ Execute = 4 ///< Permission to EXECUTE x
};
};
@@ -80,8 +80,8 @@ namespace Vehicles {
* @brief specify type of car
*/
enum Car {
- Sedan, ///< Comment 1
- SUV, ///< Comment 2
+ Sedan, ///< Comment 1
+ SUV, ///< Comment 2
Pickup,
Hatchback ///< Comment 4
};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/function-requires.cpp b/clang-tools-extra/test/clang-doc/Inputs/function-requires.cpp
new file mode 100644
index 0000000000000..3a6b4f85b2f56
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/function-requires.cpp
@@ -0,0 +1,11 @@
+template <typename T>
+concept Incrementable = requires(T x) {
+ ++x;
+ x++;
+};
+
+template <typename T>
+void increment(T t)
+ requires Incrementable<T>;
+
+template <Incrementable T> Incrementable auto incrementTwo(T t);
diff --git a/clang-tools-extra/test/clang-doc/Inputs/function-specifiers.cpp b/clang-tools-extra/test/clang-doc/Inputs/function-specifiers.cpp
new file mode 100644
index 0000000000000..77bdbebef879c
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/function-specifiers.cpp
@@ -0,0 +1,9 @@
+static void myFunction() {}
+
+void noExceptFunction() noexcept {}
+
+inline void inlineFunction() {}
+
+extern void externFunction() {}
+
+constexpr void constexprFunction() {}
diff --git a/clang-tools-extra/test/clang-doc/Inputs/index.cpp b/clang-tools-extra/test/clang-doc/Inputs/index.cpp
new file mode 100644
index 0000000000000..535f5f3cd8837
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/index.cpp
@@ -0,0 +1,5 @@
+class Foo {};
+
+namespace inner {
+class Bar {};
+} // namespace inner
diff --git a/clang-tools-extra/test/clang-doc/Inputs/inheritance.cpp b/clang-tools-extra/test/clang-doc/Inputs/inheritance.cpp
new file mode 100644
index 0000000000000..0b486cc3705cb
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/inheritance.cpp
@@ -0,0 +1,7 @@
+class Virtual {};
+class Foo : virtual Virtual {};
+class Bar : Foo {};
+class Fizz : virtual Virtual {};
+class Buzz : Fizz {};
+
+class MyClass : Bar, Buzz {};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/long-name.cpp b/clang-tools-extra/test/clang-doc/Inputs/long-name.cpp
new file mode 100644
index 0000000000000..7050fdf8a6c7a
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/long-name.cpp
@@ -0,0 +1,8 @@
+struct
+ ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12 {
+};
+
+// This name is 1 character over the limit, so it will be serialized as a USR.
+struct
+ ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd123 {
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/method-template.cpp b/clang-tools-extra/test/clang-doc/Inputs/method-template.cpp
new file mode 100644
index 0000000000000..d489ae24b2b6d
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/method-template.cpp
@@ -0,0 +1,3 @@
+struct MyClass {
+ template <class T> T methodTemplate(T param) {}
+};
diff --git a/clang-tools-extra/test/clang-doc/Inputs/multiple-namespaces.cpp b/clang-tools-extra/test/clang-doc/Inputs/multiple-namespaces.cpp
new file mode 100644
index 0000000000000..de7830b7ea257
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/multiple-namespaces.cpp
@@ -0,0 +1,11 @@
+namespace foo {
+namespace tools {
+class FooTools {};
+} // namespace tools
+} // namespace foo
+
+namespace bar {
+namespace tools {
+class BarTools {};
+} // namespace tools
+} // namespace bar
diff --git a/clang-tools-extra/test/clang-doc/Inputs/mustache-index.cpp b/clang-tools-extra/test/clang-doc/Inputs/mustache-index.cpp
new file mode 100644
index 0000000000000..a4662f7b6a284
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/mustache-index.cpp
@@ -0,0 +1,3 @@
+enum Color { RED, BLUE, GREEN };
+
+class Foo;
diff --git a/clang-tools-extra/test/clang-doc/Inputs/mustache-separate-namespace.cpp b/clang-tools-extra/test/clang-doc/Inputs/mustache-separate-namespace.cpp
new file mode 100644
index 0000000000000..66686162ea5b8
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/mustache-separate-namespace.cpp
@@ -0,0 +1,3 @@
+namespace MyNamespace {
+class Foo;
+}
diff --git a/clang-tools-extra/test/clang-doc/Inputs/namespace-html-md.cpp b/clang-tools-extra/test/clang-doc/Inputs/namespace-html-md.cpp
new file mode 100644
index 0000000000000..20897fa335c79
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/namespace-html-md.cpp
@@ -0,0 +1,29 @@
+// Anonymous Namespace
+namespace {
+void anonFunction() {}
+class AnonClass {};
+} // namespace
+
+// Primary Namespace
+namespace PrimaryNamespace {
+// Function in PrimaryNamespace
+void functionInPrimaryNamespace() {}
+// Class in PrimaryNamespace
+class ClassInPrimaryNamespace {};
+
+// Nested namespace
+namespace NestedNamespace {
+// Function in NestedNamespace
+void functionInNestedNamespace() {}
+// Class in NestedNamespace
+class ClassInNestedNamespace {};
+} // namespace NestedNamespace
+} // namespace PrimaryNamespace
+
+// AnotherNamespace
+namespace AnotherNamespace {
+// Function in AnotherNamespace
+void functionInAnotherNamespace() {}
+// Class in AnotherNamespace
+class ClassInAnotherNamespace {};
+} // namespace AnotherNamespace
diff --git a/clang-tools-extra/test/clang-doc/Inputs/namespace.cpp b/clang-tools-extra/test/clang-doc/Inputs/namespace.cpp
new file mode 100644
index 0000000000000..05f69924d7c73
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/namespace.cpp
@@ -0,0 +1,11 @@
+class MyClass {};
+
+void myFunction(int Param);
+
+namespace NestedNamespace {} // namespace NestedNamespace
+
+static int Global;
+
+enum Color { RED, GREEN, BLUE = 5 };
+
+typedef int MyTypedef;
diff --git a/clang-tools-extra/test/clang-doc/Inputs/nested-namespace.cpp b/clang-tools-extra/test/clang-doc/Inputs/nested-namespace.cpp
new file mode 100644
index 0000000000000..a3f51010e95b6
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/nested-namespace.cpp
@@ -0,0 +1,7 @@
+namespace nested {
+int Global;
+namespace inner {
+int InnerGlobal;
+namespace inner_inner {}
+} // namespace inner
+} // namespace nested
diff --git a/clang-tools-extra/test/clang-doc/Inputs/nested-pointer-qualifiers.cpp b/clang-tools-extra/test/clang-doc/Inputs/nested-pointer-qualifiers.cpp
index 49cfb4c8567f4..9f787685b014e 100644
--- a/clang-tools-extra/test/clang-doc/Inputs/nested-pointer-qualifiers.cpp
+++ b/clang-tools-extra/test/clang-doc/Inputs/nested-pointer-qualifiers.cpp
@@ -1 +1 @@
-void foo(const int * const * ptr);
+void foo(const int *const *ptr);
diff --git a/clang-tools-extra/test/clang-doc/Inputs/single-file-public.cpp b/clang-tools-extra/test/clang-doc/Inputs/single-file-public.cpp
new file mode 100644
index 0000000000000..c809a248aa93e
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/single-file-public.cpp
@@ -0,0 +1,11 @@
+class Record {
+private:
+ void function_private();
+
+public:
+ void function_public();
+};
+
+void Record::function_private() {}
+
+void Record::function_public() {}
diff --git a/clang-tools-extra/test/clang-doc/Inputs/single-file.cpp b/clang-tools-extra/test/clang-doc/Inputs/single-file.cpp
new file mode 100644
index 0000000000000..05b0508515258
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/single-file.cpp
@@ -0,0 +1,3 @@
+void function(int x);
+
+void function(int x) {}
diff --git a/clang-tools-extra/test/clang-doc/Inputs/templates.cpp b/clang-tools-extra/test/clang-doc/Inputs/templates.cpp
new file mode 100644
index 0000000000000..5fb8255b43872
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/templates.cpp
@@ -0,0 +1,20 @@
+template <class... T> void ParamPackFunction(T... args);
+
+template <typename T, int U = 1> void function(T x) {}
+
+template <typename A, typename B, typename C, typename D, typename E>
+void longFunction(A a, B b, C c, D d, E e) {}
+
+template <> void function<bool, 0>(bool x) {}
+
+/// A Tuple type
+///
+/// Does Tuple things.
+template <typename... Tys> struct tuple {};
+
+/// A function with a tuple parameter
+///
+/// \param t The input to func_with_tuple_param
+tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t) {
+ return t;
+}
diff --git a/clang-tools-extra/test/clang-doc/Inputs/typedef-alias.cpp b/clang-tools-extra/test/clang-doc/Inputs/typedef-alias.cpp
new file mode 100644
index 0000000000000..0ad69a97421a1
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/Inputs/typedef-alias.cpp
@@ -0,0 +1,14 @@
+/// \brief This is u_long
+using u_long = unsigned long;
+
+/// \brief This is IntPtr
+typedef int *IntPtr;
+
+template <typename T> class Vector {
+ /// \brief This is a Ptr
+ using Ptr = IntPtr;
+};
+
+template <typename T> using Vec = Vector<T>;
+
+using IntVec = Vector<int>;
diff --git a/clang-tools-extra/test/clang-doc/basic-project.mustache.test b/clang-tools-extra/test/clang-doc/basic-project.mustache.test
index 0b190caeed8f5..63c6d30fff895 100644
--- a/clang-tools-extra/test/clang-doc/basic-project.mustache.test
+++ b/clang-tools-extra/test/clang-doc/basic-project.mustache.test
@@ -554,21 +554,21 @@ MD-CALC: **b** Second integer.
MD-CALC: **return** int The sum of a and b.
MD-CALC: ### subtract
MD-CALC: *public int subtract(int a, int b)*
-MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#7*
+MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#5*
MD-CALC: **brief** Subtracts the second integer from the first.
MD-CALC: **a** First integer.
MD-CALC: **b** Second integer.
MD-CALC: **return** int The result of a - b.
MD-CALC: ### multiply
MD-CALC: *public int multiply(int a, int b)*
-MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#11*
+MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#7*
MD-CALC: **brief** Multiplies two integers.
MD-CALC: **a** First integer.
MD-CALC: **b** Second integer.
MD-CALC: **return** int The product of a and b.
MD-CALC: ### divide
MD-CALC: *public double divide(int a, int b)*
-MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#15*
+MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#9*
MD-CALC: **brief** Divides the first integer by the second.
MD-CALC: **a** First integer.
MD-CALC: **b** Second integer.
@@ -602,7 +602,7 @@ MD-CIRCLE: **brief** Calculates the area of the circle.
MD-CIRCLE: **return** double The area of the circle.
MD-CIRCLE: ### perimeter
MD-CIRCLE: *public double perimeter()*
-MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#9*
+MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#7*
MD-CIRCLE: **brief** Calculates the perimeter of the circle.
MD-CIRCLE: **return** double The perimeter of the circle.
@@ -628,7 +628,7 @@ MD-RECTANGLE: **brief** Calculates the area of the rectangle.
MD-RECTANGLE: **return** double The area of the rectangle.
MD-RECTANGLE: ### perimeter
MD-RECTANGLE: *public double perimeter()*
-MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#10*
+MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#8*
MD-RECTANGLE: **brief** Calculates the perimeter of the rectangle.
MD-RECTANGLE: **return** double The perimeter of the rectangle.
diff --git a/clang-tools-extra/test/clang-doc/basic-project.test b/clang-tools-extra/test/clang-doc/basic-project.test
index 057091102f122..bd895f3f0ade8 100644
--- a/clang-tools-extra/test/clang-doc/basic-project.test
+++ b/clang-tools-extra/test/clang-doc/basic-project.test
@@ -73,21 +73,21 @@
// MD-CALC: **return** int The sum of a and b.
// MD-CALC: ### subtract
// MD-CALC: *public int subtract(int a, int b)*
-// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#7*
+// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#5*
// MD-CALC: **brief** Subtracts the second integer from the first.
// MD-CALC: **a** First integer.
// MD-CALC: **b** Second integer.
// MD-CALC: **return** int The result of a - b.
// MD-CALC: ### multiply
// MD-CALC: *public int multiply(int a, int b)*
-// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#11*
+// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#7*
// MD-CALC: **brief** Multiplies two integers.
// MD-CALC: **a** First integer.
// MD-CALC: **b** Second integer.
// MD-CALC: **return** int The product of a and b.
// MD-CALC: ### divide
// MD-CALC: *public double divide(int a, int b)*
-// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#15*
+// MD-CALC: *Defined at .{{[\/]}}src{{[\/]}}Calculator.cpp#9*
// MD-CALC: **brief** Divides the first integer by the second.
// MD-CALC: **a** First integer.
// MD-CALC: **b** Second integer.
@@ -121,7 +121,7 @@
// MD-CIRCLE: **return** double The area of the circle.
// MD-CIRCLE: ### perimeter
// MD-CIRCLE: *public double perimeter()*
-// MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#9*
+// MD-CIRCLE: *Defined at .{{[\/]}}src{{[\/]}}Circle.cpp#7*
// MD-CIRCLE: **brief** Calculates the perimeter of the circle.
// MD-CIRCLE: **return** double The perimeter of the circle.
@@ -147,7 +147,7 @@
// MD-RECTANGLE: **return** double The area of the rectangle.
// MD-RECTANGLE: ### perimeter
// MD-RECTANGLE: *public double perimeter()*
-// MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#10*
+// MD-RECTANGLE: *Defined at .{{[\/]}}src{{[\/]}}Rectangle.cpp#8*
// MD-RECTANGLE: **brief** Calculates the perimeter of the rectangle.
// MD-RECTANGLE: **return** double The perimeter of the rectangle.
@@ -174,4 +174,3 @@
// MD-INDEX: # C/C++ Reference
// MD-INDEX: * Namespace: [GlobalNamespace](GlobalNamespace)
-
diff --git a/clang-tools-extra/test/clang-doc/class-partial-specialization.cpp b/clang-tools-extra/test/clang-doc/class-partial-specialization.cpp
deleted file mode 100644
index 0eff263bc5632..0000000000000
--- a/clang-tools-extra/test/clang-doc/class-partial-specialization.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %S/Inputs/class-partial-specialization.cpp
-// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/_ZTV7MyClassIPT_E.html
-// RUN: clang-doc --output=%t --format=md --executor=standalone %S/Inputs/class-partial-specialization.cpp
-// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/MyClass.md
-// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/Inputs/class-partial-specialization.cpp
-// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/_ZTV7MyClassIPT_E.md
-
-// HTML: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre>
-// HTML: <h1 class="hero__title-large">struct MyClass</h1>
-
-// MD: # struct MyClass
-// MD-MUSTACHE: # struct MyClass
diff --git a/clang-tools-extra/test/clang-doc/comments-in-macros.cpp b/clang-tools-extra/test/clang-doc/comments-in-macros.cpp
deleted file mode 100644
index 7200800e82acc..0000000000000
--- a/clang-tools-extra/test/clang-doc/comments-in-macros.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// Regression test for https://github.com/llvm/llvm-project/issues/59819
-
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s
-// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
-// RUN: clang-doc --format=md_mustache --doxygen --output=%t --executor=standalone %s
-// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS-LINE
-// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS
-// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html --check-prefix=HTML-MYCLASS-LINE
-// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html --check-prefix=HTML-MYCLASS
-// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7MyClass.md --check-prefix=MD-MUSTACHE-MYCLASS-LINE
-// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7MyClass.md --check-prefix=MD-MUSTACHE-MYCLASS
-
-#define DECLARE_METHODS \
- /**
- * @brief Declare a method to calculate the sum of two numbers
- */ \
- int Add(int a, int b) { \
- return a + b; \
- }
-
-// MD-MYCLASS: ### Add
-// MD-MYCLASS: *public int Add(int a, int b)*
-// MD-MYCLASS: **brief** Declare a method to calculate the sum of two numbers
-
-// MD-MUSTACHE-MYCLASS: ### Add
-// MD-MUSTACHE-MYCLASS: *public int Add(int a, int b)*
-// MD-MUSTACHE-MYCLASS: **brief** Declare a method to calculate the sum of two numbers
-
-// HTML-MYCLASS: <pre><code class="language-cpp code-clang-doc">int Add (int a, int b)</code></pre>
-// HTML-MYCLASS: <div class="doc-card">
-// HTML-MYCLASS: <div class="nested-delimiter-container">
-// HTML-MYCLASS: <p>Declare a method to calculate the sum of two numbers</p>
-// HTML-MYCLASS: </div>
-
-class MyClass {
-public:
-// MD-MYCLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}comments-in-macros.cpp#[[@LINE+3]]*
-// HTML-MYCLASS-LINE: <p>Defined at line [[@LINE+2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}comments-in-macros.cpp</p>
-// MD-MUSTACHE-MYCLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}comments-in-macros.cpp#[[@LINE+1]]*
- DECLARE_METHODS
-};
-
diff --git a/clang-tools-extra/test/clang-doc/enum.cpp b/clang-tools-extra/test/clang-doc/enum.cpp
deleted file mode 100644
index e94869132e8ae..0000000000000
--- a/clang-tools-extra/test/clang-doc/enum.cpp
+++ /dev/null
@@ -1,839 +0,0 @@
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %S/Inputs/enum.cpp
-// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %S/Inputs/enum.cpp
-// RUN: clang-doc --format=md_mustache --pretty-json --doxygen --output=%t --executor=standalone %S/Inputs/enum.cpp
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=HTML-INDEX
-// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7Animals.html --check-prefix=HTML-ANIMAL
-// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV15FilePermissions.html --check-prefix=HTML-PERM
-// RUN: FileCheck %s < %t/html/Vehicles/index.html --check-prefix=HTML-VEHICLES
-// RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX
-// RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL
-// RUN: FileCheck %s < %t/GlobalNamespace/FilePermissions.md --check-prefix=MD-PERM
-// RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES
-// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md --check-prefix=MD-MUSTACHE-INDEX
-// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7Animals.md --check-prefix=MD-MUSTACHE-ANIMAL
-// RUN: FileCheck %s < %t/md/Vehicles/index.md --check-prefix=MD-MUSTACHE-VEHICLES
-// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json --check-prefix=JSON-INDEX
-// RUN: FileCheck %s < %t/json/Vehicles/index.json --check-prefix=JSON-VEHICLES-INDEX
-
-// JSON-INDEX: {
-// JSON-INDEX-NEXT: "DocumentationFileName": "index",
-// JSON-INDEX-NEXT: "Enums": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "BriefComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "For specifying RGB colors"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "HasBriefComments": true
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasComments": true,
-// JSON-INDEX-NEXT: "InfoType": "enum",
-// JSON-INDEX-NEXT: "Location": {
-// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-INDEX-NEXT: "LineNumber": 4
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Members": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 1"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Red",
-// JSON-INDEX-NEXT: "Value": "0"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 2"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Green",
-// JSON-INDEX-NEXT: "Value": "1"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 3"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Blue",
-// JSON-INDEX-NEXT: "Value": "2"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "Name": "Color",
-// JSON-INDEX-NEXT: "Scoped": false,
-// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "BriefComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Shape Types"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "HasBriefComments": true
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasComments": true,
-// JSON-INDEX-NEXT: "InfoType": "enum",
-// JSON-INDEX-NEXT: "Location": {
-// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-INDEX-NEXT: "LineNumber": 13
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Members": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 1"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Circle",
-// JSON-INDEX-NEXT: "Value": "0"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 2"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Rectangle",
-// JSON-INDEX-NEXT: "Value": "1"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Comment 3"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Triangle",
-// JSON-INDEX-NEXT: "Value": "2"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "Name": "Shapes",
-// JSON-INDEX-NEXT: "Scoped": true,
-// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "BaseType": {
-// JSON-INDEX-NEXT: "Name": "uint8_t",
-// JSON-INDEX-NEXT: "QualName": "uint8_t",
-// JSON-INDEX-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "BriefComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Specify the size"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "HasBriefComments": true
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasComments": true,
-// JSON-INDEX-NEXT: "InfoType": "enum",
-// JSON-INDEX-NEXT: "Location": {
-// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-INDEX-NEXT: "LineNumber": 26
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Members": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "A pearl."
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Pearls are quite small."
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Pearls are used in jewelry."
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Small",
-// JSON-INDEX-NEXT: "Value": "0"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "BriefComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "A tennis ball."
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "HasBriefComments": true
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Medium",
-// JSON-INDEX-NEXT: "Value": "1"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "A football."
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "Large",
-// JSON-INDEX-NEXT: "Value": "2"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "Name": "Size",
-// JSON-INDEX-NEXT: "Scoped": false,
-// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "BaseType": {
-// JSON-INDEX-NEXT: "Name": "long long",
-// JSON-INDEX-NEXT: "QualName": "long long",
-// JSON-INDEX-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "BriefComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "Very long number"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "HasBriefComments": true
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "HasComments": true,
-// JSON-INDEX-NEXT: "InfoType": "enum",
-// JSON-INDEX-NEXT: "Location": {
-// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-INDEX-NEXT: "LineNumber": 43
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Members": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Description": {
-// JSON-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-INDEX-NEXT: "ParagraphComments": [
-// JSON-INDEX-NEXT: [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "TextComment": "A very large value"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: ]
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-INDEX-NEXT: "Name": "BigVal",
-// JSON-INDEX-NEXT: "ValueExpr": "999999999999"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "Scoped": false,
-// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "InfoType": "enum",
-// JSON-INDEX-NEXT: "Location": {
-// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-INDEX-NEXT: "LineNumber": 47
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: "Members": [
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Name": "RedUserSpecified",
-// JSON-INDEX-NEXT: "ValueExpr": "'A'"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "Name": "GreenUserSpecified",
-// JSON-INDEX-NEXT: "ValueExpr": "2"
-// JSON-INDEX-NEXT: },
-// JSON-INDEX-NEXT: {
-// JSON-INDEX-NEXT: "End": true,
-// JSON-INDEX-NEXT: "Name": "BlueUserSpecified",
-// JSON-INDEX-NEXT: "ValueExpr": "'C'"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-// JSON-INDEX-NEXT: "Name": "ColorUserSpecified",
-// JSON-INDEX-NEXT: "Scoped": false,
-// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-INDEX-NEXT: }
-// JSON-INDEX-NEXT: ],
-
-// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-INDEX-NEXT: <div>
-// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum Color</code></pre>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: <table class="table-wrapper">
-// HTML-INDEX-NEXT: <tbody>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <th>Name</th>
-// HTML-INDEX-NEXT: <th>Value</th>
-// HTML-INDEX-NEXT: <th>Comments</th>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Red</td>
-// HTML-INDEX-NEXT: <td>0</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 1<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Green</td>
-// HTML-INDEX-NEXT: <td>1</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 2<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Blue</td>
-// HTML-INDEX-NEXT: <td>2</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 3<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: </tbody>
-// HTML-INDEX-NEXT: </table>
-// HTML-INDEX-NEXT: <div class="doc-card">
-// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
-// HTML-INDEX-NEXT: <p>For specifying RGB colors</p>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX: </div>
-
-// MD-INDEX: ## Enums
-// MD-INDEX: | enum Color |
-// MD-INDEX: | Name | Value | Comments |
-// MD-INDEX: |---|---|---|
-// MD-INDEX: | Red | 0 | Comment 1 |
-// MD-INDEX: | Green | 1 | Comment 2 |
-// MD-INDEX: | Blue | 2 | Comment 3 |
-// MD-INDEX: **brief** For specifying RGB colors
-
-// MD-MUSTACHE-INDEX: ## Enums
-// MD-MUSTACHE-INDEX: | enum Color |
-// MD-MUSTACHE-INDEX: --
-// MD-MUSTACHE-INDEX: | Red |
-// MD-MUSTACHE-INDEX: | Green |
-// MD-MUSTACHE-INDEX: | Blue |
-// MD-MUSTACHE-INDEX: **brief** For specifying RGB colors
-
-// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-INDEX-NEXT: <div>
-// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum class Shapes</code></pre>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: <table class="table-wrapper">
-// HTML-INDEX-NEXT: <tbody>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <th>Name</th>
-// HTML-INDEX-NEXT: <th>Value</th>
-// HTML-INDEX-NEXT: <th>Comments</th>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Circle</td>
-// HTML-INDEX-NEXT: <td>0</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 1<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Rectangle</td>
-// HTML-INDEX-NEXT: <td>1</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 2<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Triangle</td>
-// HTML-INDEX-NEXT: <td>2</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Comment 3<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: </tbody>
-// HTML-INDEX-NEXT: </table>
-// HTML-INDEX-NEXT: <div class="doc-card">
-// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
-// HTML-INDEX-NEXT: <p>Shape Types</p>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX: </div>
-
-// MD-INDEX: | enum class Shapes |
-// MD-INDEX: | Name | Value | Comments |
-// MD-INDEX: |---|---|---|
-// MD-INDEX: | Circle | 0 | Comment 1 |
-// MD-INDEX: | Rectangle | 1 | Comment 2 |
-// MD-INDEX: | Triangle | 2 | Comment 3 |
-// MD-INDEX: **brief** Shape Types
-
-// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-INDEX-NEXT: <div>
-// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum Size : uint8_t</code></pre>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: <table class="table-wrapper">
-// HTML-INDEX-NEXT: <tbody>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <th>Name</th>
-// HTML-INDEX-NEXT: <th>Value</th>
-// HTML-INDEX-NEXT: <th>Comments</th>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Small</td>
-// HTML-INDEX-NEXT: <td>0</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: A pearl.<br>
-// HTML-INDEX-NEXT: Pearls are quite small.<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: Pearls are used in jewelry.<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Medium</td>
-// HTML-INDEX-NEXT: <td>1</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">A tennis ball.</p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>Large</td>
-// HTML-INDEX-NEXT: <td>2</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: A football.<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: </tbody>
-// HTML-INDEX-NEXT: </table>
-// HTML-INDEX-NEXT: <div class="doc-card">
-// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
-// HTML-INDEX-NEXT: <p>Specify the size</p>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX: </div>
-
-// MD-INDEX: | enum Size : uint8_t |
-// MD-INDEX: | Name | Value | Comments |
-// MD-INDEX: |---|---|---|
-// MD-INDEX: | Small | 0 | A pearl.<br>Pearls are quite small.<br><br>Pearls are used in jewelry. |
-// MD-INDEX: | Medium | 1 | A tennis ball. |
-// MD-INDEX: | Large | 2 | A football. |
-// MD-INDEX: **brief** Specify the size
-
-// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-INDEX-NEXT: <div>
-// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum (unnamed) : long long</code></pre>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: <table class="table-wrapper">
-// HTML-INDEX-NEXT: <tbody>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <th>Name</th>
-// HTML-INDEX-NEXT: <th>Value</th>
-// HTML-INDEX-NEXT: <th>Comments</th>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>BigVal</td>
-// HTML-INDEX-NEXT: <td>999999999999</td>
-// HTML-INDEX-NEXT: <td>
-// HTML-INDEX-NEXT: <p class="paragraph-container">
-// HTML-INDEX-NEXT: A very large value<br>
-// HTML-INDEX-NEXT: </p>
-// HTML-INDEX-NEXT: </td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: </tbody>
-// HTML-INDEX-NEXT: </table>
-// HTML-INDEX-NEXT: <div class="doc-card">
-// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
-// HTML-INDEX-NEXT: <p>Very long number</p>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX: </div>
-
-// MD-INDEX: | enum (unnamed) : long long |
-// MD-INDEX: | Name | Value | Comments |
-// MD-INDEX: |---|---|---|
-// MD-INDEX: | BigVal | 999999999999 | A very large value |
-// MD-INDEX: **brief** Very long number
-
-// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-INDEX-NEXT: <div>
-// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum ColorUserSpecified</code></pre>
-// HTML-INDEX-NEXT: </div>
-// HTML-INDEX-NEXT: <table class="table-wrapper">
-// HTML-INDEX-NEXT: <tbody>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <th>Name</th>
-// HTML-INDEX-NEXT: <th>Value</th>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>RedUserSpecified</td>
-// HTML-INDEX-NEXT: <td>'A'</td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>GreenUserSpecified</td>
-// HTML-INDEX-NEXT: <td>2</td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: <tr>
-// HTML-INDEX-NEXT: <td>BlueUserSpecified</td>
-// HTML-INDEX-NEXT: <td>'C'</td>
-// HTML-INDEX-NEXT: </tr>
-// HTML-INDEX-NEXT: </tbody>
-// HTML-INDEX-NEXT: </table>
-// HTML-INDEX: </div>
-
-// MD-INDEX: | enum ColorUserSpecified |
-// MD-INDEX: | Name | Value |
-// MD-INDEX: |---|---|
-// MD-INDEX: | RedUserSpecified | 65 |
-// MD-INDEX: | GreenUserSpecified | 2 |
-// MD-INDEX: | BlueUserSpecified | 67 |
-
-// MD-MUSTACHE-INDEX: | enum ColorUserSpecified |
-// MD-MUSTACHE-INDEX: --
-// MD-MUSTACHE-INDEX: | RedUserSpecified |
-// MD-MUSTACHE-INDEX: | GreenUserSpecified |
-// MD-MUSTACHE-INDEX: | BlueUserSpecified |
-
-// HTML-PERM-LABEL: <section id="Enums" class="section-container">
-// HTML-PERM-NEXT: <h2>Enumerations</h2>
-// HTML-PERM-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-PERM-NEXT: <div>
-// HTML-PERM-NEXT: <pre><code class="language-cpp code-clang-doc">enum (unnamed)</code></pre>
-// HTML-PERM-NEXT: </div>
-// HTML-PERM-NEXT: <table class="table-wrapper">
-// HTML-PERM-NEXT: <tbody>
-// HTML-PERM-NEXT: <tr>
-// HTML-PERM-NEXT: <th>Name</th>
-// HTML-PERM-NEXT: <th>Value</th>
-// HTML-PERM-NEXT: <th>Comments</th>
-// HTML-PERM-NEXT: </tr>
-// HTML-PERM-NEXT: <tr>
-// HTML-PERM-NEXT: <td>Read</td>
-// HTML-PERM-NEXT: <td>1</td>
-// HTML-PERM-NEXT: <td>
-// HTML-PERM-NEXT: <p class="paragraph-container">
-// HTML-PERM-NEXT: Permission to READ r<br>
-// HTML-PERM-NEXT: </p>
-// HTML-PERM-NEXT: </td>
-// HTML-PERM-NEXT: </tr>
-// HTML-PERM-NEXT: <tr>
-// HTML-PERM-NEXT: <td>Write</td>
-// HTML-PERM-NEXT: <td>2</td>
-// HTML-PERM-NEXT: <td>
-// HTML-PERM-NEXT: <p class="paragraph-container">
-// HTML-PERM-NEXT: Permission to WRITE w<br>
-// HTML-PERM-NEXT: </p>
-// HTML-PERM-NEXT: </td>
-// HTML-PERM-NEXT: </tr>
-// HTML-PERM-NEXT: <tr>
-// HTML-PERM-NEXT: <td>Execute</td>
-// HTML-PERM-NEXT: <td>4</td>
-// HTML-PERM-NEXT: <td>
-// HTML-PERM-NEXT: <p class="paragraph-container">
-// HTML-PERM-NEXT: Permission to EXECUTE x<br>
-// HTML-PERM-NEXT: </p>
-// HTML-PERM-NEXT: </td>
-// HTML-PERM-NEXT: </tr>
-// HTML-PERM-NEXT: </tbody>
-// HTML-PERM-NEXT: </table>
-// HTML-PERM-NEXT: <div class="doc-card">
-// HTML-PERM-NEXT: <div class="nested-delimiter-container">
-// HTML-PERM-NEXT: <p>File permission flags</p>
-// HTML-PERM-NEXT: </div>
-// HTML-PERM: </section>
-
-// MD-PERM: | enum (unnamed) |
-// MD-PERM: | Name | Value | Comments |
-// MD-PERM: |---|---|---|
-// MD-PERM: | Read | 1 | Permission to READ r |
-// MD-PERM: | Write | 2 | Permission to WRITE w |
-// MD-PERM: | Execute | 4 | Permission to EXECUTE x |
-// MD-PERM: **brief** File permission flags
-
-// HTML-ANIMAL-LABEL: <section id="Enums" class="section-container">
-// HTML-ANIMAL-NEXT: <h2>Enumerations</h2>
-// HTML-ANIMAL-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-ANIMAL-NEXT: <div>
-// HTML-ANIMAL-NEXT: <pre><code class="language-cpp code-clang-doc">enum AnimalType</code></pre>
-// HTML-ANIMAL-NEXT: </div>
-// HTML-ANIMAL-NEXT: <table class="table-wrapper">
-// HTML-ANIMAL-NEXT: <tbody>
-// HTML-ANIMAL-NEXT: <tr>
-// HTML-ANIMAL-NEXT: <th>Name</th>
-// HTML-ANIMAL-NEXT: <th>Value</th>
-// HTML-ANIMAL-NEXT: <th>Comments</th>
-// HTML-ANIMAL-NEXT: </tr>
-// HTML-ANIMAL-NEXT: <tr>
-// HTML-ANIMAL-NEXT: <td>Dog</td>
-// HTML-ANIMAL-NEXT: <td>0</td>
-// HTML-ANIMAL-NEXT: <td>
-// HTML-ANIMAL-NEXT: <p class="paragraph-container">
-// HTML-ANIMAL-NEXT: Man's best friend<br>
-// HTML-ANIMAL-NEXT: </p>
-// HTML-ANIMAL-NEXT: </td>
-// HTML-ANIMAL-NEXT: </tr>
-// HTML-ANIMAL-NEXT: <tr>
-// HTML-ANIMAL-NEXT: <td>Cat</td>
-// HTML-ANIMAL-NEXT: <td>1</td>
-// HTML-ANIMAL-NEXT: <td>
-// HTML-ANIMAL-NEXT: <p class="paragraph-container">
-// HTML-ANIMAL-NEXT: Man's other best friend<br>
-// HTML-ANIMAL-NEXT: </p>
-// HTML-ANIMAL-NEXT: </td>
-// HTML-ANIMAL-NEXT: </tr>
-// HTML-ANIMAL-NEXT: <tr>
-// HTML-ANIMAL-NEXT: <td>Iguana</td>
-// HTML-ANIMAL-NEXT: <td>2</td>
-// HTML-ANIMAL-NEXT: <td>
-// HTML-ANIMAL-NEXT: <p class="paragraph-container">
-// HTML-ANIMAL-NEXT: A lizard<br>
-// HTML-ANIMAL-NEXT: </p>
-// HTML-ANIMAL-NEXT: </td>
-// HTML-ANIMAL-NEXT: </tr>
-// HTML-ANIMAL-NEXT: </tbody>
-// HTML-ANIMAL-NEXT: </table>
-// HTML-ANIMAL-NEXT: <div class="doc-card">
-// HTML-ANIMAL-NEXT: <div class="nested-delimiter-container">
-// HTML-ANIMAL-NEXT: <p>specify what animal the class is</p>
-// HTML-ANIMAL-NEXT: </div>
-// HTML-ANIMAL-NEXT: </div>
-// HTML-ANIMAL: </div>
-// HTML-ANIMAL-NEXT: </section>
-
-// MD-ANIMAL: # class Animals
-// MD-ANIMAL: ## Enums
-// MD-ANIMAL: | enum AnimalType |
-// MD-ANIMAL: | Name | Value | Comments |
-// MD-ANIMAL: |---|---|---|
-// MD-ANIMAL: | Dog | 0 | Man's best friend |
-// MD-ANIMAL: | Cat | 1 | Man's other best friend |
-// MD-ANIMAL: | Iguana | 2 | A lizard |
-// MD-ANIMAL: **brief** specify what animal the class is
-
-// MD-MUSTACHE-ANIMAL: # class Animals
-// MD-MUSTACHE-ANIMAL: ## Enums
-// MD-MUSTACHE-ANIMAL: | enum AnimalType |
-// MD-MUSTACHE-ANIMAL: --
-// MD-MUSTACHE-ANIMAL: | Dog |
-// MD-MUSTACHE-ANIMAL: | Cat |
-// MD-MUSTACHE-ANIMAL: | Iguana |
-// MD-MUSTACHE-ANIMAL: **brief** specify what animal the class is
-
-// HTML-VEHICLES-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-VEHICLES-NEXT: <div>
-// HTML-VEHICLES-NEXT: <pre><code class="language-cpp code-clang-doc">enum Car</code></pre>
-// HTML-VEHICLES-NEXT: </div>
-// HTML-VEHICLES-NEXT: <table class="table-wrapper">
-// HTML-VEHICLES-NEXT: <tbody>
-// HTML-VEHICLES-NEXT: <tr>
-// HTML-VEHICLES-NEXT: <th>Name</th>
-// HTML-VEHICLES-NEXT: <th>Value</th>
-// HTML-VEHICLES-NEXT: <th>Comments</th>
-// HTML-VEHICLES-NEXT: </tr>
-// HTML-VEHICLES-NEXT: <tr>
-// HTML-VEHICLES-NEXT: <td>Sedan</td>
-// HTML-VEHICLES-NEXT: <td>0</td>
-// HTML-VEHICLES-NEXT: <td>
-// HTML-VEHICLES-NEXT: <p class="paragraph-container">
-// HTML-VEHICLES-NEXT: Comment 1<br>
-// HTML-VEHICLES-NEXT: </p>
-// HTML-VEHICLES-NEXT: </td>
-// HTML-VEHICLES-NEXT: </tr>
-// HTML-VEHICLES-NEXT: <tr>
-// HTML-VEHICLES-NEXT: <td>SUV</td>
-// HTML-VEHICLES-NEXT: <td>1</td>
-// HTML-VEHICLES-NEXT: <td>
-// HTML-VEHICLES-NEXT: <p class="paragraph-container">
-// HTML-VEHICLES-NEXT: Comment 2<br>
-// HTML-VEHICLES-NEXT: </p>
-// HTML-VEHICLES-NEXT: </td>
-// HTML-VEHICLES-NEXT: </tr>
-// HTML-VEHICLES-NEXT: <tr>
-// HTML-VEHICLES-NEXT: <td>Pickup</td>
-// HTML-VEHICLES-NEXT: <td>2</td>
-// HTML-VEHICLES-NEXT: <td> -- </td>
-// HTML-VEHICLES-NEXT: </tr>
-// HTML-VEHICLES-NEXT: <tr>
-// HTML-VEHICLES-NEXT: <td>Hatchback</td>
-// HTML-VEHICLES-NEXT: <td>3</td>
-// HTML-VEHICLES-NEXT: <td>
-// HTML-VEHICLES-NEXT: <p class="paragraph-container">
-// HTML-VEHICLES-NEXT: Comment 4<br>
-// HTML-VEHICLES-NEXT: </p>
-// HTML-VEHICLES-NEXT: </td>
-// HTML-VEHICLES-NEXT: </tr>
-// HTML-VEHICLES-NEXT: </tbody>
-// HTML-VEHICLES-NEXT: </table>
-// HTML-VEHICLES-NEXT: <div class="doc-card">
-// HTML-VEHICLES-NEXT: <div class="nested-delimiter-container">
-// HTML-VEHICLES-NEXT: <p>specify type of car</p>
-// HTML-VEHICLES-NEXT: </div>
-// HTML-VEHICLES-NEXT: </div>
-// HTML-VEHICLES: </div>
-
-// MD-VEHICLES: # namespace Vehicles
-// MD-VEHICLES: ## Enums
-// MD-VEHICLES: | enum Car |
-// MD-VEHICLES: | Name | Value | Comments |
-// MD-VEHICLES: |---|---|---|
-// MD-VEHICLES: | Sedan | 0 | Comment 1 |
-// MD-VEHICLES: | SUV | 1 | Comment 2 |
-// MD-VEHICLES: | Pickup | 2 | -- |
-// MD-VEHICLES: | Hatchback | 3 | Comment 4 |
-// MD-VEHICLES: **brief** specify type of car
-
-// MD-MUSTACHE-VEHICLES: # namespace Vehicles
-// MD-MUSTACHE-VEHICLES: ## Enums
-// MD-MUSTACHE-VEHICLES: | enum Car |
-// MD-MUSTACHE-VEHICLES: --
-// MD-MUSTACHE-VEHICLES: | Sedan |
-// MD-MUSTACHE-VEHICLES: | SUV |
-// MD-MUSTACHE-VEHICLES: | Pickup |
-// MD-MUSTACHE-VEHICLES: | Hatchback |
-// MD-MUSTACHE-VEHICLES: **brief** specify type of car
-
-// JSON-VEHICLES-INDEX-LABEL: "DocumentationFileName": "index",
-// JSON-VEHICLES-INDEX-NEXT: "Enums": [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "Description": {
-// JSON-VEHICLES-INDEX-NEXT: "BriefComments": [
-// JSON-VEHICLES-INDEX-NEXT: [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "TextComment": "specify type of car"
-// JSON-VEHICLES-INDEX-NEXT: }
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: ],
-// JSON-VEHICLES-INDEX-NEXT: "HasBriefComments": true
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: "End": true,
-// JSON-VEHICLES-INDEX-NEXT: "HasComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "InfoType": "enum",
-// JSON-VEHICLES-INDEX-NEXT: "Location": {
-// JSON-VEHICLES-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
-// JSON-VEHICLES-INDEX-NEXT: "LineNumber": 82
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: "Members": [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "Description": {
-// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
-// JSON-VEHICLES-INDEX-NEXT: [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 1"
-// JSON-VEHICLES-INDEX-NEXT: }
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "Name": "Sedan",
-// JSON-VEHICLES-INDEX-NEXT: "Value": "0"
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "Description": {
-// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
-// JSON-VEHICLES-INDEX-NEXT: [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 2"
-// JSON-VEHICLES-INDEX-NEXT: }
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "Name": "SUV",
-// JSON-VEHICLES-INDEX-NEXT: "Value": "1"
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "Name": "Pickup",
-// JSON-VEHICLES-INDEX-NEXT: "Value": "2"
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "Description": {
-// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
-// JSON-VEHICLES-INDEX-NEXT: [
-// JSON-VEHICLES-INDEX-NEXT: {
-// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 4"
-// JSON-VEHICLES-INDEX-NEXT: }
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: ]
-// JSON-VEHICLES-INDEX-NEXT: },
-// JSON-VEHICLES-INDEX-NEXT: "End": true,
-// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
-// JSON-VEHICLES-INDEX-NEXT: "Name": "Hatchback",
-// JSON-VEHICLES-INDEX-NEXT: "Value": "3"
-// JSON-VEHICLES-INDEX-NEXT: }
-// JSON-VEHICLES-INDEX-NEXT: ],
-// JSON-VEHICLES-INDEX-NEXT: "Name": "Car",
-// JSON-VEHICLES-INDEX-NEXT: "Namespace": [
-// JSON-VEHICLES-INDEX-NEXT: "Vehicles"
-// JSON-VEHICLES-INDEX-NEXT: ],
-// JSON-VEHICLES-INDEX-NEXT: "Scoped": false,
-// JSON-VEHICLES-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-VEHICLES-INDEX-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/html/array-type.cpp b/clang-tools-extra/test/clang-doc/html/array-type.cpp
new file mode 100644
index 0000000000000..d370ef3a1ab0a
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/array-type.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/array-type.cpp
+// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
+
+// HTML: <pre><code class="language-cpp code-clang-doc">void qux (int (&)[5] arr)</code></pre>
+
diff --git a/clang-tools-extra/test/clang-doc/html/class-partial-specialization.cpp b/clang-tools-extra/test/clang-doc/html/class-partial-specialization.cpp
new file mode 100644
index 0000000000000..f8130e97e6832
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/class-partial-specialization.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/class-partial-specialization.cpp
+// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/_ZTV7MyClassIPT_E.html
+
+// HTML: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre>
+// HTML: <h1 class="hero__title-large">struct MyClass</h1>
+
diff --git a/clang-tools-extra/test/clang-doc/html/class-specialization.cpp b/clang-tools-extra/test/clang-doc/html/class-specialization.cpp
new file mode 100644
index 0000000000000..024ee8ee24bd4
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/class-specialization.cpp
@@ -0,0 +1,19 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/class-specialization.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=HTML-NAMESPACE
+
+// HTML-NAMESPACE: <section id="Records" class="section-container">
+// HTML-NAMESPACE-NEXT: <h2>Records</h2>
+// HTML-NAMESPACE-NEXT: <ul class="class-container">
+// HTML-NAMESPACE-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-NAMESPACE-NEXT: <a href="_ZTV7MyClass.html">
+// HTML-NAMESPACE-NEXT: <pre><code class="language-cpp code-clang-doc">class MyClass</code></pre>
+// HTML-NAMESPACE-NEXT: </a>
+// HTML-NAMESPACE-NEXT: </li>
+// HTML-NAMESPACE-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-NAMESPACE-NEXT: <a href="_ZTV7MyClassIiE.html">
+// HTML-NAMESPACE-NEXT: <pre><code class="language-cpp code-clang-doc">class MyClass<int></code></pre>
+// HTML-NAMESPACE-NEXT: </a>
+// HTML-NAMESPACE-NEXT: </li>
+// HTML-NAMESPACE-NEXT: </ul>
+// HTML-NAMESPACE-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/html/class.cpp b/clang-tools-extra/test/clang-doc/html/class.cpp
new file mode 100644
index 0000000000000..ddd1a7081a965
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/class.cpp
@@ -0,0 +1,59 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/class.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html -check-prefix=HTML
+
+// HTML: <a class="sidebar-item" href="#Records">Records</a>
+// HTML-NEXT: </summary>
+// HTML-NEXT: <ul>
+// HTML-NEXT: <li class="sidebar-item-container">
+// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">NestedClass</a>
+// HTML-NEXT: </li>
+// HTML-NEXT: </ul>
+// HTML-NEXT: </details>
+// HTML: <a class="sidebar-item" href="#Friends">Friends</a>
+// HTML-NEXT: </summary>
+// HTML-NEXT: <ul>
+// HTML-NEXT: <li class="sidebar-item-container">
+// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">friendFunction</a>
+// HTML-NEXT: </li>
+// HTML-NEXT: <li class="sidebar-item-container">
+// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Foo</a>
+// HTML-NEXT: </li>
+// HTML-NEXT: </ul>
+// HTML-NEXT: </details>
+// HTML: <section id="ProtectedMembers" class="section-container">
+// HTML-NEXT: <h2>Protected Members</h2>
+// HTML-NEXT: <div>
+// HTML-NEXT: <div id="ProtectedField" class="delimiter-container">
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc" >int ProtectedField</code></pre>
+// HTML-NEXT: </div>
+// HTML-NEXT: </div>
+// HTML-NEXT: </section>
+// HTML: <section id="ProtectedMethods" class="section-container">
+// HTML-NEXT: <h2>Protected Methods</h2>
+// HTML-NEXT: <div>
+// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">int protectedMethod ()</code></pre>
+// HTML-NEXT: </div>
+// HTML-NEXT: </div>
+// HTML-NEXT: </section>
+// HTML: <section id="Records" class="section-container">
+// HTML-NEXT: <h2>Records</h2>
+// HTML-NEXT: <ul class="class-container">
+// HTML-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-NEXT: <a href="MyClass/_ZTVN7MyClass11NestedClassE.html">
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">class NestedClass</code></pre>
+// HTML-NEXT: </a>
+// HTML-NEXT: </li>
+// HTML-NEXT: </ul>
+// HTML-NEXT: </section>
+// HTML: <section id="Friends" class="section-container">
+// HTML-NEXT: <h2>Friends</h2>
+// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre>
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void MyClass (int )</code></pre>
+// HTML-NEXT: </div>
+// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">class Foo</code></pre>
+// HTML-NEXT: </div>
+// HTML-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/html/comments-in-macros.cpp b/clang-tools-extra/test/clang-doc/html/comments-in-macros.cpp
new file mode 100644
index 0000000000000..25c10876396f7
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/comments-in-macros.cpp
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %S/../Inputs/comments-in-macros.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html --check-prefix=HTML-MYCLASS-LINE
+// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html --check-prefix=HTML-MYCLASS
+
+// HTML-MYCLASS: <pre><code class="language-cpp code-clang-doc">int Add (int a, int b)</code></pre>
+// HTML-MYCLASS: <div class="doc-card">
+// HTML-MYCLASS: <div class="nested-delimiter-container">
+// HTML-MYCLASS: <p>Declare a method to calculate the sum of two numbers</p>
+// HTML-MYCLASS: </div>
+
+// HTML-MYCLASS-LINE: <p>Defined at line 7 of file {{.*}}comments-in-macros.cpp</p>
diff --git a/clang-tools-extra/test/clang-doc/html/compound-constraints.cpp b/clang-tools-extra/test/clang-doc/html/compound-constraints.cpp
new file mode 100644
index 0000000000000..0548540c8289e
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/compound-constraints.cpp
@@ -0,0 +1,83 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --extra-arg -std=c++20 --output=%t --doxygen --format=html --executor=standalone %S/../Inputs/compound-constraints.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=CHECK-HTML
+
+// CHECK-HTML: <a class="sidebar-item" href="#Concepts">Concepts</a>
+// CHECK-HTML-NEXT: </summary>
+// CHECK-HTML-NEXT: <ul>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Incrementable</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Decrementable</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">PreIncrementable</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: <li class="sidebar-item-container">
+// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">PreDecrementable</a>
+// CHECK-HTML-NEXT: </li>
+// CHECK-HTML-NEXT: </ul>
+// CHECK-HTML: <section id="Concepts" class="section-container">
+// CHECK-HTML-NEXT: <h2>Concepts</h2>
+// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> Incrementable requires (T a) { a++; }</code></pre>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <p>Concept for an incrementable value</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <b>T</b> A value that can be incremented.
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <p>Defined at line 4 of file {{.*}}compound-constraints.cpp</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> Decrementable requires (T a) { a--; }</code></pre>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <p>Concept for a decrementable value</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <b>T</b> A value that can be decremented
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <p>Defined at line 10 of file {{.*}}compound-constraints.cpp</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> PreIncrementable requires (T a) { ++a; }</code></pre>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <p>Concept for a pre-incrementable value</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <b>T</b> A value that can be pre-incremented
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <p>Defined at line 16 of file {{.*}}compound-constraints.cpp</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> PreDecrementable requires (T a) { --a; }</code></pre>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <p>Concept for a -pre-decrementable value</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
+// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
+// CHECK-HTML-NEXT: <div>
+// CHECK-HTML-NEXT: <b>T</b> A value that can be pre-decremented
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: <p>Defined at line 22 of file {{.*}}compound-constraints.cpp</p>
+// CHECK-HTML-NEXT: </div>
+// CHECK-HTML-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/conversion_function.cpp b/clang-tools-extra/test/clang-doc/html/conversion_function.cpp
similarity index 59%
rename from clang-tools-extra/test/clang-doc/conversion_function.cpp
rename to clang-tools-extra/test/clang-doc/html/conversion_function.cpp
index 24115fc39451f..19628f02ec89b 100644
--- a/clang-tools-extra/test/clang-doc/conversion_function.cpp
+++ b/clang-tools-extra/test/clang-doc/html/conversion_function.cpp
@@ -1,18 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-
-// RUN: clang-doc --output=%t --executor=standalone %s
-// RUN: find %t/ -regex ".*/[0-9A-F]*.yaml" -exec cat {} ";" | FileCheck %s --check-prefix=CHECK-YAML
-
-// RUN: clang-doc --format=html --output=%t --executor=standalone %s
+// RUN: clang-doc --format=html --output=%t --executor=standalone %S/../Inputs/conversion_function.cpp
// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV8MyStruct.html --check-prefix=CHECK-HTML
-template <typename T>
-struct MyStruct {
- operator T();
-};
-
// Output correct conversion names.
-// CHECK-YAML: Name: 'operator T'
// CHECK-HTML: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
// CHECK-HTML: <pre><code class="language-cpp code-clang-doc">T operator T ()</code></pre>
diff --git a/clang-tools-extra/test/clang-doc/html/enum.cpp b/clang-tools-extra/test/clang-doc/html/enum.cpp
new file mode 100644
index 0000000000000..c2f1a28444d43
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/enum.cpp
@@ -0,0 +1,368 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %S/../Inputs/enum.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=HTML-INDEX
+// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7Animals.html --check-prefix=HTML-ANIMAL
+// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV15FilePermissions.html --check-prefix=HTML-PERM
+// RUN: FileCheck %s < %t/html/Vehicles/index.html --check-prefix=HTML-VEHICLES
+
+
+// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-INDEX-NEXT: <div>
+// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum Color</code></pre>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: <table class="table-wrapper">
+// HTML-INDEX-NEXT: <tbody>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <th>Name</th>
+// HTML-INDEX-NEXT: <th>Value</th>
+// HTML-INDEX-NEXT: <th>Comments</th>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Red</td>
+// HTML-INDEX-NEXT: <td>0</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 1<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Green</td>
+// HTML-INDEX-NEXT: <td>1</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 2<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Blue</td>
+// HTML-INDEX-NEXT: <td>2</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 3<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: </tbody>
+// HTML-INDEX-NEXT: </table>
+// HTML-INDEX-NEXT: <div class="doc-card">
+// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
+// HTML-INDEX-NEXT: <p>For specifying RGB colors</p>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX: </div>
+
+
+
+// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-INDEX-NEXT: <div>
+// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum class Shapes</code></pre>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: <table class="table-wrapper">
+// HTML-INDEX-NEXT: <tbody>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <th>Name</th>
+// HTML-INDEX-NEXT: <th>Value</th>
+// HTML-INDEX-NEXT: <th>Comments</th>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Circle</td>
+// HTML-INDEX-NEXT: <td>0</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 1<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Rectangle</td>
+// HTML-INDEX-NEXT: <td>1</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 2<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Triangle</td>
+// HTML-INDEX-NEXT: <td>2</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Comment 3<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: </tbody>
+// HTML-INDEX-NEXT: </table>
+// HTML-INDEX-NEXT: <div class="doc-card">
+// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
+// HTML-INDEX-NEXT: <p>Shape Types</p>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX: </div>
+
+
+// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-INDEX-NEXT: <div>
+// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum Size : uint8_t</code></pre>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: <table class="table-wrapper">
+// HTML-INDEX-NEXT: <tbody>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <th>Name</th>
+// HTML-INDEX-NEXT: <th>Value</th>
+// HTML-INDEX-NEXT: <th>Comments</th>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Small</td>
+// HTML-INDEX-NEXT: <td>0</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: A pearl.<br>
+// HTML-INDEX-NEXT: Pearls are quite small.<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: Pearls are used in jewelry.<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Medium</td>
+// HTML-INDEX-NEXT: <td>1</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">A tennis ball.</p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>Large</td>
+// HTML-INDEX-NEXT: <td>2</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: A football.<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: </tbody>
+// HTML-INDEX-NEXT: </table>
+// HTML-INDEX-NEXT: <div class="doc-card">
+// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
+// HTML-INDEX-NEXT: <p>Specify the size</p>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX: </div>
+
+
+// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-INDEX-NEXT: <div>
+// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum (unnamed) : long long</code></pre>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: <table class="table-wrapper">
+// HTML-INDEX-NEXT: <tbody>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <th>Name</th>
+// HTML-INDEX-NEXT: <th>Value</th>
+// HTML-INDEX-NEXT: <th>Comments</th>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>BigVal</td>
+// HTML-INDEX-NEXT: <td>999999999999</td>
+// HTML-INDEX-NEXT: <td>
+// HTML-INDEX-NEXT: <p class="paragraph-container">
+// HTML-INDEX-NEXT: A very large value<br>
+// HTML-INDEX-NEXT: </p>
+// HTML-INDEX-NEXT: </td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: </tbody>
+// HTML-INDEX-NEXT: </table>
+// HTML-INDEX-NEXT: <div class="doc-card">
+// HTML-INDEX-NEXT: <div class="nested-delimiter-container">
+// HTML-INDEX-NEXT: <p>Very long number</p>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX: </div>
+
+
+// HTML-INDEX-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-INDEX-NEXT: <div>
+// HTML-INDEX-NEXT: <pre><code class="language-cpp code-clang-doc">enum ColorUserSpecified</code></pre>
+// HTML-INDEX-NEXT: </div>
+// HTML-INDEX-NEXT: <table class="table-wrapper">
+// HTML-INDEX-NEXT: <tbody>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <th>Name</th>
+// HTML-INDEX-NEXT: <th>Value</th>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>RedUserSpecified</td>
+// HTML-INDEX-NEXT: <td>'A'</td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>GreenUserSpecified</td>
+// HTML-INDEX-NEXT: <td>2</td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: <tr>
+// HTML-INDEX-NEXT: <td>BlueUserSpecified</td>
+// HTML-INDEX-NEXT: <td>'C'</td>
+// HTML-INDEX-NEXT: </tr>
+// HTML-INDEX-NEXT: </tbody>
+// HTML-INDEX-NEXT: </table>
+// HTML-INDEX: </div>
+
+
+
+// HTML-PERM-LABEL: <section id="Enums" class="section-container">
+// HTML-PERM-NEXT: <h2>Enumerations</h2>
+// HTML-PERM-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-PERM-NEXT: <div>
+// HTML-PERM-NEXT: <pre><code class="language-cpp code-clang-doc">enum (unnamed)</code></pre>
+// HTML-PERM-NEXT: </div>
+// HTML-PERM-NEXT: <table class="table-wrapper">
+// HTML-PERM-NEXT: <tbody>
+// HTML-PERM-NEXT: <tr>
+// HTML-PERM-NEXT: <th>Name</th>
+// HTML-PERM-NEXT: <th>Value</th>
+// HTML-PERM-NEXT: <th>Comments</th>
+// HTML-PERM-NEXT: </tr>
+// HTML-PERM-NEXT: <tr>
+// HTML-PERM-NEXT: <td>Read</td>
+// HTML-PERM-NEXT: <td>1</td>
+// HTML-PERM-NEXT: <td>
+// HTML-PERM-NEXT: <p class="paragraph-container">
+// HTML-PERM-NEXT: Permission to READ r<br>
+// HTML-PERM-NEXT: </p>
+// HTML-PERM-NEXT: </td>
+// HTML-PERM-NEXT: </tr>
+// HTML-PERM-NEXT: <tr>
+// HTML-PERM-NEXT: <td>Write</td>
+// HTML-PERM-NEXT: <td>2</td>
+// HTML-PERM-NEXT: <td>
+// HTML-PERM-NEXT: <p class="paragraph-container">
+// HTML-PERM-NEXT: Permission to WRITE w<br>
+// HTML-PERM-NEXT: </p>
+// HTML-PERM-NEXT: </td>
+// HTML-PERM-NEXT: </tr>
+// HTML-PERM-NEXT: <tr>
+// HTML-PERM-NEXT: <td>Execute</td>
+// HTML-PERM-NEXT: <td>4</td>
+// HTML-PERM-NEXT: <td>
+// HTML-PERM-NEXT: <p class="paragraph-container">
+// HTML-PERM-NEXT: Permission to EXECUTE x<br>
+// HTML-PERM-NEXT: </p>
+// HTML-PERM-NEXT: </td>
+// HTML-PERM-NEXT: </tr>
+// HTML-PERM-NEXT: </tbody>
+// HTML-PERM-NEXT: </table>
+// HTML-PERM-NEXT: <div class="doc-card">
+// HTML-PERM-NEXT: <div class="nested-delimiter-container">
+// HTML-PERM-NEXT: <p>File permission flags</p>
+// HTML-PERM-NEXT: </div>
+// HTML-PERM: </section>
+
+
+// HTML-ANIMAL-LABEL: <section id="Enums" class="section-container">
+// HTML-ANIMAL-NEXT: <h2>Enumerations</h2>
+// HTML-ANIMAL-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-ANIMAL-NEXT: <div>
+// HTML-ANIMAL-NEXT: <pre><code class="language-cpp code-clang-doc">enum AnimalType</code></pre>
+// HTML-ANIMAL-NEXT: </div>
+// HTML-ANIMAL-NEXT: <table class="table-wrapper">
+// HTML-ANIMAL-NEXT: <tbody>
+// HTML-ANIMAL-NEXT: <tr>
+// HTML-ANIMAL-NEXT: <th>Name</th>
+// HTML-ANIMAL-NEXT: <th>Value</th>
+// HTML-ANIMAL-NEXT: <th>Comments</th>
+// HTML-ANIMAL-NEXT: </tr>
+// HTML-ANIMAL-NEXT: <tr>
+// HTML-ANIMAL-NEXT: <td>Dog</td>
+// HTML-ANIMAL-NEXT: <td>0</td>
+// HTML-ANIMAL-NEXT: <td>
+// HTML-ANIMAL-NEXT: <p class="paragraph-container">
+// HTML-ANIMAL-NEXT: Man's best friend<br>
+// HTML-ANIMAL-NEXT: </p>
+// HTML-ANIMAL-NEXT: </td>
+// HTML-ANIMAL-NEXT: </tr>
+// HTML-ANIMAL-NEXT: <tr>
+// HTML-ANIMAL-NEXT: <td>Cat</td>
+// HTML-ANIMAL-NEXT: <td>1</td>
+// HTML-ANIMAL-NEXT: <td>
+// HTML-ANIMAL-NEXT: <p class="paragraph-container">
+// HTML-ANIMAL-NEXT: Man's other best friend<br>
+// HTML-ANIMAL-NEXT: </p>
+// HTML-ANIMAL-NEXT: </td>
+// HTML-ANIMAL-NEXT: </tr>
+// HTML-ANIMAL-NEXT: <tr>
+// HTML-ANIMAL-NEXT: <td>Iguana</td>
+// HTML-ANIMAL-NEXT: <td>2</td>
+// HTML-ANIMAL-NEXT: <td>
+// HTML-ANIMAL-NEXT: <p class="paragraph-container">
+// HTML-ANIMAL-NEXT: A lizard<br>
+// HTML-ANIMAL-NEXT: </p>
+// HTML-ANIMAL-NEXT: </td>
+// HTML-ANIMAL-NEXT: </tr>
+// HTML-ANIMAL-NEXT: </tbody>
+// HTML-ANIMAL-NEXT: </table>
+// HTML-ANIMAL-NEXT: <div class="doc-card">
+// HTML-ANIMAL-NEXT: <div class="nested-delimiter-container">
+// HTML-ANIMAL-NEXT: <p>specify what animal the class is</p>
+// HTML-ANIMAL-NEXT: </div>
+// HTML-ANIMAL-NEXT: </div>
+// HTML-ANIMAL: </div>
+// HTML-ANIMAL-NEXT: </section>
+
+
+
+// HTML-VEHICLES-LABEL: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
+// HTML-VEHICLES-NEXT: <div>
+// HTML-VEHICLES-NEXT: <pre><code class="language-cpp code-clang-doc">enum Car</code></pre>
+// HTML-VEHICLES-NEXT: </div>
+// HTML-VEHICLES-NEXT: <table class="table-wrapper">
+// HTML-VEHICLES-NEXT: <tbody>
+// HTML-VEHICLES-NEXT: <tr>
+// HTML-VEHICLES-NEXT: <th>Name</th>
+// HTML-VEHICLES-NEXT: <th>Value</th>
+// HTML-VEHICLES-NEXT: <th>Comments</th>
+// HTML-VEHICLES-NEXT: </tr>
+// HTML-VEHICLES-NEXT: <tr>
+// HTML-VEHICLES-NEXT: <td>Sedan</td>
+// HTML-VEHICLES-NEXT: <td>0</td>
+// HTML-VEHICLES-NEXT: <td>
+// HTML-VEHICLES-NEXT: <p class="paragraph-container">
+// HTML-VEHICLES-NEXT: Comment 1<br>
+// HTML-VEHICLES-NEXT: </p>
+// HTML-VEHICLES-NEXT: </td>
+// HTML-VEHICLES-NEXT: </tr>
+// HTML-VEHICLES-NEXT: <tr>
+// HTML-VEHICLES-NEXT: <td>SUV</td>
+// HTML-VEHICLES-NEXT: <td>1</td>
+// HTML-VEHICLES-NEXT: <td>
+// HTML-VEHICLES-NEXT: <p class="paragraph-container">
+// HTML-VEHICLES-NEXT: Comment 2<br>
+// HTML-VEHICLES-NEXT: </p>
+// HTML-VEHICLES-NEXT: </td>
+// HTML-VEHICLES-NEXT: </tr>
+// HTML-VEHICLES-NEXT: <tr>
+// HTML-VEHICLES-NEXT: <td>Pickup</td>
+// HTML-VEHICLES-NEXT: <td>2</td>
+// HTML-VEHICLES-NEXT: <td> -- </td>
+// HTML-VEHICLES-NEXT: </tr>
+// HTML-VEHICLES-NEXT: <tr>
+// HTML-VEHICLES-NEXT: <td>Hatchback</td>
+// HTML-VEHICLES-NEXT: <td>3</td>
+// HTML-VEHICLES-NEXT: <td>
+// HTML-VEHICLES-NEXT: <p class="paragraph-container">
+// HTML-VEHICLES-NEXT: Comment 4<br>
+// HTML-VEHICLES-NEXT: </p>
+// HTML-VEHICLES-NEXT: </td>
+// HTML-VEHICLES-NEXT: </tr>
+// HTML-VEHICLES-NEXT: </tbody>
+// HTML-VEHICLES-NEXT: </table>
+// HTML-VEHICLES-NEXT: <div class="doc-card">
+// HTML-VEHICLES-NEXT: <div class="nested-delimiter-container">
+// HTML-VEHICLES-NEXT: <p>specify type of car</p>
+// HTML-VEHICLES-NEXT: </div>
+// HTML-VEHICLES-NEXT: </div>
+// HTML-VEHICLES: </div>
+
+
+
diff --git a/clang-tools-extra/test/clang-doc/html/function-pointer-type.cpp b/clang-tools-extra/test/clang-doc/html/function-pointer-type.cpp
new file mode 100644
index 0000000000000..28105977f7520
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/function-pointer-type.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/function-pointer-type.cpp
+// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
+
+// HTML: <pre><code class="language-cpp code-clang-doc">void bar (void (*)(int) fn)</code></pre>
+
diff --git a/clang-tools-extra/test/clang-doc/index.cpp b/clang-tools-extra/test/clang-doc/html/index.cpp
similarity index 78%
rename from clang-tools-extra/test/clang-doc/index.cpp
rename to clang-tools-extra/test/clang-doc/html/index.cpp
index afe34e248d3f2..04cebeeccb156 100644
--- a/clang-tools-extra/test/clang-doc/index.cpp
+++ b/clang-tools-extra/test/clang-doc/html/index.cpp
@@ -1,29 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --pretty-json --output=%t --executor=standalone %s
-// RUN: FileCheck %s < %t/json/index.json -check-prefix=CHECK-JSON
+// RUN: clang-doc --format=html --pretty-json --output=%t --executor=standalone %S/../Inputs/index.cpp
// RUN: FileCheck %s < %t/html/index.html -check-prefix=CHECK-HTML
-class Foo {};
-
-namespace inner {
- class Bar {};
-}
-
-// CHECK-JSON: "Index": [
-// CHECK-JSON-NEXT: {
-// CHECK-JSON-NEXT: "Name": "GlobalNamespace",
-// CHECK-JSON-NEXT: "QualName": "GlobalNamespace",
-// CHECK-JSON-NEXT: "Type": "namespace",
-// CHECK-JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// CHECK-JSON-NEXT: },
-// CHECK-JSON-NEXT: {
-// CHECK-JSON-NEXT: "Name": "inner",
-// CHECK-JSON-NEXT: "QualName": "inner",
-// CHECK-JSON-NEXT: "Type": "namespace",
-// CHECK-JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// CHECK-JSON-NEXT: }
-// CHECK-JSON-NEXT: ]
-
// CHECK-HTML: <main>
// CHECK-HTML-NEXT: <div class="container">
// CHECK-HTML-NEXT: <div class="sidebar">
@@ -64,5 +42,3 @@ namespace inner {
// CHECK-HTML-NEXT: </div>
// CHECK-HTML-NEXT: </div>
// CHECK-HTML-NEXT: </main>
-
-// COM: TODO: Add Markdown index test
diff --git a/clang-tools-extra/test/clang-doc/html/long-name.cpp b/clang-tools-extra/test/clang-doc/html/long-name.cpp
new file mode 100644
index 0000000000000..3ba73a13c9d34
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/long-name.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/long-name.cpp
+// RUN: ls %t/html/GlobalNamespace | FileCheck %s -check-prefix=CHECK-HTML
+
+// CHECK-HTML: ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12.html
+// CHECK-HTML: _ZTV244ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheL29DE8558215A13A506661C0E01E50AA3E5C9C7FA.html
diff --git a/clang-tools-extra/test/clang-doc/html/member-function-pointer-type.cpp b/clang-tools-extra/test/clang-doc/html/member-function-pointer-type.cpp
new file mode 100644
index 0000000000000..bfdf17bd663f6
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/member-function-pointer-type.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/member-function-pointer-type.cpp
+// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
+
+// HTML: <pre><code class="language-cpp code-clang-doc">void baz (void (Class::*)(int) fn)</code></pre>
+
diff --git a/clang-tools-extra/test/clang-doc/mustache-index.cpp b/clang-tools-extra/test/clang-doc/html/mustache-index.cpp
similarity index 95%
rename from clang-tools-extra/test/clang-doc/mustache-index.cpp
rename to clang-tools-extra/test/clang-doc/html/mustache-index.cpp
index 6e308ada51a45..932a667685dd0 100644
--- a/clang-tools-extra/test/clang-doc/mustache-index.cpp
+++ b/clang-tools-extra/test/clang-doc/html/mustache-index.cpp
@@ -1,15 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
+// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %S/../Inputs/mustache-index.cpp
// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html
-enum Color {
- RED,
- BLUE,
- GREEN
-};
-
-class Foo;
-
// CHECK: <summary class="sidebar-section">
// CHECK-NEXT: <a class="sidebar-item" href="#Enums">Enums</a>
// CHECK-NEXT: </summary>
@@ -54,7 +46,7 @@ class Foo;
// CHECK-NEXT: </tr>
// CHECK-NEXT: </tbody>
// CHECK-NEXT: </table>
-// CHECK-NEXT: <p>Defined at line 5 of file {{.*}}mustache-index.cpp</p>
+// CHECK-NEXT: <p>Defined at line 1 of file {{.*}}mustache-index.cpp</p>
// CHECK-NEXT: </div>
// CHECK-NEXT: </div>
// CHECK-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/mustache-separate-namespace.cpp b/clang-tools-extra/test/clang-doc/html/mustache-separate-namespace.cpp
similarity index 95%
rename from clang-tools-extra/test/clang-doc/mustache-separate-namespace.cpp
rename to clang-tools-extra/test/clang-doc/html/mustache-separate-namespace.cpp
index c0fa2b47a3983..b80f8c54d1277 100644
--- a/clang-tools-extra/test/clang-doc/mustache-separate-namespace.cpp
+++ b/clang-tools-extra/test/clang-doc/html/mustache-separate-namespace.cpp
@@ -1,12 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --output=%t --executor=standalone %s
+// RUN: clang-doc --format=html --output=%t --executor=standalone %S/../Inputs/mustache-separate-namespace.cpp
// RUN: FileCheck %s < %t/html/MyNamespace/index.html
// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=CHECK-GLOBAL
-namespace MyNamespace {
- class Foo;
-}
-
// CHECK: <ul class="class-container">
// CHECK-NEXT: <li id="{{[0-9A-F]*}}" style="max-height: 40px;">
// CHECK-NEXT: <a href="_ZTVN11MyNamespace3FooE.html">
@@ -15,7 +11,6 @@ namespace MyNamespace {
// CHECK-NEXT: </li>
// CHECK-NEXT: </ul>
-// COM: Check that the empty global namespace doesn't contain tag mismatches.
// CHECK-GLOBAL: <main>
// CHECK-GLOBAL-NEXT: <div class="container">
// CHECK-GLOBAL-NEXT: <div class="sidebar">
diff --git a/clang-tools-extra/test/clang-doc/html/namespace.cpp b/clang-tools-extra/test/clang-doc/html/namespace.cpp
new file mode 100644
index 0000000000000..c3ca6c183c04e
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/namespace.cpp
@@ -0,0 +1,148 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=html --output=%t --executor=standalone %S/../Inputs/namespace-html-md.cpp
+// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=HTML-GLOBAL-INDEX
+// RUN: FileCheck %s < %t/html/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.html -check-prefix=HTML-ANON-CLASS-LINE
+// RUN: FileCheck %s < %t/html/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.html -check-prefix=HTML-ANON-CLASS
+// RUN: FileCheck %s < %t/html/@nonymous_namespace/index.html -check-prefix=HTML-ANON-INDEX-LINE
+// RUN: FileCheck %s < %t/html/@nonymous_namespace/index.html -check-prefix=HTML-ANON-INDEX
+// RUN: FileCheck %s < %t/html/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html -check-prefix=HTML-ANOTHER-CLASS-LINE
+// RUN: FileCheck %s < %t/html/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html -check-prefix=HTML-ANOTHER-CLASS
+// RUN: FileCheck %s < %t/html/AnotherNamespace/index.html -check-prefix=HTML-ANOTHER-INDEX-LINE
+// RUN: FileCheck %s < %t/html/AnotherNamespace/index.html -check-prefix=HTML-ANOTHER-INDEX
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html -check-prefix=HTML-NESTED-CLASS-LINE
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html -check-prefix=HTML-NESTED-CLASS
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/index.html -check-prefix=HTML-NESTED-INDEX-LINE
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/index.html -check-prefix=HTML-NESTED-INDEX
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/index.html -check-prefix=HTML-PRIMARY-INDEX-LINE
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/index.html -check-prefix=HTML-PRIMARY-INDEX
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html -check-prefix=HTML-PRIMARY-CLASS-LINE
+// RUN: FileCheck %s < %t/html/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html -check-prefix=HTML-PRIMARY-CLASS
+
+// HTML-ANON-INDEX-LINE: <p>Defined at line 3 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-ANON-CLASS-LINE: <p>Defined at line 4 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-ANON-CLASS: <h1 class="hero__title-large">class AnonClass</h1>
+
+// HTML-ANON-INDEX: <div class="navbar-breadcrumb-container">
+// HTML-ANON-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
+// HTML-ANON-INDEX: </div>
+// HTML-ANON-INDEX: <h2>@nonymous_namespace</h2>
+// HTML-ANON-INDEX: <h2>Records</h2>
+// HTML-ANON-INDEX: <ul class="class-container">
+// HTML-ANON-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-ANON-INDEX: <a href="_ZTVN12_GLOBAL__N_19AnonClassE.html">
+// HTML-ANON-INDEX: <pre><code class="language-cpp code-clang-doc">class AnonClass</code></pre>
+// HTML-ANON-INDEX: </a>
+// HTML-ANON-INDEX: </li>
+// HTML-ANON-INDEX-NOT: <h2 id="Functions">Functions</h2>
+// HTML-ANON-INDEX-NOT: <h3 id="{{([0-9A-F]{40})}}">anonFunction</h3>
+// HTML-ANON-INDEX-NOT: <p>void anonFunction()</p>
+
+// HTML-PRIMARY-INDEX-LINE: <p>Defined at line 10 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-PRIMARY-CLASS-LINE: <p>Defined at line 12 of file {{.*}}namespace-html-md.cpp</p>
+
+// HTML-PRIMARY-CLASS: <div class="navbar-breadcrumb-container">
+// HTML-PRIMARY-CLASS: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
+// HTML-PRIMARY-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>
+// HTML-PRIMARY-CLASS: </div>
+// HTML-PRIMARY-CLASS: <h1 class="hero__title-large">class ClassInPrimaryNamespace</h1>
+
+// HTML-NESTED-INDEX-LINE: <p>Defined at line 17 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-NESTED-CLASS-LINE: <p>Defined at line 19 of file {{.*}}namespace-html-md.cpp</p>
+
+// HTML-NESTED-CLASS: <div class="navbar-breadcrumb-container">
+// HTML-NESTED-CLASS: <a href="../../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
+// HTML-NESTED-CLASS: <a href="../index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>::
+// HTML-NESTED-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">NestedNamespace</div></a>
+// HTML-NESTED-CLASS: </div>
+// HTML-NESTED-CLASS: <h1 class="hero__title-large">class ClassInNestedNamespace</h1>
+
+// HTML-NESTED-INDEX: <div class="navbar-breadcrumb-container">
+// HTML-NESTED-INDEX: <a href="../../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
+// HTML-NESTED-INDEX: <a href="../index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>
+// HTML-NESTED-INDEX: </div>
+// HTML-NESTED-INDEX: <h2>NestedNamespace</h2>
+// HTML-NESTED-INDEX: <h2>Records</h2>
+// HTML-NESTED-INDEX: <ul class="class-container">
+// HTML-NESTED-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-NESTED-INDEX: <a href="_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html">
+// HTML-NESTED-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInNestedNamespace</code></pre>
+// HTML-NESTED-INDEX: </a>
+// HTML-NESTED-INDEX: </li>
+// HTML-NESTED-INDEX: </ul>
+// HTML-NESTED-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInNestedNamespace ()</code></pre>
+// HTML-NESTED-INDEX: <div class="doc-card">
+// HTML-NESTED-INDEX: <div class="nested-delimiter-container">
+// HTML-NESTED-INDEX: <p>Function in NestedNamespace</p>
+// HTML-NESTED-INDEX: </div>
+// HTML-NESTED-INDEX: </div>
+// HTML-NESTED-INDEX: <p>Defined at line 17 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-NESTED-INDEX: </div>
+
+// HTML-PRIMARY-INDEX: <div class="navbar-breadcrumb-container">
+// HTML-PRIMARY-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
+// HTML-PRIMARY-INDEX: </div>
+// HTML-PRIMARY-INDEX: <h2>PrimaryNamespace</h2>
+// HTML-PRIMARY-INDEX-NOT: <h2 id="Namespaces">Namespaces</h2>
+// HTML-PRIMARY-INDEX-NOT: <a href="NestedNamespace{{[\/]}}index.html">NestedNamespace</a>
+// HTML-PRIMARY-INDEX: <h2>Records</h2>
+// HTML-PRIMARY-INDEX: <ul class="class-container">
+// HTML-PRIMARY-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-PRIMARY-INDEX: <a href="_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html">
+// HTML-PRIMARY-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInPrimaryNamespace</code></pre>
+// HTML-PRIMARY-INDEX: </a>
+// HTML-PRIMARY-INDEX: </li>
+// HTML-PRIMARY-INDEX: </ul>
+// HTML-PRIMARY-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInPrimaryNamespace ()</code></pre>
+// HTML-PRIMARY-INDEX: <div class="doc-card">
+// HTML-PRIMARY-INDEX: <div class="nested-delimiter-container">
+// HTML-PRIMARY-INDEX: <p>Function in PrimaryNamespace</p>
+// HTML-PRIMARY-INDEX: </div>
+// HTML-PRIMARY-INDEX: </div>
+// HTML-PRIMARY-INDEX: <p>Defined at line 10 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-PRIMARY-INDEX: </div>
+// HTML-PRIMARY-INDEX <h2>Inner Classes</h2>
+// HTML-PRIMARY-INDEX <ul class="class-container">
+// HTML-PRIMARY-INDEX <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-PRIMARY-INDEX <a href="_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html">
+// HTML-PRIMARY-INDEX <pre><code class="language-cpp code-clang-doc">class ClassInPrimaryNamespace</code></pre>
+// HTML-PRIMARY-INDEX </a>
+// HTML-PRIMARY-INDEX </li>
+// HTML-PRIMARY-INDEX </ul>
+
+// HTML-ANOTHER-INDEX-LINE: <p>Defined at line 26 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-ANOTHER-CLASS-LINE: <p>Defined at line 28 of file {{.*}}namespace-html-md.cpp</p>
+
+// HTML-ANOTHER-CLASS: <div class="navbar-breadcrumb-container">
+// HTML-ANOTHER-CLASS: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
+// HTML-ANOTHER-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">AnotherNamespace</div></a>
+// HTML-ANOTHER-CLASS: </div>
+// HTML-ANOTHER-CLASS: <h1 class="hero__title-large">class ClassInAnotherNamespace</h1>
+
+// HTML-ANOTHER-INDEX: <div class="navbar-breadcrumb-container">
+// HTML-ANOTHER-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
+// HTML-ANOTHER-INDEX: </div>
+// HTML-ANOTHER-INDEX: <h2>AnotherNamespace</h2>
+// HTML-ANOTHER-INDEX: <h2>Records</h2>
+// HTML-ANOTHER-INDEX: <ul class="class-container">
+// HTML-ANOTHER-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
+// HTML-ANOTHER-INDEX: <a href="_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html">
+// HTML-ANOTHER-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInAnotherNamespace</code></pre>
+// HTML-ANOTHER-INDEX: </a>
+// HTML-ANOTHER-INDEX: </li>
+// HTML-ANOTHER-INDEX: </ul>
+// HTML-ANOTHER-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInAnotherNamespace ()</code></pre>
+// HTML-ANOTHER-INDEX: <div class="doc-card">
+// HTML-ANOTHER-INDEX: <div class="nested-delimiter-container">
+// HTML-ANOTHER-INDEX: <p>Function in AnotherNamespace</p>
+// HTML-ANOTHER-INDEX: </div>
+// HTML-ANOTHER-INDEX: </div>
+// HTML-ANOTHER-INDEX: <p>Defined at line 26 of file {{.*}}namespace-html-md.cpp</p>
+// HTML-ANOTHER-INDEX: </div>
+// HTML-ANOTHER-INDEX: </div>
+
+// HTML-GLOBAL-INDEX-NOT: <div id="main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
+// HTML-GLOBAL-INDEX-NOT: <h1>Global Namespace</h1>
+// HTML-GLOBAL-INDEX-NOT: <h2 id="Namespaces">Namespaces</h2>
+// HTML-GLOBAL-INDEX-NOT: <li>@nonymous_namespace</li>
+// HTML-GLOBAL-INDEX-NOT: <li>AnotherNamespace</li>
+// HTML-GLOBAL-INDEX-NOT: <li>PrimaryNamespace</li>
diff --git a/clang-tools-extra/test/clang-doc/html/nested-pointer-qualifiers.cpp b/clang-tools-extra/test/clang-doc/html/nested-pointer-qualifiers.cpp
new file mode 100644
index 0000000000000..6b21d8b6d9fcc
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/nested-pointer-qualifiers.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=html --executor=standalone %S/../Inputs/nested-pointer-qualifiers.cpp
+// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
+
+// HTML: <pre><code class="language-cpp code-clang-doc">void foo (const int *const * ptr)</code></pre>
+
diff --git a/clang-tools-extra/test/clang-doc/html/templates.cpp b/clang-tools-extra/test/clang-doc/html/templates.cpp
new file mode 100644
index 0000000000000..d92f8ba2c702d
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/html/templates.cpp
@@ -0,0 +1,73 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --pretty-json --doxygen --executor=standalone %S/../Inputs/templates.cpp -output=%t/docs --format=html
+// RUN: cat %t/docs/html/GlobalNamespace/_ZTV5tuple.html | FileCheck %s --check-prefix=HTML-STRUCT
+// RUN: cat %t/docs/html/GlobalNamespace/index.html | FileCheck %s --check-prefix=HTML
+
+// HTML: <pre><code class="language-cpp code-clang-doc">template <class... T</code><code class="language-cpp code-clang-doc">></code></pre>
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void ParamPackFunction (T... args)</code></pre>
+
+// HTML: <pre><code class="language-cpp code-clang-doc">template <typename T, int U = 1</code><code class="language-cpp code-clang-doc">></code></pre>
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void function (T x)</code></pre>
+// HTML-NEXT: <p>Defined at line 3 of file {{.*}}templates.cpp</p>
+// HTML-NEXT: </div>
+
+// HTML: <pre>
+// HTML-SAME: <code class="language-cpp code-clang-doc">template <</code>
+// HTML-SAME: <span class="param-container">
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename A, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename B, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename C, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename D, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename E</code></span>
+// HTML-SAME: </span>
+// HTML-SAME: <code class="language-cpp code-clang-doc">></code>
+// HTML-SAME: </pre>
+// HTML-NEXT: <pre>
+// HTML-SAME: <code class="language-cpp code-clang-doc">void longFunction (</code>
+// HTML-SAME: <span class="param-container">
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">A</code> <code class="language-cpp code-clang-doc">a, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">B</code> <code class="language-cpp code-clang-doc">b, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">C</code> <code class="language-cpp code-clang-doc">c, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">D</code> <code class="language-cpp code-clang-doc">d, </code></span>
+// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">E</code> <code class="language-cpp code-clang-doc">e</code></span>
+// HTML-SAME: </span>
+// HTML-SAME: <code class="language-cpp code-clang-doc">)</code>
+// HTML-SAME: </pre>
+// HTML-NEXT: <p>Defined at line 6 of file {{.*}}templates.cpp</p>
+// HTML-NEXT: </div>
+
+// HTML: <pre><code class="language-cpp code-clang-doc">template <</code><code class="language-cpp code-clang-doc">></code></pre>
+// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void function<bool, 0> (bool x)</code></pre>
+// HTML-NEXT: <p>Defined at line 8 of file {{.*}}templates.cpp</p>
+// HTML-NEXT: </div>
+
+// HTML-STRUCT: <section class="hero section-container">
+// HTML-STRUCT-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename... Tys></code></pre>
+// HTML-STRUCT-NEXT: <div class="hero__title">
+// HTML-STRUCT-NEXT: <h1 class="hero__title-large">struct tuple</h1>
+// HTML-STRUCT-NEXT: <p>Defined at line 13 of file {{.*}}templates.cpp</p>
+// HTML-STRUCT-NEXT: <div class="doc-card">
+// HTML-STRUCT-NEXT: <div class="nested-delimiter-container">
+// HTML-STRUCT-NEXT: <p>A Tuple type</p>
+// HTML-STRUCT-NEXT: </div>
+// HTML-STRUCT-NEXT: <div class="nested-delimiter-container">
+// HTML-STRUCT-NEXT: <p>Does Tuple things.</p>
+// HTML-STRUCT-NEXT: </div>
+// HTML-STRUCT-NEXT: </div>
+// HTML-STRUCT-NEXT: </div>
+// HTML-STRUCT-NEXT: </section>
+
+// HTML: <pre><code class="language-cpp code-clang-doc">tuple<int, int, bool> func_with_tuple_param (tuple<int, int, bool> t)</code></pre>
+// HTML-NEXT: <div class="doc-card">
+// HTML-NEXT: <div class="nested-delimiter-container">
+// HTML-NEXT: <p>A function with a tuple parameter</p>
+// HTML-NEXT: </div>
+// HTML-NEXT: <div class="nested-delimiter-container">
+// HTML-NEXT: <h3>Parameters</h3>
+// HTML-NEXT: <div>
+// HTML-NEXT: <b>t</b> The input to func_with_tuple_param
+// HTML-NEXT: </div>
+// HTML-NEXT: </div>
+// HTML-NEXT: </div>
+// HTML-NEXT: <p>Defined at line 18 of file {{.*}}templates.cpp</p>
+// HTML-NEXT: </div>
diff --git a/clang-tools-extra/test/clang-doc/typedef-alias.cpp b/clang-tools-extra/test/clang-doc/html/typedef-alias.cpp
similarity index 83%
rename from clang-tools-extra/test/clang-doc/typedef-alias.cpp
rename to clang-tools-extra/test/clang-doc/html/typedef-alias.cpp
index c4dad4c25f2e0..1d930c3851462 100644
--- a/clang-tools-extra/test/clang-doc/typedef-alias.cpp
+++ b/clang-tools-extra/test/clang-doc/html/typedef-alias.cpp
@@ -1,25 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --output=%t --executor=standalone %s
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=HTML-GLOBAL
+// RUN: clang-doc --format=html --output=%t --executor=standalone %S/../Inputs/typedef-alias.cpp
// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=HTML-GLOBAL
// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV6Vector.html -check-prefix=HTML-VECTOR
-/// \brief This is u_long
-using u_long = unsigned long;
-
-/// \brief This is IntPtr
-typedef int* IntPtr;
-
-template<typename T>
-class Vector {
- /// \brief This is a Ptr
- using Ptr = IntPtr;
-};
-
-template<typename T> using Vec = Vector<T>;
-
-using IntVec = Vector<int>;
-
// HTML-GLOBAL: <a class="sidebar-item" href="#Typedefs">Typedefs</a>
// HTML-GLOBAL-NEXT: </summary>
// HTML-GLOBAL-NEXT: <ul>
@@ -43,23 +26,23 @@ using IntVec = Vector<int>;
// HTML-GLOBAL-NEXT: <div class="nested-delimiter-container">
// HTML-GLOBAL-NEXT: <p>This is u_long</p>
// HTML-GLOBAL-NEXT: </div>
-// HTML-GLOBAL-NEXT: <p>Defined at line 8 of file {{.*}}typedef-alias.cpp</p>
+// HTML-GLOBAL-NEXT: <p>Defined at line 2 of file {{.*}}typedef-alias.cpp</p>
// HTML-GLOBAL-NEXT: </div>
// HTML-GLOBAL-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
// HTML-GLOBAL-NEXT: <pre><code class="language-cpp code-clang-doc">typedef IntPtr int *</code></pre>
// HTML-GLOBAL-NEXT: <div class="nested-delimiter-container">
// HTML-GLOBAL-NEXT: <p>This is IntPtr</p>
// HTML-GLOBAL-NEXT: </div>
-// HTML-GLOBAL-NEXT: <p>Defined at line 11 of file {{.*}}typedef-alias.cpp</p>
+// HTML-GLOBAL-NEXT: <p>Defined at line 5 of file {{.*}}typedef-alias.cpp</p>
// HTML-GLOBAL-NEXT: </div>
// HTML-GLOBAL-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
// HTML-GLOBAL-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre>
// HTML-GLOBAL-NEXT: <pre><code class="language-cpp code-clang-doc">using Vec = Vector<T></code></pre>
-// HTML-GLOBAL-NEXT: <p>Defined at line 19 of file {{.*}}typedef-alias.cpp</p>
+// HTML-GLOBAL-NEXT: <p>Defined at line 12 of file {{.*}}typedef-alias.cpp</p>
// HTML-GLOBAL-NEXT: </div>
// HTML-GLOBAL-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
// HTML-GLOBAL-NEXT: <pre><code class="language-cpp code-clang-doc">using IntVec = Vector<int></code></pre>
-// HTML-GLOBAL-NEXT: <p>Defined at line 21 of file {{.*}}typedef-alias.cpp</p>
+// HTML-GLOBAL-NEXT: <p>Defined at line 14 of file {{.*}}typedef-alias.cpp</p>
// HTML-GLOBAL-NEXT: </div>
// HTML-GLOBAL-NEXT: </section>
@@ -77,6 +60,6 @@ using IntVec = Vector<int>;
// HTML-VECTOR-NEXT: <div class="nested-delimiter-container">
// HTML-VECTOR-NEXT: <p>This is a Ptr</p>
// HTML-VECTOR-NEXT: </div>
-// HTML-VECTOR-NEXT: <p>Defined at line 16 of file {{.*}}typedef-alias.cpp</p>
+// HTML-VECTOR-NEXT: <p>Defined at line 9 of file {{.*}}typedef-alias.cpp</p>
// HTML-VECTOR-NEXT: </div>
// HTML-VECTOR-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/json/class-partial-specialization.cpp b/clang-tools-extra/test/clang-doc/json/class-partial-specialization.cpp
index c5d2a65f5e53f..fed192421926b 100644
--- a/clang-tools-extra/test/clang-doc/json/class-partial-specialization.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class-partial-specialization.cpp
@@ -14,7 +14,7 @@
// CHECK-NEXT: "Specialization": {
// CHECK-NEXT: "Parameters": [
// CHECK-NEXT: {
-// CHECK-NEXT: "Param": "T*",
+// CHECK-NEXT: "Param": "T *",
// CHECK-NEXT: "SpecParamEnd": true
// CHECK-NEXT: }
// CHECK-NEXT: ],
diff --git a/clang-tools-extra/test/clang-doc/json/class-requires.cpp b/clang-tools-extra/test/clang-doc/json/class-requires.cpp
index fffa5ef4e81cb..09d93fb7ae17f 100644
--- a/clang-tools-extra/test/clang-doc/json/class-requires.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class-requires.cpp
@@ -1,16 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %S/../Inputs/class-requires.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json
-template<typename T>
-concept Addable = requires(T a, T b) {
- { a + b };
-};
-
-template<typename T>
-requires Addable<T>
-struct MyClass;
-
// CHECK: "Name": "MyClass",
// CHECK-NEXT: "Namespace": [
// CHECK-NEXT: "GlobalNamespace"
diff --git a/clang-tools-extra/test/clang-doc/json/class-specialization.cpp b/clang-tools-extra/test/clang-doc/json/class-specialization.cpp
index c2b09ab53b0e9..aa3390d81c641 100644
--- a/clang-tools-extra/test/clang-doc/json/class-specialization.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class-specialization.cpp
@@ -1,13 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=html --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/class-specialization.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json --check-prefix=BASE
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClassIiE.json --check-prefix=SPECIALIZATION
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json --check-prefix=JSON-NAMESPACE
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html --check-prefix=HTML-NAMESPACE
-
-template<typename T> struct MyClass {};
-
-template<> struct MyClass<int> {};
// BASE: "MangledName": "_ZTV7MyClass",
// BASE-NEXT: "Name": "MyClass",
@@ -73,19 +68,3 @@ template<> struct MyClass<int> {};
// JSON-NAMESPACE-NEXT: "USR": "{{([0-9A-F]{40})}}"
// JSON-NAMESPACE-NEXT: }
// JSON-NAMESPACE-NEXT: ]
-
-// HTML-NAMESPACE: <section id="Records" class="section-container">
-// HTML-NAMESPACE-NEXT: <h2>Records</h2>
-// HTML-NAMESPACE-NEXT: <ul class="class-container">
-// HTML-NAMESPACE-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-NAMESPACE-NEXT: <a href="_ZTV7MyClass.html">
-// HTML-NAMESPACE-NEXT: <pre><code class="language-cpp code-clang-doc">class MyClass</code></pre>
-// HTML-NAMESPACE-NEXT: </a>
-// HTML-NAMESPACE-NEXT: </li>
-// HTML-NAMESPACE-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-NAMESPACE-NEXT: <a href="_ZTV7MyClassIiE.html">
-// HTML-NAMESPACE-NEXT: <pre><code class="language-cpp code-clang-doc">class MyClass<int></code></pre>
-// HTML-NAMESPACE-NEXT: </a>
-// HTML-NAMESPACE-NEXT: </li>
-// HTML-NAMESPACE-NEXT: </ul>
-// HTML-NAMESPACE-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/json/class-template.cpp b/clang-tools-extra/test/clang-doc/json/class-template.cpp
index c5b197427d434..378ec4af57219 100644
--- a/clang-tools-extra/test/clang-doc/json/class-template.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class-template.cpp
@@ -1,12 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/class-template.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json
-template<typename T> struct MyClass {
- T MemberTemplate;
- T method(T Param);
-};
-
// CHECK: "Name": "MyClass",
// CHECK: "PublicMembers": [
// CHECK-NEXT: {
diff --git a/clang-tools-extra/test/clang-doc/json/class.cpp b/clang-tools-extra/test/clang-doc/json/class.cpp
index c0e736fa2d5b9..d901ca8dcbfd5 100644
--- a/clang-tools-extra/test/clang-doc/json/class.cpp
+++ b/clang-tools-extra/test/clang-doc/json/class.cpp
@@ -1,41 +1,6 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=html --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/class.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json
-// RUN: FileCheck %s < %t/html/GlobalNamespace/_ZTV7MyClass.html -check-prefix=HTML
-
-/// This is a struct friend.
-struct Foo;
-
-// This is a nice class.
-// It has some nice methods and fields.
-// @brief This is a brief description.
-struct MyClass {
- int PublicField;
-
- int myMethod(int MyParam);
- static void staticMethod();
- const int& getConst();
-
- enum Color {
- RED,
- GREEN,
- BLUE = 5
- };
-
- typedef int MyTypedef;
-
- class NestedClass;
-
- friend struct Foo;
- /// This is a function template friend.
- template<typename T> friend void friendFunction(int);
-protected:
- int protectedMethod();
-
- int ProtectedField;
-private:
- int PrivateField;
-};
// CHECK: {
// CHECK-NEXT: "Contexts": [
@@ -70,7 +35,7 @@ struct MyClass {
// CHECK-NEXT: "InfoType": "enum",
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}class.cpp",
-// CHECK-NEXT: "LineNumber": 19
+// CHECK-NEXT: "LineNumber": 14
// CHECK-NEXT: },
// CHECK-NEXT: "Members": [
// CHECK-NEXT: {
@@ -180,7 +145,7 @@ struct MyClass {
// CHECK-NEXT: "IsTypedef": false,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}class.cpp",
-// CHECK-NEXT: "LineNumber": 12
+// CHECK-NEXT: "LineNumber": 7
// CHECK-NEXT: },
// CHECK-NEXT: "MangledName": "_ZTV7MyClass",
// CHECK-NEXT: "Name": "MyClass",
@@ -286,7 +251,7 @@ struct MyClass {
// CHECK-NEXT: "IsUsing": false,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}class.cpp",
-// CHECK-NEXT: "LineNumber": 25
+// CHECK-NEXT: "LineNumber": 16
// CHECK-NEXT: },
// CHECK-NEXT: "Name": "MyTypedef",
// CHECK-NEXT: "Namespace": [
@@ -303,59 +268,3 @@ struct MyClass {
// CHECK-NEXT: "USR": "0000000000000000000000000000000000000000"
// CHECK: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
-
-// HTML: <a class="sidebar-item" href="#Records">Records</a>
-// HTML-NEXT: </summary>
-// HTML-NEXT: <ul>
-// HTML-NEXT: <li class="sidebar-item-container">
-// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">NestedClass</a>
-// HTML-NEXT: </li>
-// HTML-NEXT: </ul>
-// HTML-NEXT: </details>
-// HTML: <a class="sidebar-item" href="#Friends">Friends</a>
-// HTML-NEXT: </summary>
-// HTML-NEXT: <ul>
-// HTML-NEXT: <li class="sidebar-item-container">
-// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">friendFunction</a>
-// HTML-NEXT: </li>
-// HTML-NEXT: <li class="sidebar-item-container">
-// HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Foo</a>
-// HTML-NEXT: </li>
-// HTML-NEXT: </ul>
-// HTML-NEXT: </details>
-// HTML: <section id="ProtectedMembers" class="section-container">
-// HTML-NEXT: <h2>Protected Members</h2>
-// HTML-NEXT: <div>
-// HTML-NEXT: <div id="ProtectedField" class="delimiter-container">
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc" >int ProtectedField</code></pre>
-// HTML-NEXT: </div>
-// HTML-NEXT: </div>
-// HTML-NEXT: </section>
-// HTML: <section id="ProtectedMethods" class="section-container">
-// HTML-NEXT: <h2>Protected Methods</h2>
-// HTML-NEXT: <div>
-// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">int protectedMethod ()</code></pre>
-// HTML-NEXT: </div>
-// HTML-NEXT: </div>
-// HTML-NEXT: </section>
-// HTML: <section id="Records" class="section-container">
-// HTML-NEXT: <h2>Records</h2>
-// HTML-NEXT: <ul class="class-container">
-// HTML-NEXT: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-NEXT: <a href="MyClass/_ZTVN7MyClass11NestedClassE.html">
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">class NestedClass</code></pre>
-// HTML-NEXT: </a>
-// HTML-NEXT: </li>
-// HTML-NEXT: </ul>
-// HTML-NEXT: </section>
-// HTML: <section id="Friends" class="section-container">
-// HTML-NEXT: <h2>Friends</h2>
-// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T></code></pre>
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void MyClass (int )</code></pre>
-// HTML-NEXT: </div>
-// HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">class Foo</code></pre>
-// HTML-NEXT: </div>
-// HTML-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/compact.cpp b/clang-tools-extra/test/clang-doc/json/compact.cpp
similarity index 96%
rename from clang-tools-extra/test/clang-doc/compact.cpp
rename to clang-tools-extra/test/clang-doc/json/compact.cpp
index e817b2a8c547b..b3916057ee05f 100644
--- a/clang-tools-extra/test/clang-doc/compact.cpp
+++ b/clang-tools-extra/test/clang-doc/json/compact.cpp
@@ -1,10 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --doxygen --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --doxygen --output=%t --format=json --executor=standalone %S/../Inputs/compact.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV3Foo.json --check-prefix=CLASS
// RUN: FileCheck %s < %t/json/index.json --check-prefix=INDEX
-class Foo {};
-
// CLASS: {
// CLASS-SAME: "Contexts":
// CLASS-SAME: [{"DocumentationFileName":"index",
@@ -16,7 +14,7 @@ class Foo {};
// CLASS-SAME: "HasContexts":true,
// CLASS-SAME: "InfoType":"record",
// CLASS-SAME: "IsTypedef":false,
-// CLASS-SAME: "Location":{"Filename":"{{.*}}compact.cpp","LineNumber":6},
+// CLASS-SAME: "Location":{"Filename":"{{.*}}compact.cpp","LineNumber":1},
// CLASS-SAME: "MangledName":"_ZTV3Foo",
// CLASS-SAME: "Name":"Foo",
// CLASS-SAME: "Namespace":["GlobalNamespace"],
diff --git a/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp b/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
index eb8738cfbe5db..c01e2392bff8a 100644
--- a/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
+++ b/clang-tools-extra/test/clang-doc/json/compound-constraints.cpp
@@ -1,43 +1,6 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --doxygen --format=html --executor=standalone %s
+// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --doxygen --format=json --executor=standalone %S/../Inputs/compound-constraints.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=CHECK-HTML
-
-/// \brief Concept for an incrementable value
-///
-/// \tparam T A value that can be incremented.
-template<typename T> concept Incrementable = requires (T a) {
- a++;
-};
-
-/// \brief Concept for a decrementable value
-///
-/// \tparam T A value that can be decremented
-template<typename T> concept Decrementable = requires (T a) {
- a--;
-};
-
-/// \brief Concept for a pre-incrementable value
-///
-/// \tparam T A value that can be pre-incremented
-template<typename T> concept PreIncrementable = requires (T a) {
- ++a;
-};
-
-/// \brief Concept for a -pre-decrementable value
-///
-/// \tparam T A value that can be pre-decremented
-template<typename T> concept PreDecrementable = requires (T a) {
- --a;
-};
-
-template<typename T> requires Incrementable<T> && Decrementable<T> void One();
-
-template<typename T> requires (Incrementable<T> && Decrementable<T>) void Two();
-
-template<typename T> requires (Incrementable<T> && Decrementable<T>) || (PreIncrementable<T> && PreDecrementable<T>) void Three();
-
-template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncrementable<T> void Four();
// CHECK: "Name": "One",
// CHECK: "Template": {
@@ -125,83 +88,3 @@ template<typename T> requires (Incrementable<T> && Decrementable<T>) || PreIncre
// CHECK-NEXT: "USR": "{{[0-9A-F]*}}"
// CHECK-NEXT: }
// CHECK-NEXT: ],
-
-// CHECK-HTML: <a class="sidebar-item" href="#Concepts">Concepts</a>
-// CHECK-HTML-NEXT: </summary>
-// CHECK-HTML-NEXT: <ul>
-// CHECK-HTML-NEXT: <li class="sidebar-item-container">
-// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Incrementable</a>
-// CHECK-HTML-NEXT: </li>
-// CHECK-HTML-NEXT: <li class="sidebar-item-container">
-// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">Decrementable</a>
-// CHECK-HTML-NEXT: </li>
-// CHECK-HTML-NEXT: <li class="sidebar-item-container">
-// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">PreIncrementable</a>
-// CHECK-HTML-NEXT: </li>
-// CHECK-HTML-NEXT: <li class="sidebar-item-container">
-// CHECK-HTML-NEXT: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">PreDecrementable</a>
-// CHECK-HTML-NEXT: </li>
-// CHECK-HTML-NEXT: </ul>
-// CHECK-HTML: <section id="Concepts" class="section-container">
-// CHECK-HTML-NEXT: <h2>Concepts</h2>
-// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> Incrementable requires (T a) { a++; }</code></pre>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <p>Concept for an incrementable value</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <b>T</b> A value that can be incremented.
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <p>Defined at line [[@LINE-151]] of file {{.*}}compound-constraints.cpp</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> Decrementable requires (T a) { a--; }</code></pre>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <p>Concept for a decrementable value</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <b>T</b> A value that can be decremented
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <p>Defined at line [[@LINE-159]] of file {{.*}}compound-constraints.cpp</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> PreIncrementable requires (T a) { ++a; }</code></pre>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <p>Concept for a pre-incrementable value</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <b>T</b> A value that can be pre-incremented
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <p>Defined at line [[@LINE-167]] of file {{.*}}compound-constraints.cpp</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename T> PreDecrementable requires (T a) { --a; }</code></pre>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <p>Concept for a -pre-decrementable value</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <h3>Template Parameters</h3>
-// CHECK-HTML-NEXT: <div class="nested-delimiter-container">
-// CHECK-HTML-NEXT: <div>
-// CHECK-HTML-NEXT: <b>T</b> A value that can be pre-decremented
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: <p>Defined at line [[@LINE-175]] of file {{.*}}compound-constraints.cpp</p>
-// CHECK-HTML-NEXT: </div>
-// CHECK-HTML-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/json/concept.cpp b/clang-tools-extra/test/clang-doc/json/concept.cpp
index c04d893fa96d9..2bba1e2c2c426 100644
--- a/clang-tools-extra/test/clang-doc/json/concept.cpp
+++ b/clang-tools-extra/test/clang-doc/json/concept.cpp
@@ -1,14 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=html --executor=standalone %s
+// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %S/../Inputs/concept.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json
-// Requires that T suports post and pre-incrementing.
-template<typename T>
-concept Incrementable = requires(T x) {
- ++x;
- x++;
-};
-
// CHECK: {
// CHECK-NEXT: "Concepts": [
// CHECK-NEXT: {
@@ -24,7 +17,7 @@ concept Incrementable = requires(T x) {
// CHECK-NEXT: "IsType": true,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}concept.cpp",
-// CHECK-NEXT: "LineNumber": 6
+// CHECK-NEXT: "LineNumber": 2
// CHECK-NEXT: },
// CHECK-NEXT: "Name": "Incrementable",
// CHECK-NEXT: "Template": {
diff --git a/clang-tools-extra/test/clang-doc/json/conversion_function.cpp b/clang-tools-extra/test/clang-doc/json/conversion_function.cpp
new file mode 100644
index 0000000000000..71d3b9f2a6e3f
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/json/conversion_function.cpp
@@ -0,0 +1,5 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=json --pretty-json --output=%t --executor=standalone %S/../Inputs/conversion_function.cpp
+// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV8MyStruct.json --check-prefix=CHECK-JSON
+
+// CHECK-JSON: "Name": "operator T",
diff --git a/clang-tools-extra/test/clang-doc/json/enum.cpp b/clang-tools-extra/test/clang-doc/json/enum.cpp
new file mode 100644
index 0000000000000..6e25823764718
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/json/enum.cpp
@@ -0,0 +1,377 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --pretty-json --doxygen --output=%t --format=json --executor=standalone %S/../Inputs/enum.cpp
+// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json --check-prefix=JSON-INDEX
+// RUN: FileCheck %s < %t/json/Vehicles/index.json --check-prefix=JSON-VEHICLES-INDEX
+
+// JSON-INDEX: {
+// JSON-INDEX-NEXT: "DocumentationFileName": "index",
+// JSON-INDEX-NEXT: "Enums": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "BriefComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "For specifying RGB colors"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "HasBriefComments": true
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasComments": true,
+// JSON-INDEX-NEXT: "InfoType": "enum",
+// JSON-INDEX-NEXT: "Location": {
+// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-INDEX-NEXT: "LineNumber": 4
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Members": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 1"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Red",
+// JSON-INDEX-NEXT: "Value": "0"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 2"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Green",
+// JSON-INDEX-NEXT: "Value": "1"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 3"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Blue",
+// JSON-INDEX-NEXT: "Value": "2"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "Name": "Color",
+// JSON-INDEX-NEXT: "Scoped": false,
+// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "BriefComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Shape Types"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "HasBriefComments": true
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasComments": true,
+// JSON-INDEX-NEXT: "InfoType": "enum",
+// JSON-INDEX-NEXT: "Location": {
+// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-INDEX-NEXT: "LineNumber": 13
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Members": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 1"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Circle",
+// JSON-INDEX-NEXT: "Value": "0"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 2"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Rectangle",
+// JSON-INDEX-NEXT: "Value": "1"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Comment 3"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Triangle",
+// JSON-INDEX-NEXT: "Value": "2"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "Name": "Shapes",
+// JSON-INDEX-NEXT: "Scoped": true,
+// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "BaseType": {
+// JSON-INDEX-NEXT: "Name": "uint8_t",
+// JSON-INDEX-NEXT: "QualName": "uint8_t",
+// JSON-INDEX-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "BriefComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Specify the size"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "HasBriefComments": true
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasComments": true,
+// JSON-INDEX-NEXT: "InfoType": "enum",
+// JSON-INDEX-NEXT: "Location": {
+// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-INDEX-NEXT: "LineNumber": 26
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Members": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "A pearl."
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Pearls are quite small."
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Pearls are used in jewelry."
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Small",
+// JSON-INDEX-NEXT: "Value": "0"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "BriefComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "A tennis ball."
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "HasBriefComments": true
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Medium",
+// JSON-INDEX-NEXT: "Value": "1"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "A football."
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "Large",
+// JSON-INDEX-NEXT: "Value": "2"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "Name": "Size",
+// JSON-INDEX-NEXT: "Scoped": false,
+// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "BaseType": {
+// JSON-INDEX-NEXT: "Name": "long long",
+// JSON-INDEX-NEXT: "QualName": "long long",
+// JSON-INDEX-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "BriefComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "Very long number"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "HasBriefComments": true
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "HasComments": true,
+// JSON-INDEX-NEXT: "InfoType": "enum",
+// JSON-INDEX-NEXT: "Location": {
+// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-INDEX-NEXT: "LineNumber": 43
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Members": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Description": {
+// JSON-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-INDEX-NEXT: "ParagraphComments": [
+// JSON-INDEX-NEXT: [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "TextComment": "A very large value"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: ]
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-INDEX-NEXT: "Name": "BigVal",
+// JSON-INDEX-NEXT: "ValueExpr": "999999999999"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "Scoped": false,
+// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "InfoType": "enum",
+// JSON-INDEX-NEXT: "Location": {
+// JSON-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-INDEX-NEXT: "LineNumber": 47
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: "Members": [
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Name": "RedUserSpecified",
+// JSON-INDEX-NEXT: "ValueExpr": "'A'"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "Name": "GreenUserSpecified",
+// JSON-INDEX-NEXT: "ValueExpr": "2"
+// JSON-INDEX-NEXT: },
+// JSON-INDEX-NEXT: {
+// JSON-INDEX-NEXT: "End": true,
+// JSON-INDEX-NEXT: "Name": "BlueUserSpecified",
+// JSON-INDEX-NEXT: "ValueExpr": "'C'"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-INDEX-NEXT: "Name": "ColorUserSpecified",
+// JSON-INDEX-NEXT: "Scoped": false,
+// JSON-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-INDEX-NEXT: }
+// JSON-INDEX-NEXT: ],
+// JSON-VEHICLES-INDEX-LABEL: "DocumentationFileName": "index",
+// JSON-VEHICLES-INDEX-NEXT: "Enums": [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "Description": {
+// JSON-VEHICLES-INDEX-NEXT: "BriefComments": [
+// JSON-VEHICLES-INDEX-NEXT: [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "TextComment": "specify type of car"
+// JSON-VEHICLES-INDEX-NEXT: }
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: ],
+// JSON-VEHICLES-INDEX-NEXT: "HasBriefComments": true
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: "End": true,
+// JSON-VEHICLES-INDEX-NEXT: "HasComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "InfoType": "enum",
+// JSON-VEHICLES-INDEX-NEXT: "Location": {
+// JSON-VEHICLES-INDEX-NEXT: "Filename": "{{.*}}enum.cpp",
+// JSON-VEHICLES-INDEX-NEXT: "LineNumber": 82
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: "Members": [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "Description": {
+// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
+// JSON-VEHICLES-INDEX-NEXT: [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 1"
+// JSON-VEHICLES-INDEX-NEXT: }
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "Name": "Sedan",
+// JSON-VEHICLES-INDEX-NEXT: "Value": "0"
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "Description": {
+// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
+// JSON-VEHICLES-INDEX-NEXT: [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 2"
+// JSON-VEHICLES-INDEX-NEXT: }
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "Name": "SUV",
+// JSON-VEHICLES-INDEX-NEXT: "Value": "1"
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "Name": "Pickup",
+// JSON-VEHICLES-INDEX-NEXT: "Value": "2"
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "Description": {
+// JSON-VEHICLES-INDEX-NEXT: "HasParagraphComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "ParagraphComments": [
+// JSON-VEHICLES-INDEX-NEXT: [
+// JSON-VEHICLES-INDEX-NEXT: {
+// JSON-VEHICLES-INDEX-NEXT: "TextComment": "Comment 4"
+// JSON-VEHICLES-INDEX-NEXT: }
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: ]
+// JSON-VEHICLES-INDEX-NEXT: },
+// JSON-VEHICLES-INDEX-NEXT: "End": true,
+// JSON-VEHICLES-INDEX-NEXT: "HasEnumMemberComments": true,
+// JSON-VEHICLES-INDEX-NEXT: "Name": "Hatchback",
+// JSON-VEHICLES-INDEX-NEXT: "Value": "3"
+// JSON-VEHICLES-INDEX-NEXT: }
+// JSON-VEHICLES-INDEX-NEXT: ],
+// JSON-VEHICLES-INDEX-NEXT: "Name": "Car",
+// JSON-VEHICLES-INDEX-NEXT: "Namespace": [
+// JSON-VEHICLES-INDEX-NEXT: "Vehicles"
+// JSON-VEHICLES-INDEX-NEXT: ],
+// JSON-VEHICLES-INDEX-NEXT: "Scoped": false,
+// JSON-VEHICLES-INDEX-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-VEHICLES-INDEX-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/json/function-requires.cpp b/clang-tools-extra/test/clang-doc/json/function-requires.cpp
index f07706a84e80e..42471c8afabdd 100644
--- a/clang-tools-extra/test/clang-doc/json/function-requires.cpp
+++ b/clang-tools-extra/test/clang-doc/json/function-requires.cpp
@@ -1,17 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --extra-arg -std=c++20 --output=%t --format=json --executor=standalone %S/../Inputs/function-requires.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json
-template<typename T>
-concept Incrementable = requires(T x) {
- ++x;
- x++;
-};
-
-template<typename T> void increment(T t) requires Incrementable<T>;
-
-template<Incrementable T> Incrementable auto incrementTwo(T t);
-
// CHECK: "Functions": [
// CHECK-NEXT: {
// CHECK-NEXT: "InfoType": "function",
diff --git a/clang-tools-extra/test/clang-doc/json/function-specifiers.cpp b/clang-tools-extra/test/clang-doc/json/function-specifiers.cpp
index 4748042b86ff2..f0804dc6da192 100644
--- a/clang-tools-extra/test/clang-doc/json/function-specifiers.cpp
+++ b/clang-tools-extra/test/clang-doc/json/function-specifiers.cpp
@@ -1,17 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/function-specifiers.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json
-static void myFunction() {}
-
-void noExceptFunction() noexcept {}
-
-inline void inlineFunction() {}
-
-extern void externFunction() {}
-
-constexpr void constexprFunction() {}
-
// CHECK: "Functions": [
// CHECK-NEXT: {
// CHECK: "IsStatic": true,
diff --git a/clang-tools-extra/test/clang-doc/json/index.cpp b/clang-tools-extra/test/clang-doc/json/index.cpp
new file mode 100644
index 0000000000000..8c47de76ebb92
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/json/index.cpp
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=json --pretty-json --output=%t --executor=standalone %S/../Inputs/index.cpp
+// RUN: FileCheck %s < %t/json/index.json -check-prefix=CHECK-JSON
+
+// CHECK-JSON: "Index": [
+// CHECK-JSON-NEXT: {
+// CHECK-JSON-NEXT: "Name": "GlobalNamespace",
+// CHECK-JSON-NEXT: "QualName": "GlobalNamespace",
+// CHECK-JSON-NEXT: "Type": "namespace",
+// CHECK-JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// CHECK-JSON-NEXT: },
+// CHECK-JSON-NEXT: {
+// CHECK-JSON-NEXT: "Name": "inner",
+// CHECK-JSON-NEXT: "QualName": "inner",
+// CHECK-JSON-NEXT: "Type": "namespace",
+// CHECK-JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// CHECK-JSON-NEXT: }
+// CHECK-JSON-NEXT: ]
diff --git a/clang-tools-extra/test/clang-doc/json/inheritance.cpp b/clang-tools-extra/test/clang-doc/json/inheritance.cpp
index abd07e484d22b..788086efa2026 100644
--- a/clang-tools-extra/test/clang-doc/json/inheritance.cpp
+++ b/clang-tools-extra/test/clang-doc/json/inheritance.cpp
@@ -1,15 +1,7 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/inheritance.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json
-class Virtual {};
-class Foo : virtual Virtual {};
-class Bar : Foo {};
-class Fizz : virtual Virtual {};
-class Buzz : Fizz {};
-
-class MyClass : Bar, Buzz {};
-
// CHECK: "Bases": [
// CHECK-NEXT: {
// CHECK-NEXT: "Access": "private",
diff --git a/clang-tools-extra/test/clang-doc/json/long-name.cpp b/clang-tools-extra/test/clang-doc/json/long-name.cpp
new file mode 100644
index 0000000000000..865d3b92ec5fc
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/json/long-name.cpp
@@ -0,0 +1,7 @@
+// UNSUPPORTED: system-windows
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=json --executor=standalone %S/../Inputs/long-name.cpp
+// RUN: ls %t/json/GlobalNamespace | FileCheck %s -check-prefix=CHECK-JSON
+
+// CHECK-JSON: ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12.json
+// CHECK-JSON: _ZTV244ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheL29DE8558215A13A506661C0E01E50AA3E5C9C7FA.json
diff --git a/clang-tools-extra/test/clang-doc/json/method-template.cpp b/clang-tools-extra/test/clang-doc/json/method-template.cpp
index 3b160531f4be4..dc2c255a7d7c3 100644
--- a/clang-tools-extra/test/clang-doc/json/method-template.cpp
+++ b/clang-tools-extra/test/clang-doc/json/method-template.cpp
@@ -1,19 +1,14 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/method-template.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV7MyClass.json
-struct MyClass {
- template<class T> T methodTemplate(T param) {
- }
-};
-
// CHECK: "PublicMethods": [
// CHECK-NEXT: {
// CHECK-NEXT: "InfoType": "function",
// CHECK-NEXT: "IsStatic": false,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}method-template.cpp",
-// CHECK-NEXT: "LineNumber": 6
+// CHECK-NEXT: "LineNumber": 2
// CHECK-NEXT: },
// CHECK-NEXT: "Name": "methodTemplate",
// CHECK-NEXT: "Namespace": [
diff --git a/clang-tools-extra/test/clang-doc/json/multiple-namespaces.cpp b/clang-tools-extra/test/clang-doc/json/multiple-namespaces.cpp
index 4eecd032ac04a..99220fce212dd 100644
--- a/clang-tools-extra/test/clang-doc/json/multiple-namespaces.cpp
+++ b/clang-tools-extra/test/clang-doc/json/multiple-namespaces.cpp
@@ -1,20 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/multiple-namespaces.cpp
// RUN: FileCheck %s < %t/json/foo/tools/index.json --check-prefix=CHECK-FOO
// RUN: FileCheck %s < %t/json/bar/tools/index.json --check-prefix=CHECK-BAR
-namespace foo {
- namespace tools {
- class FooTools {};
- } // namespace tools
-} // namespace foo
-
-namespace bar {
- namespace tools {
- class BarTools {};
- } // namespace tools
-} // namespace bar
-
// CHECK-FOO: "Name": "tools"
// CHECK-BAR: "Name": "tools"
diff --git a/clang-tools-extra/test/clang-doc/json/namespace.cpp b/clang-tools-extra/test/clang-doc/json/namespace.cpp
index b69b97ecc2349..0b436a23a060c 100644
--- a/clang-tools-extra/test/clang-doc/json/namespace.cpp
+++ b/clang-tools-extra/test/clang-doc/json/namespace.cpp
@@ -1,24 +1,6 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=html --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/namespace.cpp
// RUN: FileCheck %s < %t/json/GlobalNamespace/index.json
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=HTML-CHECK
-
-class MyClass {};
-
-void myFunction(int Param);
-
-namespace NestedNamespace {
-} // namespace NestedNamespace
-
-static int Global;
-
-enum Color {
- RED,
- GREEN,
- BLUE = 5
-};
-
-typedef int MyTypedef;
// CHECK: {
// CHECK-NEXT: "DocumentationFileName": "index",
@@ -28,7 +10,7 @@ typedef int MyTypedef;
// CHECK-NEXT: "InfoType": "enum",
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}namespace.cpp",
-// CHECK-NEXT: "LineNumber": 15
+// CHECK-NEXT: "LineNumber": 9
// CHECK-NEXT: },
// CHECK-NEXT: "Members": [
// CHECK-NEXT: {
@@ -111,7 +93,7 @@ typedef int MyTypedef;
// CHECK-NEXT: "IsUsing": false,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}namespace.cpp",
-// CHECK-NEXT: "LineNumber": 21
+// CHECK-NEXT: "LineNumber": 11
// CHECK-NEXT: },
// CHECK-NEXT: "Name": "MyTypedef",
// CHECK-NEXT: "TypeDeclaration": "",
@@ -132,7 +114,7 @@ typedef int MyTypedef;
// CHECK-NEXT: "IsStatic": true,
// CHECK-NEXT: "Location": {
// CHECK-NEXT: "Filename": "{{.*}}namespace.cpp",
-// CHECK-NEXT: "LineNumber": 13
+// CHECK-NEXT: "LineNumber": 7
// CHECK-NEXT: },
// CHECK-NEXT: "Name": "Global",
// CHECK-NEXT: "Type": {
@@ -146,13 +128,3 @@ typedef int MyTypedef;
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
-// HTML-CHECK: <section id="Variables" class="section-container">
-// HTML-CHECK-NEXT: <h2>Variables</h2>
-// HTML-CHECK-NEXT: <div>
-// HTML-CHECK-NEXT: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-// HTML-CHECK-NEXT: <pre><code class="language-cpp code-clang-doc" >static int Global</code></pre>
-// HTML-CHECK-NEXT: <p>Defined at line 13 of file {{.*}}namespace.cpp</p>
-// HTML-CHECK-NEXT: </div>
-// HTML-CHECK-NEXT: </div>
-// HTML-CHECK-NEXT: </section>
diff --git a/clang-tools-extra/test/clang-doc/json/nested-namespace.cpp b/clang-tools-extra/test/clang-doc/json/nested-namespace.cpp
index b8ecb463aad7d..640a70cadb1ca 100644
--- a/clang-tools-extra/test/clang-doc/json/nested-namespace.cpp
+++ b/clang-tools-extra/test/clang-doc/json/nested-namespace.cpp
@@ -1,16 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %s
+// RUN: clang-doc --pretty-json --output=%t --format=json --executor=standalone %S/../Inputs/nested-namespace.cpp
// RUN: FileCheck %s < %t/json/nested/index.json --check-prefix=NESTED
// RUN: FileCheck %s < %t/json/nested/inner/index.json --check-prefix=INNER
-namespace nested {
- int Global;
- namespace inner {
- int InnerGlobal;
- namespace inner_inner {}
- } // namespace inner
-} // namespace nested
-
// NESTED: "Variables": [
// NESTED-NEXT: {
// NESTED-NEXT: "End": true,
@@ -18,7 +10,7 @@ namespace nested {
// NESTED-NEXT: "IsStatic": false,
// NESTED-NEXT: "Location": {
// NESTED-NEXT: "Filename": "{{.*}}nested-namespace.cpp",
-// NESTED-NEXT: "LineNumber": 7
+// NESTED-NEXT: "LineNumber": 2
// NESTED-NEXT: },
// NESTED-NEXT: "Name": "Global",
// NESTED-NEXT: "Namespace": [
@@ -32,7 +24,7 @@ namespace nested {
// INNER-NEXT: "IsStatic": false,
// INNER-NEXT: "Location": {
// INNER-NEXT: "Filename": "{{.*}}nested-namespace.cpp",
-// INNER-NEXT: "LineNumber": 9
+// INNER-NEXT: "LineNumber": 4
// INNER-NEXT: },
// INNER-NEXT: "Name": "InnerGlobal",
// INNER-NEXT: "Namespace": [
diff --git a/clang-tools-extra/test/clang-doc/json/templates.cpp b/clang-tools-extra/test/clang-doc/json/templates.cpp
new file mode 100644
index 0000000000000..55403caab5846
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/json/templates.cpp
@@ -0,0 +1,196 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --pretty-json --doxygen --executor=standalone %S/../Inputs/templates.cpp -output=%t/docs --format=html
+// RUN: FileCheck %s < %t/docs/json/GlobalNamespace/index.json --check-prefix=JSON
+
+// JSON: "Name": "ParamPackFunction",
+// JSON-NEXT: "Params": [
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "args",
+// JSON-NEXT: "ParamEnd": true,
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "T...",
+// JSON-NEXT: "QualName": "T...",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "ReturnType": {
+// JSON-NEXT: "IsBuiltIn": true,
+// JSON-NEXT: "IsTemplate": false,
+// JSON-NEXT: "Name": "void",
+// JSON-NEXT: "QualName": "void",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: },
+// JSON-NEXT: "Template": {
+// JSON-NEXT: "Parameters": [
+// JSON-NEXT: {
+// JSON-NEXT: "End": true,
+// JSON-NEXT: "Param": "class... T"
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "VerticalDisplay": false
+// JSON-NEXT: },
+
+// JSON: "Name": "function",
+// JSON-NEXT: "Params": [
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "x",
+// JSON-NEXT: "ParamEnd": true,
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "T",
+// JSON-NEXT: "QualName": "T",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "ReturnType": {
+// JSON-NEXT: "IsBuiltIn": true,
+// JSON-NEXT: "IsTemplate": false,
+// JSON-NEXT: "Name": "void",
+// JSON-NEXT: "QualName": "void",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: },
+// JSON-NEXT: "Template": {
+// JSON-NEXT: "Parameters": [
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "typename T"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "End": true,
+// JSON-NEXT: "Param": "int U = 1"
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "VerticalDisplay": false
+// JSON-NEXT: }
+
+// JSON: "Name": "longFunction",
+// JSON-NEXT: "Params": [
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "a",
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "A",
+// JSON-NEXT: "QualName": "A",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "b",
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "B",
+// JSON-NEXT: "QualName": "B",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "c",
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "C",
+// JSON-NEXT: "QualName": "C",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "d",
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "D",
+// JSON-NEXT: "QualName": "D",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "e",
+// JSON-NEXT: "ParamEnd": true,
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "E",
+// JSON-NEXT: "QualName": "E",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "ReturnType": {
+// JSON-NEXT: "IsBuiltIn": true,
+// JSON-NEXT: "IsTemplate": false,
+// JSON-NEXT: "Name": "void",
+// JSON-NEXT: "QualName": "void",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: },
+// JSON-NEXT: "Template": {
+// JSON-NEXT: "Parameters": [
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "typename A"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "typename B"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "typename C"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "typename D"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "End": true,
+// JSON-NEXT: "Param": "typename E"
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "VerticalDisplay": true
+// JSON-NEXT: },
+// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}",
+// JSON-NEXT: "VerticalDisplay": true
+// JSON-NEXT: }
+
+// JSON: "Name": "function",
+// JSON-NEXT: "Params": [
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "x",
+// JSON-NEXT: "ParamEnd": true,
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "bool",
+// JSON-NEXT: "QualName": "bool",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: }
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "ReturnType": {
+// JSON-NEXT: "IsBuiltIn": true,
+// JSON-NEXT: "IsTemplate": false,
+// JSON-NEXT: "Name": "void",
+// JSON-NEXT: "QualName": "void",
+// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
+// JSON-NEXT: },
+// JSON-NEXT: "Template": {
+// JSON-NEXT: "Specialization": {
+// JSON-NEXT: "Parameters": [
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "bool"
+// JSON-NEXT: },
+// JSON-NEXT: {
+// JSON-NEXT: "Param": "0",
+// JSON-NEXT: "SpecParamEnd": true
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "SpecializationOf": "{{([0-9A-F]{40})}}",
+// JSON-NEXT: "VerticalDisplay": false
+// JSON-NEXT: }
+// JSON-NEXT: }
+
+// JSON: "Name": "func_with_tuple_param",
+// JSON-NEXT: "Params": [
+// JSON-NEXT: {
+// JSON-NEXT: "Name": "t",
+// JSON-NEXT: "ParamEnd": true,
+// JSON-NEXT: "Type": {
+// JSON-NEXT: "Name": "tuple",
+// JSON-NEXT: "Path": "GlobalNamespace",
+// JSON-NEXT: "QualName": "tuple<int, int, bool>",
+// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-NEXT: }
+// JSON-NEXT: }
+// JSON-NEXT: ],
+// JSON-NEXT: "ReturnType": {
+// JSON-NEXT: "IsBuiltIn": false,
+// JSON-NEXT: "IsTemplate": false,
+// JSON-NEXT: "Name": "tuple",
+// JSON-NEXT: "QualName": "tuple<int, int, bool>",
+// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
+// JSON-NEXT: }
diff --git a/clang-tools-extra/test/clang-doc/long-name.cpp b/clang-tools-extra/test/clang-doc/long-name.cpp
deleted file mode 100644
index e4a5e29f973d5..0000000000000
--- a/clang-tools-extra/test/clang-doc/long-name.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// FIXME: This test seems to break on windows, so disable it for now.
-// UNSUPPORTED: system-windows
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %s
-// RUN: ls %t/json/GlobalNamespace | FileCheck %s -check-prefix=CHECK-JSON
-// RUN: ls %t/html/GlobalNamespace | FileCheck %s -check-prefix=CHECK-HTML
-
-struct ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12 {};
-
-// This name is 1 character over the limit, so it will be serialized as a USR.
-struct ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd123 {};
-
-// CHECK-JSON: ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12.json
-// CHECK-JSON: _ZTV244ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheL29DE8558215A13A506661C0E01E50AA3E5C9C7FA.json
-// CHECK-HTML: ThisStructHasANameThatResultsInAMangledNameThatIsExactly250CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheLengthIsTooLongThenClangDocWillCrashAnd12.html
-// CHECK-HTML: _ZTV244ThisStructHasANameThatResultsInAMangledNameThatIsExactly251CharactersLongThatIsSupposedToTestTheFilenameLengthLimitsWithinClangDocInOrdertoSeeifclangdocwillcrashornotdependingonthelengthofthestructIfTheL29DE8558215A13A506661C0E01E50AA3E5C9C7FA.html
diff --git a/clang-tools-extra/test/clang-doc/array-type.cpp b/clang-tools-extra/test/clang-doc/md/array-type.cpp
similarity index 54%
rename from clang-tools-extra/test/clang-doc/array-type.cpp
rename to clang-tools-extra/test/clang-doc/md/array-type.cpp
index 0e7cef6a60853..3fda12a9d6015 100644
--- a/clang-tools-extra/test/clang-doc/array-type.cpp
+++ b/clang-tools-extra/test/clang-doc/md/array-type.cpp
@@ -1,12 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %S/Inputs/array-type.cpp
-// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
-// RUN: clang-doc --output=%t --format=md --executor=standalone %S/Inputs/array-type.cpp
+// RUN: clang-doc --output=%t --format=md --executor=standalone %S/../Inputs/array-type.cpp
// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/index.md
-// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/Inputs/array-type.cpp
+// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/../Inputs/array-type.cpp
// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/index.md
-// HTML: <pre><code class="language-cpp code-clang-doc">void qux (int (&)[5] arr)</code></pre>
-
// MD: *void qux(int (&)[5] arr)*
// MD-MUSTACHE: *void qux(int (&)[5] arr)*
diff --git a/clang-tools-extra/test/clang-doc/md/builtin_types.cpp b/clang-tools-extra/test/clang-doc/md/builtin_types.cpp
new file mode 100644
index 0000000000000..45c690acc7d86
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/builtin_types.cpp
@@ -0,0 +1,60 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/yaml %t/md %t/md_mustache
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/builtin_types.cpp -output=%t/md --format=md
+// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md --check-prefix=MD
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/builtin_types.cpp -output=%t/md_mustache --format=md_mustache
+// RUN: FileCheck %s < %t/md_mustache/md/GlobalNamespace/index.md --check-prefix=MD-MUSTACHE
+
+// MD: # Global Namespace
+// MD: ## Functions
+
+// MD-MUSTACHE: # Global Namespace
+// MD-MUSTACHE: ## Functions
+
+// MD: ### b
+// MD: *bool b()*
+
+// MD-MUSTACHE: ### b
+// MD-MUSTACHE: *bool b()*
+
+// MD: ### c
+// MD: *char c()*
+
+// MD-MUSTACHE: ### c
+// MD-MUSTACHE: *char c()*
+
+// MD: ### d
+// MD: *double d()*
+
+// MD-MUSTACHE: ### d
+// MD-MUSTACHE: *double d()*
+
+// MD: ### f
+// MD: *float f()*
+
+// MD-MUSTACHE: ### f
+// MD-MUSTACHE: *float f()*
+
+// MD: ### i
+// MD: *int i()*
+
+// MD-MUSTACHE: ### i
+// MD-MUSTACHE: *int i()*
+
+// MD: ### l
+// MD: *long l()*
+
+// MD-MUSTACHE: ### l
+// MD-MUSTACHE: *long l()*
+
+// MD: ### ll
+// MD: *long long ll()*
+
+// MD-MUSTACHE: ### ll
+// MD-MUSTACHE: *long long ll()*
+
+// MD: ### s
+// MD: *short s()*
+
+// MD-MUSTACHE: ### s
+// MD-MUSTACHE: *short s()*
diff --git a/clang-tools-extra/test/clang-doc/md/class-partial-specialization.cpp b/clang-tools-extra/test/clang-doc/md/class-partial-specialization.cpp
new file mode 100644
index 0000000000000..01ebca3f3064a
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/class-partial-specialization.cpp
@@ -0,0 +1,8 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --format=md --executor=standalone %S/../Inputs/class-partial-specialization.cpp
+// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/MyClass.md
+// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/../Inputs/class-partial-specialization.cpp
+// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/_ZTV7MyClassIPT_E.md
+
+// MD: # struct MyClass
+// MD-MUSTACHE: # struct MyClass
diff --git a/clang-tools-extra/test/clang-doc/md/comments-in-macros.cpp b/clang-tools-extra/test/clang-doc/md/comments-in-macros.cpp
new file mode 100644
index 0000000000000..d544dff7c361a
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/comments-in-macros.cpp
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %S/../Inputs/comments-in-macros.cpp
+// RUN: clang-doc --format=md_mustache --doxygen --output=%t --executor=standalone %S/../Inputs/comments-in-macros.cpp
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS-LINE
+// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS
+// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7MyClass.md --check-prefix=MD-MUSTACHE-MYCLASS-LINE
+// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7MyClass.md --check-prefix=MD-MUSTACHE-MYCLASS
+
+// MD-MYCLASS: ### Add
+// MD-MYCLASS: *public int Add(int a, int b)*
+// MD-MYCLASS: **brief** Declare a method to calculate the sum of two numbers
+
+// MD-MUSTACHE-MYCLASS: ### Add
+// MD-MUSTACHE-MYCLASS: *public int Add(int a, int b)*
+// MD-MUSTACHE-MYCLASS: **brief** Declare a method to calculate the sum of two numbers
+
+// MD-MYCLASS-LINE: *Defined at {{.*}}comments-in-macros.cpp#7*
+// MD-MUSTACHE-MYCLASS-LINE: *Defined at {{.*}}comments-in-macros.cpp#7*
diff --git a/clang-tools-extra/test/clang-doc/md/enum.cpp b/clang-tools-extra/test/clang-doc/md/enum.cpp
new file mode 100644
index 0000000000000..cbc507981efcf
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/enum.cpp
@@ -0,0 +1,120 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %S/../Inputs/enum.cpp
+// RUN: clang-doc --format=md_mustache --pretty-json --doxygen --output=%t --executor=standalone %S/../Inputs/enum.cpp
+// RUN: FileCheck %s < %t/GlobalNamespace/index.md --check-prefix=MD-INDEX
+// RUN: FileCheck %s < %t/GlobalNamespace/Animals.md --check-prefix=MD-ANIMAL
+// RUN: FileCheck %s < %t/GlobalNamespace/FilePermissions.md --check-prefix=MD-PERM
+// RUN: FileCheck %s < %t/Vehicles/index.md --check-prefix=MD-VEHICLES
+// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md --check-prefix=MD-MUSTACHE-INDEX
+// RUN: FileCheck %s < %t/md/GlobalNamespace/_ZTV7Animals.md --check-prefix=MD-MUSTACHE-ANIMAL
+// RUN: FileCheck %s < %t/md/Vehicles/index.md --check-prefix=MD-MUSTACHE-VEHICLES
+
+
+
+// MD-INDEX: ## Enums
+// MD-INDEX: | enum Color |
+// MD-INDEX: | Name | Value | Comments |
+// MD-INDEX: |---|---|---|
+// MD-INDEX: | Red | 0 | Comment 1 |
+// MD-INDEX: | Green | 1 | Comment 2 |
+// MD-INDEX: | Blue | 2 | Comment 3 |
+// MD-INDEX: **brief** For specifying RGB colors
+
+// MD-MUSTACHE-INDEX: ## Enums
+// MD-MUSTACHE-INDEX: | enum Color |
+// MD-MUSTACHE-INDEX: --
+// MD-MUSTACHE-INDEX: | Red |
+// MD-MUSTACHE-INDEX: | Green |
+// MD-MUSTACHE-INDEX: | Blue |
+// MD-MUSTACHE-INDEX: **brief** For specifying RGB colors
+
+
+// MD-INDEX: | enum class Shapes |
+// MD-INDEX: | Name | Value | Comments |
+// MD-INDEX: |---|---|---|
+// MD-INDEX: | Circle | 0 | Comment 1 |
+// MD-INDEX: | Rectangle | 1 | Comment 2 |
+// MD-INDEX: | Triangle | 2 | Comment 3 |
+// MD-INDEX: **brief** Shape Types
+
+
+// MD-INDEX: | enum Size : uint8_t |
+// MD-INDEX: | Name | Value | Comments |
+// MD-INDEX: |---|---|---|
+// MD-INDEX: | Small | 0 | A pearl.<br>Pearls are quite small.<br><br>Pearls are used in jewelry. |
+// MD-INDEX: | Medium | 1 | A tennis ball. |
+// MD-INDEX: | Large | 2 | A football. |
+// MD-INDEX: **brief** Specify the size
+
+
+// MD-INDEX: | enum (unnamed) : long long |
+// MD-INDEX: | Name | Value | Comments |
+// MD-INDEX: |---|---|---|
+// MD-INDEX: | BigVal | 999999999999 | A very large value |
+// MD-INDEX: **brief** Very long number
+
+
+// MD-INDEX: | enum ColorUserSpecified |
+// MD-INDEX: | Name | Value |
+// MD-INDEX: |---|---|
+// MD-INDEX: | RedUserSpecified | 65 |
+// MD-INDEX: | GreenUserSpecified | 2 |
+// MD-INDEX: | BlueUserSpecified | 67 |
+
+// MD-MUSTACHE-INDEX: | enum ColorUserSpecified |
+// MD-MUSTACHE-INDEX: --
+// MD-MUSTACHE-INDEX: | RedUserSpecified |
+// MD-MUSTACHE-INDEX: | GreenUserSpecified |
+// MD-MUSTACHE-INDEX: | BlueUserSpecified |
+
+
+// MD-PERM: | enum (unnamed) |
+// MD-PERM: | Name | Value | Comments |
+// MD-PERM: |---|---|---|
+// MD-PERM: | Read | 1 | Permission to READ r |
+// MD-PERM: | Write | 2 | Permission to WRITE w |
+// MD-PERM: | Execute | 4 | Permission to EXECUTE x |
+// MD-PERM: **brief** File permission flags
+
+
+// MD-ANIMAL: # class Animals
+// MD-ANIMAL: ## Enums
+// MD-ANIMAL: | enum AnimalType |
+// MD-ANIMAL: | Name | Value | Comments |
+// MD-ANIMAL: |---|---|---|
+// MD-ANIMAL: | Dog | 0 | Man's best friend |
+// MD-ANIMAL: | Cat | 1 | Man's other best friend |
+// MD-ANIMAL: | Iguana | 2 | A lizard |
+// MD-ANIMAL: **brief** specify what animal the class is
+
+// MD-MUSTACHE-ANIMAL: # class Animals
+// MD-MUSTACHE-ANIMAL: ## Enums
+// MD-MUSTACHE-ANIMAL: | enum AnimalType |
+// MD-MUSTACHE-ANIMAL: --
+// MD-MUSTACHE-ANIMAL: | Dog |
+// MD-MUSTACHE-ANIMAL: | Cat |
+// MD-MUSTACHE-ANIMAL: | Iguana |
+// MD-MUSTACHE-ANIMAL: **brief** specify what animal the class is
+
+
+// MD-VEHICLES: # namespace Vehicles
+// MD-VEHICLES: ## Enums
+// MD-VEHICLES: | enum Car |
+// MD-VEHICLES: | Name | Value | Comments |
+// MD-VEHICLES: |---|---|---|
+// MD-VEHICLES: | Sedan | 0 | Comment 1 |
+// MD-VEHICLES: | SUV | 1 | Comment 2 |
+// MD-VEHICLES: | Pickup | 2 | -- |
+// MD-VEHICLES: | Hatchback | 3 | Comment 4 |
+// MD-VEHICLES: **brief** specify type of car
+
+// MD-MUSTACHE-VEHICLES: # namespace Vehicles
+// MD-MUSTACHE-VEHICLES: ## Enums
+// MD-MUSTACHE-VEHICLES: | enum Car |
+// MD-MUSTACHE-VEHICLES: --
+// MD-MUSTACHE-VEHICLES: | Sedan |
+// MD-MUSTACHE-VEHICLES: | SUV |
+// MD-MUSTACHE-VEHICLES: | Pickup |
+// MD-MUSTACHE-VEHICLES: | Hatchback |
+// MD-MUSTACHE-VEHICLES: **brief** specify type of car
+
diff --git a/clang-tools-extra/test/clang-doc/function-pointer-type.cpp b/clang-tools-extra/test/clang-doc/md/function-pointer-type.cpp
similarity index 52%
rename from clang-tools-extra/test/clang-doc/function-pointer-type.cpp
rename to clang-tools-extra/test/clang-doc/md/function-pointer-type.cpp
index ede36472564aa..2983adb00893f 100644
--- a/clang-tools-extra/test/clang-doc/function-pointer-type.cpp
+++ b/clang-tools-extra/test/clang-doc/md/function-pointer-type.cpp
@@ -1,12 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %S/Inputs/function-pointer-type.cpp
-// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
-// RUN: clang-doc --output=%t --format=md --executor=standalone %S/Inputs/function-pointer-type.cpp
+// RUN: clang-doc --output=%t --format=md --executor=standalone %S/../Inputs/function-pointer-type.cpp
// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/index.md
-// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/Inputs/function-pointer-type.cpp
+// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/../Inputs/function-pointer-type.cpp
// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/index.md
-// HTML: <pre><code class="language-cpp code-clang-doc">void bar (void (*)(int) fn)</code></pre>
-
// MD: *void bar(void (*)(int) fn)*
// MD-MUSTACHE: *void bar(void (*)(int) fn)*
diff --git a/clang-tools-extra/test/clang-doc/member-function-pointer-type.cpp b/clang-tools-extra/test/clang-doc/md/member-function-pointer-type.cpp
similarity index 51%
rename from clang-tools-extra/test/clang-doc/member-function-pointer-type.cpp
rename to clang-tools-extra/test/clang-doc/md/member-function-pointer-type.cpp
index 4906c0c4ca966..a84467f8d9c2c 100644
--- a/clang-tools-extra/test/clang-doc/member-function-pointer-type.cpp
+++ b/clang-tools-extra/test/clang-doc/md/member-function-pointer-type.cpp
@@ -1,12 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %S/Inputs/member-function-pointer-type.cpp
-// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
-// RUN: clang-doc --output=%t --format=md --executor=standalone %S/Inputs/member-function-pointer-type.cpp
+// RUN: clang-doc --output=%t --format=md --executor=standalone %S/../Inputs/member-function-pointer-type.cpp
// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/index.md
-// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/Inputs/member-function-pointer-type.cpp
+// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/../Inputs/member-function-pointer-type.cpp
// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/index.md
-// HTML: <pre><code class="language-cpp code-clang-doc">void baz (void (Class::*)(int) fn)</code></pre>
-
// MD: *void baz(void (Class::*)(int) fn)*
// MD-MUSTACHE: *void baz(void (Class::*)(int) fn)*
diff --git a/clang-tools-extra/test/clang-doc/md/namespace.cpp b/clang-tools-extra/test/clang-doc/md/namespace.cpp
new file mode 100644
index 0000000000000..8a89eda6a6d50
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/namespace.cpp
@@ -0,0 +1,194 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --format=md --output=%t --executor=standalone %S/../Inputs/namespace-html-md.cpp
+// RUN: FileCheck %s < %t/@nonymous_namespace/AnonClass.md -check-prefix=MD-ANON-CLASS-LINE
+// RUN: FileCheck %s < %t/@nonymous_namespace/AnonClass.md -check-prefix=MD-ANON-CLASS
+// RUN: FileCheck %s < %t/@nonymous_namespace/index.md -check-prefix=MD-ANON-INDEX-LINE
+// RUN: FileCheck %s < %t/@nonymous_namespace/index.md -check-prefix=MD-ANON-INDEX
+// RUN: FileCheck %s < %t/AnotherNamespace/ClassInAnotherNamespace.md -check-prefix=MD-ANOTHER-CLASS-LINE
+// RUN: FileCheck %s < %t/AnotherNamespace/ClassInAnotherNamespace.md -check-prefix=MD-ANOTHER-CLASS
+// RUN: FileCheck %s < %t/AnotherNamespace/index.md -check-prefix=MD-ANOTHER-INDEX-LINE
+// RUN: FileCheck %s < %t/AnotherNamespace/index.md -check-prefix=MD-ANOTHER-INDEX
+// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/ClassInNestedNamespace.md -check-prefix=MD-NESTED-CLASS-LINE
+// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/ClassInNestedNamespace.md -check-prefix=MD-NESTED-CLASS
+// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-NESTED-INDEX-LINE
+// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-NESTED-INDEX
+// RUN: FileCheck %s < %t/PrimaryNamespace/index.md -check-prefix=MD-PRIMARY-INDEX-LINE
+// RUN: FileCheck %s < %t/PrimaryNamespace/index.md -check-prefix=MD-PRIMARY-INDEX
+// RUN: FileCheck %s < %t/PrimaryNamespace/ClassInPrimaryNamespace.md -check-prefix=MD-PRIMARY-CLASS-LINE
+// RUN: FileCheck %s < %t/PrimaryNamespace/ClassInPrimaryNamespace.md -check-prefix=MD-PRIMARY-CLASS
+// RUN: FileCheck %s < %t/GlobalNamespace/index.md -check-prefix=MD-GLOBAL-INDEX
+// RUN: FileCheck %s < %t/all_files.md -check-prefix=MD-ALL-FILES
+// RUN: FileCheck %s < %t/index.md -check-prefix=MD-INDEX
+// RUN: clang-doc --format=md_mustache --output=%t --executor=standalone %S/../Inputs/namespace-html-md.cpp
+// RUN: FileCheck %s < %t/md/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.md -check-prefix=MD-MUSTACHE-ANON-CLASS-LINE
+// RUN: FileCheck %s < %t/md/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.md -check-prefix=MD-MUSTACHE-ANON-CLASS
+// RUN: FileCheck %s < %t/md/@nonymous_namespace/index.md -check-prefix=MD-MUSTACHE-ANON-INDEX-LINE
+// RUN: FileCheck %s < %t/md/@nonymous_namespace/index.md -check-prefix=MD-MUSTACHE-ANON-INDEX
+// RUN: FileCheck %s < %t/md/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.md -check-prefix=MD-MUSTACHE-ANOTHER-CLASS-LINE
+// RUN: FileCheck %s < %t/md/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.md -check-prefix=MD-MUSTACHE-ANOTHER-CLASS
+// RUN: FileCheck %s < %t/md/AnotherNamespace/index.md -check-prefix=MD-MUSTACHE-ANOTHER-INDEX-LINE
+// RUN: FileCheck %s < %t/md/AnotherNamespace/index.md -check-prefix=MD-MUSTACHE-ANOTHER-INDEX
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.md -check-prefix=MD-MUSTACHE-NESTED-CLASS-LINE
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.md -check-prefix=MD-MUSTACHE-NESTED-CLASS
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-MUSTACHE-NESTED-INDEX-LINE
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-MUSTACHE-NESTED-INDEX
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/index.md -check-prefix=MD-MUSTACHE-PRIMARY-INDEX-LINE
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/index.md -check-prefix=MD-MUSTACHE-PRIMARY-INDEX
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.md -check-prefix=MD-MUSTACHE-PRIMARY-CLASS-LINE
+// RUN: FileCheck %s < %t/md/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.md -check-prefix=MD-MUSTACHE-PRIMARY-CLASS
+// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md -check-prefix=MD-MUSTACHE-GLOBAL-INDEX
+// RUN: FileCheck %s < %t/md/all_files.md -check-prefix=MD-MUSTACHE-ALL-FILES
+// RUN: FileCheck %s < %t/md/index.md -check-prefix=MD-MUSTACHE-INDEX
+
+// MD-ANON-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#3*
+// MD-MUSTACHE-ANON-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#3*
+
+// MD-ANON-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#4*
+// MD-MUSTACHE-ANON-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#4*
+
+// MD-ANON-CLASS: # class AnonClass
+// MD-MUSTACHE-ANON-CLASS: # class AnonClass
+
+// MD-ANON-INDEX: # namespace @nonymous_namespace
+// MD-ANON-INDEX: Anonymous Namespace
+// MD-ANON-INDEX: ## Records
+// MD-ANON-INDEX: * [AnonClass](AnonClass.md)
+// MD-ANON-INDEX: ## Functions
+// MD-ANON-INDEX: ### anonFunction
+// MD-ANON-INDEX: *void anonFunction()*
+
+// MD-MUSTACHE-ANON-INDEX: # namespace @nonymous_namespace
+// MD-MUSTACHE-ANON-INDEX: Anonymous Namespace
+// MD-MUSTACHE-ANON-INDEX: ## Records
+// MD-MUSTACHE-ANON-INDEX: * [AnonClass](AnonClass.md)
+// MD-MUSTACHE-ANON-INDEX: ## Functions
+// MD-MUSTACHE-ANON-INDEX: ### anonFunction
+// MD-MUSTACHE-ANON-INDEX: *void anonFunction()*
+
+// MD-PRIMARY-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#10*
+// MD-MUSTACHE-PRIMARY-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#10*
+
+// MD-PRIMARY-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#12*
+// MD-MUSTACHE-PRIMARY-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#12*
+
+// MD-PRIMARY-CLASS: # class ClassInPrimaryNamespace
+// MD-PRIMARY-CLASS: Class in PrimaryNamespace
+
+// MD-MUSTACHE-PRIMARY-CLASS: # class ClassInPrimaryNamespace
+// MD-MUSTACHE-PRIMARY-CLASS: Class in PrimaryNamespace
+
+// MD-NESTED-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#17*
+// MD-MUSTACHE-NESTED-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#17*
+
+// MD-NESTED-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#19*
+// MD-MUSTACHE-NESTED-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#19*
+
+// MD-NESTED-CLASS: # class ClassInNestedNamespace
+// MD-NESTED-CLASS: Class in NestedNamespace
+
+// MD-MUSTACHE-NESTED-CLASS: # class ClassInNestedNamespace
+// MD-MUSTACHE-NESTED-CLASS: Class in NestedNamespace
+
+// MD-NESTED-INDEX: # namespace NestedNamespace
+// MD-NESTED-INDEX: Nested namespace
+// MD-NESTED-INDEX: ## Records
+// MD-NESTED-INDEX: * [ClassInNestedNamespace](ClassInNestedNamespace.md)
+// MD-NESTED-INDEX: ## Functions
+// MD-NESTED-INDEX: ### functionInNestedNamespace
+// MD-NESTED-INDEX: *void functionInNestedNamespace()*
+// MD-NESTED-INDEX: Function in NestedNamespace
+
+// MD-MUSTACHE-NESTED-INDEX: # namespace NestedNamespace
+// MD-MUSTACHE-NESTED-INDEX: Nested namespace
+// MD-MUSTACHE-NESTED-INDEX: ## Records
+// MD-MUSTACHE-NESTED-INDEX: * [ClassInNestedNamespace](ClassInNestedNamespace.md)
+// MD-MUSTACHE-NESTED-INDEX: ## Functions
+// MD-MUSTACHE-NESTED-INDEX: ### functionInNestedNamespace
+// MD-MUSTACHE-NESTED-INDEX: *void functionInNestedNamespace()*
+// MD-MUSTACHE-NESTED-INDEX: Function in NestedNamespace
+
+// MD-PRIMARY-INDEX: # namespace PrimaryNamespace
+// MD-PRIMARY-INDEX: Primary Namespace
+// MD-PRIMARY-INDEX: ## Namespaces
+// MD-PRIMARY-INDEX: * [NestedNamespace](NestedNamespace{{[\/]}}index.md)
+// MD-PRIMARY-INDEX: ## Records
+// MD-PRIMARY-INDEX: * [ClassInPrimaryNamespace](ClassInPrimaryNamespace.md)
+// MD-PRIMARY-INDEX: ## Functions
+// MD-PRIMARY-INDEX: ### functionInPrimaryNamespace
+// MD-PRIMARY-INDEX: *void functionInPrimaryNamespace()*
+// MD-PRIMARY-INDEX: Function in PrimaryNamespace
+
+// MD-MUSTACHE-PRIMARY-INDEX: # namespace PrimaryNamespace
+// MD-MUSTACHE-PRIMARY-INDEX: Primary Namespace
+// MD-MUSTACHE-PRIMARY-INDEX: ## Namespaces
+// MD-MUSTACHE-PRIMARY-INDEX: * [NestedNamespace](NestedNamespace{{[\/]}}index.md)
+// MD-MUSTACHE-PRIMARY-INDEX: ## Records
+// MD-MUSTACHE-PRIMARY-INDEX: * [ClassInPrimaryNamespace](ClassInPrimaryNamespace.md)
+// MD-MUSTACHE-PRIMARY-INDEX: ## Functions
+// MD-MUSTACHE-PRIMARY-INDEX: ### functionInPrimaryNamespace
+// MD-MUSTACHE-PRIMARY-INDEX: *void functionInPrimaryNamespace()*
+// MD-MUSTACHE-PRIMARY-INDEX: Function in PrimaryNamespace
+
+// MD-ANOTHER-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#26*
+// MD-MUSTACHE-ANOTHER-INDEX-LINE: *Defined at {{.*}}namespace-html-md.cpp#26*
+
+// MD-ANOTHER-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#28*
+// MD-MUSTACHE-ANOTHER-CLASS-LINE: *Defined at {{.*}}namespace-html-md.cpp#28*
+
+// MD-ANOTHER-CLASS: # class ClassInAnotherNamespace
+// MD-ANOTHER-CLASS: Class in AnotherNamespace
+
+// MD-MUSTACHE-ANOTHER-CLASS: # class ClassInAnotherNamespace
+// MD-MUSTACHE-ANOTHER-CLASS: Class in AnotherNamespace
+
+// MD-ANOTHER-INDEX: # namespace AnotherNamespace
+// MD-ANOTHER-INDEX: AnotherNamespace
+// MD-ANOTHER-INDEX: ## Records
+// MD-ANOTHER-INDEX: * [ClassInAnotherNamespace](ClassInAnotherNamespace.md)
+// MD-ANOTHER-INDEX: ## Functions
+// MD-ANOTHER-INDEX: ### functionInAnotherNamespace
+// MD-ANOTHER-INDEX: *void functionInAnotherNamespace()*
+// MD-ANOTHER-INDEX: Function in AnotherNamespace
+
+// MD-MUSTACHE-ANOTHER-INDEX: # namespace AnotherNamespace
+// MD-MUSTACHE-ANOTHER-INDEX: AnotherNamespace
+// MD-MUSTACHE-ANOTHER-INDEX: ## Records
+// MD-MUSTACHE-ANOTHER-INDEX: * [ClassInAnotherNamespace](ClassInAnotherNamespace.md)
+// MD-MUSTACHE-ANOTHER-INDEX: ## Functions
+// MD-MUSTACHE-ANOTHER-INDEX: ### functionInAnotherNamespace
+// MD-MUSTACHE-ANOTHER-INDEX: *void functionInAnotherNamespace()*
+// MD-MUSTACHE-ANOTHER-INDEX: Function in AnotherNamespace
+
+// MD-GLOBAL-INDEX: # Global Namespace
+// MD-GLOBAL-INDEX: ## Namespaces
+// MD-GLOBAL-INDEX: * [@nonymous_namespace](..{{[\/]}}@nonymous_namespace{{[\/]}}index.md)
+// MD-GLOBAL-INDEX: * [AnotherNamespace](..{{[\/]}}AnotherNamespace{{[\/]}}index.md)
+// MD-GLOBAL-INDEX: * [PrimaryNamespace](..{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
+
+// MD-MUSTACHE-GLOBAL-INDEX: # Global Namespace
+// MD-MUSTACHE-GLOBAL-INDEX: ## Namespaces
+// MD-MUSTACHE-GLOBAL-INDEX: * [@nonymous_namespace]({{.*}}{{[\/]}}@nonymous_namespace{{[\/]}}index.md)
+// MD-MUSTACHE-GLOBAL-INDEX: * [AnotherNamespace]({{.*}}{{[\/]}}AnotherNamespace{{[\/]}}index.md)
+// MD-MUSTACHE-GLOBAL-INDEX: * [PrimaryNamespace]({{.*}}{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
+
+// MD-ALL-FILES: # All Files
+// MD-ALL-FILES: ## [@nonymous_namespace](@nonymous_namespace{{[\/]}}index.md)
+// MD-ALL-FILES: ## [AnotherNamespace](AnotherNamespace{{[\/]}}index.md)
+// MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)
+// MD-ALL-FILES: ## [PrimaryNamespace](PrimaryNamespace{{[\/]}}index.md)
+
+// MD-MUSTACHE-ALL-FILES: # All Files
+// MD-MUSTACHE-ALL-FILES: ## [@nonymous_namespace](@nonymous_namespace{{[\/]}}index.md)
+// MD-MUSTACHE-ALL-FILES: ## [AnotherNamespace](AnotherNamespace{{[\/]}}index.md)
+// MD-MUSTACHE-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)
+// MD-MUSTACHE-ALL-FILES: ## [PrimaryNamespace](PrimaryNamespace{{[\/]}}index.md)
+
+// MD-INDEX: # C/C++ Reference
+// MD-INDEX: * Namespace: [@nonymous_namespace](@nonymous_namespace)
+// MD-INDEX: * Namespace: [AnotherNamespace](AnotherNamespace)
+// MD-INDEX: * Namespace: [PrimaryNamespace](PrimaryNamespace)
+
+// MD-MUSTACHE-INDEX: # C/C++ Reference
+// MD-MUSTACHE-INDEX: * Namespace: [@nonymous_namespace](@nonymous_namespace)
+// MD-MUSTACHE-INDEX: * Namespace: [AnotherNamespace](AnotherNamespace)
+// MD-MUSTACHE-INDEX: * Namespace: [PrimaryNamespace](PrimaryNamespace)
diff --git a/clang-tools-extra/test/clang-doc/nested-pointer-qualifiers.cpp b/clang-tools-extra/test/clang-doc/md/nested-pointer-qualifiers.cpp
similarity index 51%
rename from clang-tools-extra/test/clang-doc/nested-pointer-qualifiers.cpp
rename to clang-tools-extra/test/clang-doc/md/nested-pointer-qualifiers.cpp
index dc204f044711b..b2db895ba1e4f 100644
--- a/clang-tools-extra/test/clang-doc/nested-pointer-qualifiers.cpp
+++ b/clang-tools-extra/test/clang-doc/md/nested-pointer-qualifiers.cpp
@@ -1,12 +1,8 @@
// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --output=%t --format=html --executor=standalone %S/Inputs/nested-pointer-qualifiers.cpp
-// RUN: FileCheck %s --check-prefix=HTML < %t/html/GlobalNamespace/index.html
-// RUN: clang-doc --output=%t --format=md --executor=standalone %S/Inputs/nested-pointer-qualifiers.cpp
+// RUN: clang-doc --output=%t --format=md --executor=standalone %S/../Inputs/nested-pointer-qualifiers.cpp
// RUN: FileCheck %s --check-prefix=MD < %t/GlobalNamespace/index.md
-// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/Inputs/nested-pointer-qualifiers.cpp
+// RUN: clang-doc --output=%t --format=md_mustache --executor=standalone %S/../Inputs/nested-pointer-qualifiers.cpp
// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/md/GlobalNamespace/index.md
-// HTML: <pre><code class="language-cpp code-clang-doc">void foo (const int *const * ptr)</code></pre>
-
// MD: *void foo(const int *const * ptr)*
// MD-MUSTACHE: *void foo(const int *const * ptr)*
diff --git a/clang-tools-extra/test/clang-doc/md/templates.cpp b/clang-tools-extra/test/clang-doc/md/templates.cpp
new file mode 100644
index 0000000000000..7b6d3b613fc04
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/md/templates.cpp
@@ -0,0 +1,49 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/templates.cpp -output=%t/docs --format=md
+// RUN: FileCheck %s --check-prefix=MD < %t/docs/GlobalNamespace/index.md
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/templates.cpp -output=%t/docs --format=md_mustache
+// RUN: FileCheck %s --check-prefix=MD-MUSTACHE < %t/docs/md/GlobalNamespace/index.md
+
+// MD: # Global Namespace
+// MD: ## Functions
+
+// MD-MUSTACHE: # Global Namespace
+// MD-MUSTACHE: ## Functions
+
+// MD: ### ParamPackFunction
+// MD: *void ParamPackFunction(T... args)*
+
+// MD-MUSTACHE: ### ParamPackFunction
+// MD-MUSTACHE: *void ParamPackFunction(T... args)*
+
+// MD: ### function
+// MD: *void function(T x)*
+// MD: *Defined at {{.*}}templates.cpp#3*
+
+// MD-MUSTACHE: ### function
+// MD-MUSTACHE: *void function(T x)*
+// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#3*
+
+// MD: ### longFunction
+// MD: *void longFunction(A a, B b, C c, D d, E e)*
+// MD: *Defined at {{.*}}templates.cpp#6*
+
+// MD: ### function
+// MD: *void function(bool x)*
+// MD: *Defined at {{.*}}templates.cpp#8*
+
+// MD-MUSTACHE: ### function
+// MD-MUSTACHE: *void function(bool x)*
+// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#8*
+
+// MD: ### func_with_tuple_param
+// MD: *tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t)*
+// MD: *Defined at {{.*}}templates.cpp#18*
+// MD: A function with a tuple parameter
+// MD: **t** The input to func_with_tuple_param
+
+// MD-MUSTACHE: ### func_with_tuple_param
+// MD-MUSTACHE: *tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t)*
+// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#18*
+// MD-MUSTACHE: A function with a tuple parameter
+// MD-MUSTACHE: **t** The input to func_with_tuple_param
diff --git a/clang-tools-extra/test/clang-doc/namespace.cpp b/clang-tools-extra/test/clang-doc/namespace.cpp
deleted file mode 100644
index e39fbacb62638..0000000000000
--- a/clang-tools-extra/test/clang-doc/namespace.cpp
+++ /dev/null
@@ -1,380 +0,0 @@
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: clang-doc --format=html --output=%t --executor=standalone %s
-// RUN: clang-doc --format=md --output=%t --executor=standalone %s
-// RUN: FileCheck %s < %t/@nonymous_namespace/AnonClass.md -check-prefix=MD-ANON-CLASS-LINE
-// RUN: FileCheck %s < %t/@nonymous_namespace/AnonClass.md -check-prefix=MD-ANON-CLASS
-// RUN: FileCheck %s < %t/@nonymous_namespace/index.md -check-prefix=MD-ANON-INDEX-LINE
-// RUN: FileCheck %s < %t/@nonymous_namespace/index.md -check-prefix=MD-ANON-INDEX
-// RUN: FileCheck %s < %t/AnotherNamespace/ClassInAnotherNamespace.md -check-prefix=MD-ANOTHER-CLASS-LINE
-// RUN: FileCheck %s < %t/AnotherNamespace/ClassInAnotherNamespace.md -check-prefix=MD-ANOTHER-CLASS
-// RUN: FileCheck %s < %t/AnotherNamespace/index.md -check-prefix=MD-ANOTHER-INDEX-LINE
-// RUN: FileCheck %s < %t/AnotherNamespace/index.md -check-prefix=MD-ANOTHER-INDEX
-// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/ClassInNestedNamespace.md -check-prefix=MD-NESTED-CLASS-LINE
-// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/ClassInNestedNamespace.md -check-prefix=MD-NESTED-CLASS
-// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-NESTED-INDEX-LINE
-// RUN: FileCheck %s < %t/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-NESTED-INDEX
-// RUN: FileCheck %s < %t/PrimaryNamespace/index.md -check-prefix=MD-PRIMARY-INDEX-LINE
-// RUN: FileCheck %s < %t/PrimaryNamespace/index.md -check-prefix=MD-PRIMARY-INDEX
-// RUN: FileCheck %s < %t/PrimaryNamespace/ClassInPrimaryNamespace.md -check-prefix=MD-PRIMARY-CLASS-LINE
-// RUN: FileCheck %s < %t/PrimaryNamespace/ClassInPrimaryNamespace.md -check-prefix=MD-PRIMARY-CLASS
-// RUN: FileCheck %s < %t/html/GlobalNamespace/index.html -check-prefix=HTML-GLOBAL-INDEX
-// RUN: FileCheck %s < %t/GlobalNamespace/index.md -check-prefix=MD-GLOBAL-INDEX
-// RUN: FileCheck %s < %t/all_files.md -check-prefix=MD-ALL-FILES
-// RUN: FileCheck %s < %t/index.md -check-prefix=MD-INDEX
-// RUN: FileCheck %s < %t/html/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.html -check-prefix=HTML-ANON-CLASS-LINE
-// RUN: FileCheck %s < %t/html/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.html -check-prefix=HTML-ANON-CLASS
-// RUN: FileCheck %s < %t/html/@nonymous_namespace/index.html -check-prefix=HTML-ANON-INDEX-LINE
-// RUN: FileCheck %s < %t/html/@nonymous_namespace/index.html -check-prefix=HTML-ANON-INDEX
-// RUN: FileCheck %s < %t/html/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html -check-prefix=HTML-ANOTHER-CLASS-LINE
-// RUN: FileCheck %s < %t/html/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html -check-prefix=HTML-ANOTHER-CLASS
-// RUN: FileCheck %s < %t/html/AnotherNamespace/index.html -check-prefix=HTML-ANOTHER-INDEX-LINE
-// RUN: FileCheck %s < %t/html/AnotherNamespace/index.html -check-prefix=HTML-ANOTHER-INDEX
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html -check-prefix=HTML-NESTED-CLASS-LINE
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html -check-prefix=HTML-NESTED-CLASS
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/index.html -check-prefix=HTML-NESTED-INDEX-LINE
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/NestedNamespace/index.html -check-prefix=HTML-NESTED-INDEX
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/index.html -check-prefix=HTML-PRIMARY-INDEX-LINE
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/index.html -check-prefix=HTML-PRIMARY-INDEX
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html -check-prefix=HTML-PRIMARY-CLASS-LINE
-// RUN: FileCheck %s < %t/html/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html -check-prefix=HTML-PRIMARY-CLASS
-
-// COM: FIXME: Add global functions to the namespace template
-// COM: FIXME: Add namespaces to the namespace template
-
-// RUN: clang-doc --format=md_mustache --output=%t --executor=standalone %s
-// RUN: FileCheck %s < %t/md/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.md -check-prefix=MD-MUSTACHE-ANON-CLASS-LINE
-// RUN: FileCheck %s < %t/md/@nonymous_namespace/_ZTVN12_GLOBAL__N_19AnonClassE.md -check-prefix=MD-MUSTACHE-ANON-CLASS
-// RUN: FileCheck %s < %t/md/@nonymous_namespace/index.md -check-prefix=MD-MUSTACHE-ANON-INDEX-LINE
-// RUN: FileCheck %s < %t/md/@nonymous_namespace/index.md -check-prefix=MD-MUSTACHE-ANON-INDEX
-// RUN: FileCheck %s < %t/md/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.md -check-prefix=MD-MUSTACHE-ANOTHER-CLASS-LINE
-// RUN: FileCheck %s < %t/md/AnotherNamespace/_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.md -check-prefix=MD-MUSTACHE-ANOTHER-CLASS
-// RUN: FileCheck %s < %t/md/AnotherNamespace/index.md -check-prefix=MD-MUSTACHE-ANOTHER-INDEX-LINE
-// RUN: FileCheck %s < %t/md/AnotherNamespace/index.md -check-prefix=MD-MUSTACHE-ANOTHER-INDEX
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.md -check-prefix=MD-MUSTACHE-NESTED-CLASS-LINE
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.md -check-prefix=MD-MUSTACHE-NESTED-CLASS
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-MUSTACHE-NESTED-INDEX-LINE
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/NestedNamespace/index.md -check-prefix=MD-MUSTACHE-NESTED-INDEX
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/index.md -check-prefix=MD-MUSTACHE-PRIMARY-INDEX-LINE
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/index.md -check-prefix=MD-MUSTACHE-PRIMARY-INDEX
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.md -check-prefix=MD-MUSTACHE-PRIMARY-CLASS-LINE
-// RUN: FileCheck %s < %t/md/PrimaryNamespace/_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.md -check-prefix=MD-MUSTACHE-PRIMARY-CLASS
-// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md -check-prefix=MD-MUSTACHE-GLOBAL-INDEX
-// RUN: FileCheck %s < %t/md/all_files.md -check-prefix=MD-MUSTACHE-ALL-FILES
-// RUN: FileCheck %s < %t/md/index.md -check-prefix=MD-MUSTACHE-INDEX
-
-// Anonymous Namespace
-namespace {
-void anonFunction() {}
-// MD-ANON-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// MD-MUSTACHE-ANON-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-2]]*
-// HTML-ANON-INDEX-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-
-class AnonClass {};
-// MD-ANON-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// MD-MUSTACHE-ANON-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-2]]*
-// HTML-ANON-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-
-// MD-ANON-CLASS: # class AnonClass
-// MD-MUSTACHE-ANON-CLASS: # class AnonClass
-// HTML-ANON-CLASS: <h1 class="hero__title-large">class AnonClass</h1>
-// MUSTACHE-ANON-CLASS: <h1 class="hero__title-large">class AnonClass</h1>
-} // namespace
-
-// MD-ANON-INDEX: # namespace @nonymous_namespace
-// MD-ANON-INDEX: Anonymous Namespace
-// MD-ANON-INDEX: ## Records
-// MD-ANON-INDEX: * [AnonClass](AnonClass.md)
-// MD-ANON-INDEX: ## Functions
-// MD-ANON-INDEX: ### anonFunction
-// MD-ANON-INDEX: *void anonFunction()*
-
-// HTML-ANON-INDEX: <div class="navbar-breadcrumb-container">
-// HTML-ANON-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
-// HTML-ANON-INDEX: </div>
-// HTML-ANON-INDEX: <h2>@nonymous_namespace</h2>
-// HTML-ANON-INDEX: <h2>Records</h2>
-// HTML-ANON-INDEX: <ul class="class-container">
-// HTML-ANON-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-ANON-INDEX: <a href="_ZTVN12_GLOBAL__N_19AnonClassE.html">
-// HTML-ANON-INDEX: <pre><code class="language-cpp code-clang-doc">class AnonClass</code></pre>
-// HTML-ANON-INDEX: </a>
-// HTML-ANON-INDEX: </li>
-// HTML-ANON-INDEX-NOT: <h2 id="Functions">Functions</h2>
-// HTML-ANON-INDEX-NOT: <h3 id="{{([0-9A-F]{40})}}">anonFunction</h3>
-// HTML-ANON-INDEX-NOT: <p>void anonFunction()</p>
-
-// MD-MUSTACHE-ANON-INDEX: # namespace @nonymous_namespace
-// MD-MUSTACHE-ANON-INDEX: Anonymous Namespace
-// MD-MUSTACHE-ANON-INDEX: ## Records
-// MD-MUSTACHE-ANON-INDEX: * [AnonClass](AnonClass.md)
-// MD-MUSTACHE-ANON-INDEX: ## Functions
-// MD-MUSTACHE-ANON-INDEX: ### anonFunction
-// MD-MUSTACHE-ANON-INDEX: *void anonFunction()*
-
-// Primary Namespace
-namespace PrimaryNamespace {
-// Function in PrimaryNamespace
-void functionInPrimaryNamespace() {}
-// MD-PRIMARY-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-PRIMARY-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-PRIMARY-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// Class in PrimaryNamespace
-class ClassInPrimaryNamespace {};
-// MD-PRIMARY-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-PRIMARY-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// MD-PRIMARY-CLASS: # class ClassInPrimaryNamespace
-// MD-PRIMARY-CLASS: Class in PrimaryNamespace
-
-// HTML-PRIMARY-CLASS: <div class="navbar-breadcrumb-container">
-// HTML-PRIMARY-CLASS: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
-// HTML-PRIMARY-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>
-// HTML-PRIMARY-CLASS: </div>
-
-// MD-MUSTACHE-PRIMARY-CLASS: # class ClassInPrimaryNamespace
-// MD-MUSTACHE-PRIMARY-CLASS: Class in PrimaryNamespace
-
-// HTML-PRIMARY-CLASS: <h1 class="hero__title-large">class ClassInPrimaryNamespace</h1>
-
-// MUSTACHE-PRIMARY-CLASS: <h1 class="hero__title-large">class ClassInPrimaryNamespace</h1>
-
-// Nested namespace
-namespace NestedNamespace {
-// Function in NestedNamespace
-void functionInNestedNamespace() {}
-// MD-NESTED-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-NESTED-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-NESTED-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// Class in NestedNamespace
-class ClassInNestedNamespace {};
-// MD-NESTED-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-NESTED-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// MD-NESTED-CLASS: # class ClassInNestedNamespace
-// MD-NESTED-CLASS: Class in NestedNamespace
-
-// HTML-NESTED-CLASS: <div class="navbar-breadcrumb-container">
-// HTML-NESTED-CLASS: <a href="../../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
-// HTML-NESTED-CLASS: <a href="../index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>::
-// HTML-NESTED-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">NestedNamespace</div></a>
-// HTML-NESTED-CLASS: </div>
-
-// MD-MUSTACHE-NESTED-CLASS: # class ClassInNestedNamespace
-// MD-MUSTACHE-NESTED-CLASS: Class in NestedNamespace
-
-// HTML-NESTED-CLASS: <h1 class="hero__title-large">class ClassInNestedNamespace</h1>
-
-// MUSTACHE-NESTED-CLASS: <h1 class="hero__title-large">class ClassInNestedNamespace</h1>
-} // namespace NestedNamespace
-
-// MD-NESTED-INDEX: # namespace NestedNamespace
-// MD-NESTED-INDEX: Nested namespace
-// MD-NESTED-INDEX: ## Records
-// MD-NESTED-INDEX: * [ClassInNestedNamespace](ClassInNestedNamespace.md)
-// MD-NESTED-INDEX: ## Functions
-// MD-NESTED-INDEX: ### functionInNestedNamespace
-// MD-NESTED-INDEX: *void functionInNestedNamespace()*
-// MD-NESTED-INDEX: Function in NestedNamespace
-
-// HTML-NESTED-INDEX: <div class="navbar-breadcrumb-container">
-// HTML-NESTED-INDEX: <a href="../../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
-// HTML-NESTED-INDEX: <a href="../index.html"><div class="navbar-breadcrumb-item">PrimaryNamespace</div></a>
-// HTML-NESTED-INDEX: </div>
-// HTML-NESTED-INDEX: <h2>NestedNamespace</h2>
-// HTML-NESTED-INDEX: <h2>Records</h2>
-// HTML-NESTED-INDEX: <ul class="class-container">
-// HTML-NESTED-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-NESTED-INDEX: <a href="_ZTVN16PrimaryNamespace15NestedNamespace22ClassInNestedNamespaceE.html">
-// HTML-NESTED-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInNestedNamespace</code></pre>
-// HTML-NESTED-INDEX: </a>
-// HTML-NESTED-INDEX: </li>
-// HTML-NESTED-INDEX: </ul>
-// HTML-NESTED-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInNestedNamespace ()</code></pre>
-// HTML-NESTED-INDEX: <div class="doc-card">
-// HTML-NESTED-INDEX: <div class="nested-delimiter-container">
-// HTML-NESTED-INDEX: <p>Function in NestedNamespace</p>
-// HTML-NESTED-INDEX: </div>
-// HTML-NESTED-INDEX: </div>
-// HTML-NESTED-INDEX: <p>Defined at line [[@LINE-56]] of file {{.*}}namespace.cpp</p>
-// HTML-NESTED-INDEX: </div>
-
-// MD-MUSTACHE-NESTED-INDEX: # namespace NestedNamespace
-// MD-MUSTACHE-NESTED-INDEX: Nested namespace
-// MD-MUSTACHE-NESTED-INDEX: ## Records
-// MD-MUSTACHE-NESTED-INDEX: * [ClassInNestedNamespace](ClassInNestedNamespace.md)
-// MD-MUSTACHE-NESTED-INDEX: ## Functions
-// MD-MUSTACHE-NESTED-INDEX: ### functionInNestedNamespace
-// MD-MUSTACHE-NESTED-INDEX: *void functionInNestedNamespace()*
-// MD-MUSTACHE-NESTED-INDEX: Function in NestedNamespace
-
-} // namespace PrimaryNamespace
-
-// MD-PRIMARY-INDEX: # namespace PrimaryNamespace
-// MD-PRIMARY-INDEX: Primary Namespace
-// MD-PRIMARY-INDEX: ## Namespaces
-// MD-PRIMARY-INDEX: * [NestedNamespace](NestedNamespace{{[\/]}}index.md)
-// MD-PRIMARY-INDEX: ## Records
-// MD-PRIMARY-INDEX: * [ClassInPrimaryNamespace](ClassInPrimaryNamespace.md)
-// MD-PRIMARY-INDEX: ## Functions
-// MD-PRIMARY-INDEX: ### functionInPrimaryNamespace
-// MD-PRIMARY-INDEX: *void functionInPrimaryNamespace()*
-// MD-PRIMARY-INDEX: Function in PrimaryNamespace
-
-// HTML-PRIMARY-INDEX: <div class="navbar-breadcrumb-container">
-// HTML-PRIMARY-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
-// HTML-PRIMARY-INDEX: </div>
-// HTML-PRIMARY-INDEX: <h2>PrimaryNamespace</h2>
-// HTML-PRIMARY-INDEX-NOT: <h2 id="Namespaces">Namespaces</h2>
-// HTML-PRIMARY-INDEX-NOT: <a href="NestedNamespace{{[\/]}}index.html">NestedNamespace</a>
-// HTML-PRIMARY-INDEX: <h2>Records</h2>
-// HTML-PRIMARY-INDEX: <ul class="class-container">
-// HTML-PRIMARY-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-PRIMARY-INDEX: <a href="_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html">
-// HTML-PRIMARY-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInPrimaryNamespace</code></pre>
-// HTML-PRIMARY-INDEX: </a>
-// HTML-PRIMARY-INDEX: </li>
-// HTML-PRIMARY-INDEX: </ul>
-// HTML-PRIMARY-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInPrimaryNamespace ()</code></pre>
-// HTML-PRIMARY-INDEX: <div class="doc-card">
-// HTML-PRIMARY-INDEX: <div class="nested-delimiter-container">
-// HTML-PRIMARY-INDEX: <p>Function in PrimaryNamespace</p>
-// HTML-PRIMARY-INDEX: </div>
-// HTML-PRIMARY-INDEX: </div>
-// HTML-PRIMARY-INDEX: <p>Defined at line [[@LINE-130]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// HTML-PRIMARY-INDEX: </div>
-// HTML-PRIMARY-INDEX <h2>Inner Classes</h2>
-// HTML-PRIMARY-INDEX <ul class="class-container">
-// HTML-PRIMARY-INDEX <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-PRIMARY-INDEX <a href="_ZTVN16PrimaryNamespace23ClassInPrimaryNamespaceE.html">
-// HTML-PRIMARY-INDEX <pre><code class="language-cpp code-clang-doc">class ClassInPrimaryNamespace</code></pre>
-// HTML-PRIMARY-INDEX </a>
-// HTML-PRIMARY-INDEX </li>
-// HTML-PRIMARY-INDEX </ul>
-
-// MD-MUSTACHE-PRIMARY-INDEX: # namespace PrimaryNamespace
-// MD-MUSTACHE-PRIMARY-INDEX: Primary Namespace
-// MD-MUSTACHE-PRIMARY-INDEX: ## Namespaces
-// MD-MUSTACHE-PRIMARY-INDEX: * [NestedNamespace](NestedNamespace{{[\/]}}index.md)
-// MD-MUSTACHE-PRIMARY-INDEX: ## Records
-// MD-MUSTACHE-PRIMARY-INDEX: * [ClassInPrimaryNamespace](ClassInPrimaryNamespace.md)
-// MD-MUSTACHE-PRIMARY-INDEX: ## Functions
-// MD-MUSTACHE-PRIMARY-INDEX: ### functionInPrimaryNamespace
-// MD-MUSTACHE-PRIMARY-INDEX: *void functionInPrimaryNamespace()*
-// MD-MUSTACHE-PRIMARY-INDEX: Function in PrimaryNamespace
-
-// AnotherNamespace
-namespace AnotherNamespace {
-// Function in AnotherNamespace
-void functionInAnotherNamespace() {}
-// MD-ANOTHER-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-ANOTHER-INDEX-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-ANOTHER-INDEX-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// Class in AnotherNamespace
-class ClassInAnotherNamespace {};
-// MD-ANOTHER-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
-// HTML-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MD-MUSTACHE-ANOTHER-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-3]]*
-
-// MD-ANOTHER-CLASS: # class ClassInAnotherNamespace
-// MD-ANOTHER-CLASS: Class in AnotherNamespace
-
-// HTML-ANOTHER-CLASS: <div class="navbar-breadcrumb-container">
-// HTML-ANOTHER-CLASS: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>::
-// HTML-ANOTHER-CLASS: <a href="./index.html"><div class="navbar-breadcrumb-item">AnotherNamespace</div></a>
-// HTML-ANOTHER-CLASS: </div>
-
-// MD-MUSTACHE-ANOTHER-CLASS: # class ClassInAnotherNamespace
-// MD-MUSTACHE-ANOTHER-CLASS: Class in AnotherNamespace
-
-// HTML-ANOTHER-CLASS: <h1 class="hero__title-large">class ClassInAnotherNamespace</h1>
-
-// MUSTACHE-ANOTHER-CLASS: <h1 class="hero__title-large">class ClassInAnotherNamespace</h1>
-
-} // namespace AnotherNamespace
-
-// MD-ANOTHER-INDEX: # namespace AnotherNamespace
-// MD-ANOTHER-INDEX: AnotherNamespace
-// MD-ANOTHER-INDEX: ## Records
-// MD-ANOTHER-INDEX: * [ClassInAnotherNamespace](ClassInAnotherNamespace.md)
-// MD-ANOTHER-INDEX: ## Functions
-// MD-ANOTHER-INDEX: ### functionInAnotherNamespace
-// MD-ANOTHER-INDEX: *void functionInAnotherNamespace()*
-// MD-ANOTHER-INDEX: Function in AnotherNamespace
-
-// HTML-ANOTHER-INDEX: <div class="navbar-breadcrumb-container">
-// HTML-ANOTHER-INDEX: <a href="../GlobalNamespace/index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
-// HTML-ANOTHER-INDEX: </div>
-// HTML-ANOTHER-INDEX: <h2>AnotherNamespace</h2>
-// HTML-ANOTHER-INDEX: <h2>Records</h2>
-// HTML-ANOTHER-INDEX: <ul class="class-container">
-// HTML-ANOTHER-INDEX: <li id="{{([0-9A-F]{40})}}" style="max-height: 40px;">
-// HTML-ANOTHER-INDEX: <a href="_ZTVN16AnotherNamespace23ClassInAnotherNamespaceE.html">
-// HTML-ANOTHER-INDEX: <pre><code class="language-cpp code-clang-doc">class ClassInAnotherNamespace</code></pre>
-// HTML-ANOTHER-INDEX: </a>
-// HTML-ANOTHER-INDEX: </li>
-// HTML-ANOTHER-INDEX: </ul>
-// HTML-ANOTHER-INDEX: <pre><code class="language-cpp code-clang-doc">void functionInAnotherNamespace ()</code></pre>
-// HTML-ANOTHER-INDEX: <div class="doc-card">
-// HTML-ANOTHER-INDEX: <div class="nested-delimiter-container">
-// HTML-ANOTHER-INDEX: <p>Function in AnotherNamespace</p>
-// HTML-ANOTHER-INDEX: </div>
-// HTML-ANOTHER-INDEX: </div>
-// HTML-ANOTHER-INDEX: <p>Defined at line [[@LINE-55]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// HTML-ANOTHER-INDEX: </div>
-// HTML-ANOTHER-INDEX: </div>
-
-// MD-MUSTACHE-ANOTHER-INDEX: # namespace AnotherNamespace
-// MD-MUSTACHE-ANOTHER-INDEX: AnotherNamespace
-// MD-MUSTACHE-ANOTHER-INDEX: ## Records
-// MD-MUSTACHE-ANOTHER-INDEX: * [ClassInAnotherNamespace](ClassInAnotherNamespace.md)
-// MD-MUSTACHE-ANOTHER-INDEX: ## Functions
-// MD-MUSTACHE-ANOTHER-INDEX: ### functionInAnotherNamespace
-// MD-MUSTACHE-ANOTHER-INDEX: *void functionInAnotherNamespace()*
-// MD-MUSTACHE-ANOTHER-INDEX: Function in AnotherNamespace
-
-// COM: FIXME: Add namespaces to namespace template
-// HTML-GLOBAL-INDEX-NOT: <div id="main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
-// HTML-GLOBAL-INDEX-NOT: <h1>Global Namespace</h1>
-// HTML-GLOBAL-INDEX-NOT: <h2 id="Namespaces">Namespaces</h2>
-// HTML-GLOBAL-INDEX-NOT: <li>@nonymous_namespace</li>
-// HTML-GLOBAL-INDEX-NOT: <li>AnotherNamespace</li>
-// HTML-GLOBAL-INDEX-NOT: <li>PrimaryNamespace</li>
-
-// MD-GLOBAL-INDEX: # Global Namespace
-// MD-GLOBAL-INDEX: ## Namespaces
-// MD-GLOBAL-INDEX: * [@nonymous_namespace](..{{[\/]}}@nonymous_namespace{{[\/]}}index.md)
-// MD-GLOBAL-INDEX: * [AnotherNamespace](..{{[\/]}}AnotherNamespace{{[\/]}}index.md)
-// MD-GLOBAL-INDEX: * [PrimaryNamespace](..{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
-
-// MD-MUSTACHE-GLOBAL-INDEX: # Global Namespace
-// MD-MUSTACHE-GLOBAL-INDEX: ## Namespaces
-// MD-MUSTACHE-GLOBAL-INDEX: * [@nonymous_namespace]({{.*}}{{[\/]}}@nonymous_namespace{{[\/]}}index.md)
-// MD-MUSTACHE-GLOBAL-INDEX: * [AnotherNamespace]({{.*}}{{[\/]}}AnotherNamespace{{[\/]}}index.md)
-// MD-MUSTACHE-GLOBAL-INDEX: * [PrimaryNamespace]({{.*}}{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
-
-// MD-ALL-FILES: # All Files
-// MD-ALL-FILES: ## [@nonymous_namespace](@nonymous_namespace{{[\/]}}index.md)
-// MD-ALL-FILES: ## [AnotherNamespace](AnotherNamespace{{[\/]}}index.md)
-// MD-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)
-// MD-ALL-FILES: ## [PrimaryNamespace](PrimaryNamespace{{[\/]}}index.md)
-
-// MD-MUSTACHE-ALL-FILES: # All Files
-// MD-MUSTACHE-ALL-FILES: ## [@nonymous_namespace](@nonymous_namespace{{[\/]}}index.md)
-// MD-MUSTACHE-ALL-FILES: ## [AnotherNamespace](AnotherNamespace{{[\/]}}index.md)
-// MD-MUSTACHE-ALL-FILES: ## [GlobalNamespace](GlobalNamespace{{[\/]}}index.md)
-// MD-MUSTACHE-ALL-FILES: ## [PrimaryNamespace](PrimaryNamespace{{[\/]}}index.md)
-
-// MD-INDEX: # C/C++ Reference
-// MD-INDEX: * Namespace: [@nonymous_namespace](@nonymous_namespace)
-// MD-INDEX: * Namespace: [AnotherNamespace](AnotherNamespace)
-// MD-INDEX: * Namespace: [PrimaryNamespace](PrimaryNamespace)
-
-// MD-MUSTACHE-INDEX: # C/C++ Reference
-// MD-MUSTACHE-INDEX: * Namespace: [@nonymous_namespace](@nonymous_namespace)
-// MD-MUSTACHE-INDEX: * Namespace: [AnotherNamespace](AnotherNamespace)
-// MD-MUSTACHE-INDEX: * Namespace: [PrimaryNamespace](PrimaryNamespace)
diff --git a/clang-tools-extra/test/clang-doc/single-file-public.cpp b/clang-tools-extra/test/clang-doc/single-file-public.cpp
deleted file mode 100644
index a2a76b60c02db..0000000000000
--- a/clang-tools-extra/test/clang-doc/single-file-public.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// RUN: rm -rf %t && mkdir -p %t
-// RUN: echo "" > %t/compile_flags.txt
-// RUN: cp "%s" "%t/test.cpp"
-// RUN: clang-doc --doxygen --public --executor=standalone -p %t %t/test.cpp -output=%t/docs
-// This produces two files, index.yaml and one for the record named by its USR
-// (which we don't know in advance). This checks the record file by searching
-// for a name with a 40-char USR name.
-// RUN: find %t/docs -regex ".*/[0-9A-F]*.yaml" -exec cat {} ";" | FileCheck %s --check-prefix=CHECK
-
-class Record {
-private:
- void function_private();
-
-public:
- void function_public();
-};
-
-void Record::function_private() {}
-
-void Record::function_public() {}
-
-// CHECK: ---
-// CHECK-NEXT: USR: '{{([0-9A-F]{40})}}'
-// CHECK-NEXT: Name: 'Record'
-// CHECK-NEXT: Path: 'GlobalNamespace'
-// CHECK-NEXT: Namespace:
-// CHECK-NEXT: - Type: Namespace
-// CHECK-NEXT: Name: 'GlobalNamespace'
-// CHECK-NEXT: QualName: 'GlobalNamespace'
-// CHECK-NEXT: DefLocation:
-// CHECK-NEXT: LineNumber: 10
-// CHECK-NEXT: Filename: '{{.*}}'
-// CHECK-NEXT: TagType: Class
-// CHECK-NEXT: ChildFunctions:
-// CHECK-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// CHECK-NEXT: Name: 'function_public'
-// CHECK-NEXT: Namespace:
-// CHECK-NEXT: - Type: Record
-// CHECK-NEXT: Name: 'Record'
-// CHECK-NEXT: QualName: 'Record'
-// CHECK-NEXT: USR: '{{([0-9A-F]{40})}}'
-// CHECK-NEXT: - Type: Namespace
-// CHECK-NEXT: Name: 'GlobalNamespace'
-// CHECK-NEXT: QualName: 'GlobalNamespace'
-// CHECK-NEXT: DefLocation:
-// CHECK-NEXT: LineNumber: 20
-// CHECK-NEXT: Filename: '{{.*}}'
-// CHECK-NEXT: Location:
-// CHECK-NEXT: - LineNumber: 15
-// CHECK-NEXT: Filename: '{{.*}}'
-// CHECK-NEXT: IsMethod: true
-// CHECK-NEXT: Parent:
-// CHECK-NEXT: Type: Record
-// CHECK-NEXT: Name: 'Record'
-// CHECK-NEXT: QualName: 'Record'
-// CHECK-NEXT: USR: '{{([0-9A-F]{40})}}'
-// CHECK-NEXT: ReturnType:
-// CHECK-NEXT: Type:
-// CHECK-NEXT: Name: 'void'
-// CHECK-NEXT: QualName: 'void'
-// CHECK-NEXT: Access: Public
-// CHECK-NEXT: ...
diff --git a/clang-tools-extra/test/clang-doc/templates.cpp b/clang-tools-extra/test/clang-doc/templates.cpp
deleted file mode 100644
index 072a69bf3dd2c..0000000000000
--- a/clang-tools-extra/test/clang-doc/templates.cpp
+++ /dev/null
@@ -1,491 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir %t
-
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/docs
-// RUN: cat %t/docs/index.yaml | FileCheck %s --check-prefix=YAML
-
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/docs --format=md
-// RUN: cat %t/docs/GlobalNamespace/index.md | FileCheck %s --check-prefix=MD
-
-// RUN: clang-doc --pretty-json --doxygen --executor=standalone %s -output=%t/docs --format=html
-// RUN: cat %t/docs/json/GlobalNamespace/index.json | FileCheck %s --check-prefix=JSON
-// RUN: cat %t/docs/html/GlobalNamespace/_ZTV5tuple.html | FileCheck %s --check-prefix=HTML-STRUCT
-// RUN: cat %t/docs/html/GlobalNamespace/index.html | FileCheck %s --check-prefix=HTML
-
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/docs --format=md_mustache
-// RUN: cat %t/docs/md/GlobalNamespace/index.md | FileCheck %s --check-prefix=MD-MUSTACHE
-
-// YAML: ---
-// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: ChildRecords:
-// YAML-NEXT: - Type: Record
-// YAML-NEXT: Name: 'tuple'
-// YAML-NEXT: QualName: 'tuple'
-// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Path: 'GlobalNamespace'
-
-// MD: # Global Namespace
-// MD: ## Functions
-
-// MD-MUSTACHE: # Global Namespace
-// MD-MUSTACHE: ## Functions
-
-template <class... T>
-void ParamPackFunction(T... args);
-
-// YAML-NEXT: ChildFunctions:
-// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Name: 'ParamPackFunction'
-// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE - 6]]
-// YAML-NEXT: Filename: '{{.*}}'
-// YAML-NEXT: Params:
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'T...'
-// YAML-NEXT: QualName: 'T...'
-// YAML-NEXT: Name: 'args'
-// YAML-NEXT: ReturnType:
-// YAML-NEXT: Type:
-// YAML-NEXT: Name: 'void'
-// YAML-NEXT: QualName: 'void'
-// YAML-NEXT: Template:
-// YAML-NEXT: Params:
-// YAML-NEXT: - Contents: 'class... T'
-
-// MD: ### ParamPackFunction
-// MD: *void ParamPackFunction(T... args)*
-
-// JSON: "Name": "ParamPackFunction",
-// JSON-NEXT: "Params": [
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "args",
-// JSON-NEXT: "ParamEnd": true,
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "T...",
-// JSON-NEXT: "QualName": "T...",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "ReturnType": {
-// JSON-NEXT: "IsBuiltIn": true,
-// JSON-NEXT: "IsTemplate": false,
-// JSON-NEXT: "Name": "void",
-// JSON-NEXT: "QualName": "void",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: },
-// JSON-NEXT: "Template": {
-// JSON-NEXT: "Parameters": [
-// JSON-NEXT: {
-// JSON-NEXT: "End": true,
-// JSON-NEXT: "Param": "class... T"
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "VerticalDisplay": false
-// JSON-NEXT: },
-
-// HTML: <pre><code class="language-cpp code-clang-doc">template <class... T</code><code class="language-cpp code-clang-doc">></code></pre>
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void ParamPackFunction (T... args)</code></pre>
-
-// MD-MUSTACHE: ### ParamPackFunction
-// MD-MUSTACHE: *void ParamPackFunction(T... args)*
-
-template <typename T, int U = 1>
-void function(T x) {}
-
-// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Name: 'function'
-// YAML-NEXT: DefLocation:
-// YAML-NEXT: LineNumber: [[# @LINE - 5]]
-// YAML-NEXT: Filename: '{{.*}}'
-// YAML-NEXT: Params:
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'T'
-// YAML-NEXT: QualName: 'T'
-// YAML-NEXT: Name: 'x'
-// YAML-NEXT: ReturnType:
-// YAML-NEXT: Type:
-// YAML-NEXT: Name: 'void'
-// YAML-NEXT: QualName: 'void'
-// YAML-NEXT: Template:
-// YAML-NEXT: Params:
-// YAML-NEXT: - Contents: 'typename T'
-// YAML-NEXT: - Contents: 'int U = 1'
-
-// MD: ### function
-// MD: *void function(T x)*
-// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 23]]*
-
-// JSON: "Name": "function",
-// JSON-NEXT: "Params": [
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "x",
-// JSON-NEXT: "ParamEnd": true,
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "T",
-// JSON-NEXT: "QualName": "T",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "ReturnType": {
-// JSON-NEXT: "IsBuiltIn": true,
-// JSON-NEXT: "IsTemplate": false,
-// JSON-NEXT: "Name": "void",
-// JSON-NEXT: "QualName": "void",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: },
-// JSON-NEXT: "Template": {
-// JSON-NEXT: "Parameters": [
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "typename T"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "End": true,
-// JSON-NEXT: "Param": "int U = 1"
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "VerticalDisplay": false
-// JSON-NEXT: }
-
-// HTML: <pre><code class="language-cpp code-clang-doc">template <typename T, int U = 1</code><code class="language-cpp code-clang-doc">></code></pre>
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void function (T x)</code></pre>
-// HTML-NEXT: <p>Defined at line [[# @LINE - 59]] of file {{.*}}templates.cpp</p>
-// HTML-NEXT: </div>
-
-// MD-MUSTACHE: ### function
-// MD-MUSTACHE: *void function(T x)*
-// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#[[# @LINE - 64]]*
-
-template <typename A, typename B, typename C, typename D, typename E>
-void longFunction(A a, B b, C c, D d, E e) {}
-
-// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Name: 'longFunction'
-// YAML-NEXT: DefLocation:
-// YAML-NEXT: LineNumber: [[# @LINE - 5]]
-// YAML-NEXT: Filename: '{{.*}}'
-// YAML-NEXT: Params:
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'A'
-// YAML-NEXT: QualName: 'A'
-// YAML-NEXT: Name: 'a'
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'B'
-// YAML-NEXT: QualName: 'B'
-// YAML-NEXT: Name: 'b'
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'C'
-// YAML-NEXT: QualName: 'C'
-// YAML-NEXT: Name: 'c'
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'D'
-// YAML-NEXT: QualName: 'D'
-// YAML-NEXT: Name: 'd'
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'E'
-// YAML-NEXT: QualName: 'E'
-// YAML-NEXT: Name: 'e'
-// YAML-NEXT: ReturnType:
-// YAML-NEXT: Type:
-// YAML-NEXT: Name: 'void'
-// YAML-NEXT: QualName: 'void'
-// YAML-NEXT: Template:
-// YAML-NEXT: Params:
-// YAML-NEXT: - Contents: 'typename A'
-// YAML-NEXT: - Contents: 'typename B'
-// YAML-NEXT: - Contents: 'typename C'
-// YAML-NEXT: - Contents: 'typename D'
-// YAML-NEXT: - Contents: 'typename E'
-
-// MD: ### longFunction
-// MD: *void longFunction(A a, B b, C c, D d, E e)*
-// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 42]]*
-
-// JSON: "Name": "longFunction",
-// JSON-NEXT: "Params": [
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "a",
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "A",
-// JSON-NEXT: "QualName": "A",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "b",
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "B",
-// JSON-NEXT: "QualName": "B",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "c",
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "C",
-// JSON-NEXT: "QualName": "C",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "d",
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "D",
-// JSON-NEXT: "QualName": "D",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "e",
-// JSON-NEXT: "ParamEnd": true,
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "E",
-// JSON-NEXT: "QualName": "E",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "ReturnType": {
-// JSON-NEXT: "IsBuiltIn": true,
-// JSON-NEXT: "IsTemplate": false,
-// JSON-NEXT: "Name": "void",
-// JSON-NEXT: "QualName": "void",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: },
-// JSON-NEXT: "Template": {
-// JSON-NEXT: "Parameters": [
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "typename A"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "typename B"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "typename C"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "typename D"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "End": true,
-// JSON-NEXT: "Param": "typename E"
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "VerticalDisplay": true
-// JSON-NEXT: },
-// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}",
-// JSON-NEXT: "VerticalDisplay": true
-// JSON-NEXT: }
-
-// HTML: <pre>
-// HTML-SAME: <code class="language-cpp code-clang-doc">template <</code>
-// HTML-SAME: <span class="param-container">
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename A, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename B, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename C, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename D, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">typename E</code></span>
-// HTML-SAME: </span>
-// HTML-SAME: <code class="language-cpp code-clang-doc">></code>
-// HTML-SAME: </pre>
-// HTML-NEXT: <pre>
-// HTML-SAME: <code class="language-cpp code-clang-doc">void longFunction (</code>
-// HTML-SAME: <span class="param-container">
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">A</code> <code class="language-cpp code-clang-doc">a, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">B</code> <code class="language-cpp code-clang-doc">b, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">C</code> <code class="language-cpp code-clang-doc">c, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">D</code> <code class="language-cpp code-clang-doc">d, </code></span>
-// HTML-SAME: <span class="param"><code class="language-cpp code-clang-doc">E</code> <code class="language-cpp code-clang-doc">e</code></span>
-// HTML-SAME: </span>
-// HTML-SAME: <code class="language-cpp code-clang-doc">)</code>
-// HTML-SAME: </pre>
-// HTML-NEXT: <p>Defined at line [[# @LINE - 142]] of file {{.*}}templates.cpp</p>
-// HTML-NEXT: </div>
-
-template <>
-void function<bool, 0>(bool x) {}
-
-// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Name: 'function'
-// YAML-NEXT: DefLocation:
-// YAML-NEXT: LineNumber: [[# @LINE - 6]]
-// YAML-NEXT: Filename: '{{.*}}'
-// YAML-NEXT: Params:
-// YAML-NEXT: - Type:
-// YAML-NEXT: Name: 'bool'
-// YAML-NEXT: QualName: 'bool'
-// YAML-NEXT: Name: 'x'
-// YAML-NEXT: ReturnType:
-// YAML-NEXT: Type:
-// YAML-NEXT: Name: 'void'
-// YAML-NEXT: QualName: 'void'
-// YAML-NEXT: Template:
-// YAML-NEXT: Specialization:
-// YAML-NEXT: SpecializationOf: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Params:
-// YAML-NEXT: - Contents: 'bool'
-// YAML-NEXT: - Contents: '0'
-
-// MD: ### function
-// MD: *void function(bool x)*
-// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 26]]*
-
-// JSON: "Name": "function",
-// JSON-NEXT: "Params": [
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "x",
-// JSON-NEXT: "ParamEnd": true,
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "bool",
-// JSON-NEXT: "QualName": "bool",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: }
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "ReturnType": {
-// JSON-NEXT: "IsBuiltIn": true,
-// JSON-NEXT: "IsTemplate": false,
-// JSON-NEXT: "Name": "void",
-// JSON-NEXT: "QualName": "void",
-// JSON-NEXT: "USR": "0000000000000000000000000000000000000000"
-// JSON-NEXT: },
-// JSON-NEXT: "Template": {
-// JSON-NEXT: "Specialization": {
-// JSON-NEXT: "Parameters": [
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "bool"
-// JSON-NEXT: },
-// JSON-NEXT: {
-// JSON-NEXT: "Param": "0",
-// JSON-NEXT: "SpecParamEnd": true
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "SpecializationOf": "{{([0-9A-F]{40})}}",
-// JSON-NEXT: "VerticalDisplay": false
-// JSON-NEXT: }
-// JSON-NEXT: },
-
-// HTML: <pre><code class="language-cpp code-clang-doc">template <</code><code class="language-cpp code-clang-doc">></code></pre>
-// HTML-NEXT: <pre><code class="language-cpp code-clang-doc">void function<bool, 0> (bool x)</code></pre>
-// HTML-NEXT: <p>Defined at line [[# @LINE - 65]] of file {{.*}}templates.cpp</p>
-// HTML-NEXT: </div>
-
-// MD-MUSTACHE: ### function
-// MD-MUSTACHE: *void function(bool x)*
-// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#[[# @LINE - 70]]*
-
-/// A Tuple type
-///
-/// Does Tuple things.
-template <typename... Tys>
-struct tuple {};
-
-// HTML-STRUCT: <section class="hero section-container">
-// HTML-STRUCT-NEXT: <pre><code class="language-cpp code-clang-doc">template <typename... Tys></code></pre>
-// HTML-STRUCT-NEXT: <div class="hero__title">
-// HTML-STRUCT-NEXT: <h1 class="hero__title-large">struct tuple</h1>
-// HTML-STRUCT-NEXT: <p>Defined at line [[# @LINE - 6]] of file {{.*}}templates.cpp</p>
-// HTML-STRUCT-NEXT: <div class="doc-card">
-// HTML-STRUCT-NEXT: <div class="nested-delimiter-container">
-// HTML-STRUCT-NEXT: <p>A Tuple type</p>
-// HTML-STRUCT-NEXT: </div>
-// HTML-STRUCT-NEXT: <div class="nested-delimiter-container">
-// HTML-STRUCT-NEXT: <p>Does Tuple things.</p>
-// HTML-STRUCT-NEXT: </div>
-// HTML-STRUCT-NEXT: </div>
-// HTML-STRUCT-NEXT: </div>
-// HTML-STRUCT-NEXT: </section>
-
-/// A function with a tuple parameter
-///
-/// \param t The input to func_with_tuple_param
-tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t) { return t; }
-
-// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Name: 'func_with_tuple_param'
-// YAML-NEXT: Description:
-// YAML-NEXT: - Kind: FullComment
-// YAML-NEXT: Children:
-// YAML-NEXT: - Kind: ParagraphComment
-// YAML-NEXT: Children:
-// YAML-NEXT: - Kind: TextComment
-// YAML-NEXT: Text: 'A function with a tuple parameter'
-// YAML-NEXT: - Kind: ParagraphComment
-// YAML-NEXT: Children:
-// YAML-NEXT: - Kind: TextComment
-// YAML-NEXT: - Kind: ParamCommandComment
-// YAML-NEXT: Direction: '[in]'
-// YAML-NEXT: ParamName: 't'
-// YAML-NEXT: Children:
-// YAML-NEXT: - Kind: ParagraphComment
-// YAML-NEXT: Children:
-// YAML-NEXT: - Kind: TextComment
-// YAML-NEXT: Text: 'The input to func_with_tuple_param'
-// YAML-NEXT: DefLocation:
-// YAML-NEXT: LineNumber: [[# @LINE - 23]]
-// YAML-NEXT: Filename:
-// YAML-NEXT: Params:
-// YAML-NEXT: - Type:
-// YAML-NEXT: Type: Record
-// YAML-NEXT: Name: 'tuple'
-// YAML-NEXT: QualName: 'tuple<int, int, bool>'
-// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Path: 'GlobalNamespace'
-// YAML-NEXT: Name: 't'
-// YAML-NEXT: ReturnType:
-// YAML-NEXT: Type:
-// YAML-NEXT: Type: Record
-// YAML-NEXT: Name: 'tuple'
-// YAML-NEXT: QualName: 'tuple<int, int, bool>'
-// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
-// YAML-NEXT: Path: 'GlobalNamespace'
-// YAML-NEXT: ...
-
-// MD: ### func_with_tuple_param
-// MD: *tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t)*
-// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]*
-// MD: A function with a tuple parameter
-// MD: **t** The input to func_with_tuple_param
-
-// JSON: "Name": "func_with_tuple_param",
-// JSON-NEXT: "Params": [
-// JSON-NEXT: {
-// JSON-NEXT: "Name": "t",
-// JSON-NEXT: "ParamEnd": true,
-// JSON-NEXT: "Type": {
-// JSON-NEXT: "Name": "tuple",
-// JSON-NEXT: "Path": "GlobalNamespace",
-// JSON-NEXT: "QualName": "tuple<int, int, bool>",
-// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-NEXT: }
-// JSON-NEXT: }
-// JSON-NEXT: ],
-// JSON-NEXT: "ReturnType": {
-// JSON-NEXT: "IsBuiltIn": false,
-// JSON-NEXT: "IsTemplate": false,
-// JSON-NEXT: "Name": "tuple",
-// JSON-NEXT: "QualName": "tuple<int, int, bool>",
-// JSON-NEXT: "USR": "{{([0-9A-F]{40})}}"
-// JSON-NEXT: },
-
-// HTML: <pre><code class="language-cpp code-clang-doc">tuple<int, int, bool> func_with_tuple_param (tuple<int, int, bool> t)</code></pre>
-// HTML-NEXT: <div class="doc-card">
-// HTML-NEXT: <div class="nested-delimiter-container">
-// HTML-NEXT: <p>A function with a tuple parameter</p>
-// HTML-NEXT: </div>
-// HTML-NEXT: <div class="nested-delimiter-container">
-// HTML-NEXT: <h3>Parameters</h3>
-// HTML-NEXT: <div>
-// HTML-NEXT: <b>t</b> The input to func_with_tuple_param
-// HTML-NEXT: </div>
-// HTML-NEXT: </div>
-// HTML-NEXT: </div>
-// HTML-NEXT: <p>Defined at line [[# @LINE - 81]] of file {{.*}}templates.cpp</p>
-// HTML-NEXT: </div>
-
-// MD-MUSTACHE: ### func_with_tuple_param
-// MD-MUSTACHE: *tuple<int, int, bool> func_with_tuple_param(tuple<int, int, bool> t)*
-// MD-MUSTACHE: *Defined at {{.*}}templates.cpp#[[# @LINE - 86]]*
-// MD-MUSTACHE: A function with a tuple parameter
-// MD-MUSTACHE: **t** The input to func_with_tuple_param
diff --git a/clang-tools-extra/test/clang-doc/builtin_types.cpp b/clang-tools-extra/test/clang-doc/yaml/builtin_types.cpp
similarity index 63%
rename from clang-tools-extra/test/clang-doc/builtin_types.cpp
rename to clang-tools-extra/test/clang-doc/yaml/builtin_types.cpp
index 3f416261ff7ea..7a0defb165194 100644
--- a/clang-tools-extra/test/clang-doc/builtin_types.cpp
+++ b/clang-tools-extra/test/clang-doc/yaml/builtin_types.cpp
@@ -1,166 +1,89 @@
// RUN: rm -rf %t
// RUN: mkdir -p %t/yaml %t/md %t/md_mustache
-
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/yaml
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/builtin_types.cpp -output=%t/yaml
// RUN: FileCheck %s < %t/yaml/index.yaml --check-prefix=YAML
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/md --format=md
-// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md --check-prefix=MD
-
-// RUN: clang-doc --doxygen --executor=standalone %s -output=%t/md_mustache --format=md_mustache
-// RUN: FileCheck %s < %t/md/GlobalNamespace/index.md --check-prefix=MD-MUSTACHE
-
// YAML: ---
// YAML-NEXT: USR: '0000000000000000000000000000000000000000'
// YAML-NEXT: ChildFunctions:
-// MD: # Global Namespace
-// MD: ## Functions
-
-// MD-MUSTACHE: # Global Namespace
-// MD-MUSTACHE: ## Functions
-
-extern bool b();
-
// YAML-NEXT: - USR: '88A104C263241E354ECF5B55B04AE8CEAD625B71'
// YAML-NEXT: Name: 'b'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 1
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'bool'
// YAML-NEXT: QualName: 'bool'
-// MD: ### b
-// MD: *bool b()*
-
-// MD-MUSTACHE: ### b
-// MD-MUSTACHE: *bool b()*
-
-char c();
-
// YAML-NEXT: - USR: 'EA3287837B3F175C8DB154406B4DAD2924F479B5'
// YAML-NEXT: Name: 'c'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 2
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'char'
// YAML-NEXT: QualName: 'char'
-// MD: ### c
-// MD: *char c()*
-
-// MD-MUSTACHE: ### c
-// MD-MUSTACHE: *char c()*
-
-double d();
-
// YAML-NEXT: - USR: '60A47E4696CEFC411AB2E1EEFA2DD914E2A7E450'
// YAML-NEXT: Name: 'd'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 3
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'double'
// YAML-NEXT: QualName: 'double'
-// MD: ### d
-// MD: *double d()*
-
-// MD-MUSTACHE: ### d
-// MD-MUSTACHE: *double d()*
-
-float f();
-
// YAML-NEXT: - USR: 'B3A9EC6BECD5869CF3ACDFB25153CFE6BBDD5EAB'
// YAML-NEXT: Name: 'f'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 4
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'float'
// YAML-NEXT: QualName: 'float'
-// MD: ### f
-// MD: *float f()*
-
-// MD-MUSTACHE: ### f
-// MD-MUSTACHE: *float f()*
-
-int i();
-
// YAML-NEXT: - USR: '307041280A81EB46F949A94AD52587C659FD801C'
// YAML-NEXT: Name: 'i'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 5
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'int'
// YAML-NEXT: QualName: 'int'
-// MD: ### i
-// MD: *int i()*
-
-// MD-MUSTACHE: ### i
-// MD-MUSTACHE: *int i()*
-
-long l();
-
// YAML-NEXT: - USR: 'A1CE9AB0064C412F857592E01332C641C1A06F37'
// YAML-NEXT: Name: 'l'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 6
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'long'
// YAML-NEXT: QualName: 'long'
-// MD: ### l
-// MD: *long l()*
-
-// MD-MUSTACHE: ### l
-// MD-MUSTACHE: *long l()*
-
-long long ll();
-
// YAML-NEXT: - USR: '5C2C44ED4825C066EF6ED796863586F343C8BCA9'
// YAML-NEXT: Name: 'll'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 7
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'long long'
// YAML-NEXT: QualName: 'long long'
-// MD: ### ll
-// MD: *long long ll()*
-
-// MD-MUSTACHE: ### ll
-// MD-MUSTACHE: *long long ll()*
-
-short s();
-
// YAML-NEXT: - USR: '412341570FD3AD2C3A1E9A1DE7B3C01C07BEACFE'
// YAML-NEXT: Name: 's'
// YAML-NEXT: Location:
-// YAML-NEXT: - LineNumber: [[# @LINE-5]]
+// YAML-NEXT: - LineNumber: 8
// YAML-NEXT: Filename: '{{.*}}'
// YAML-NEXT: ReturnType:
// YAML-NEXT: Type:
// YAML-NEXT: Name: 'short'
// YAML-NEXT: QualName: 'short'
// YAML-NEXT: ...
-
-// MD: ### s
-// MD: *short s()*
-
-// MD-MUSTACHE: ### s
-// MD-MUSTACHE: *short s()*
diff --git a/clang-tools-extra/test/clang-doc/yaml/conversion_function.cpp b/clang-tools-extra/test/clang-doc/yaml/conversion_function.cpp
new file mode 100644
index 0000000000000..f46c6788e6b47
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/yaml/conversion_function.cpp
@@ -0,0 +1,7 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --output=%t --executor=standalone %S/../Inputs/conversion_function.cpp
+// RUN: find %t/ -regex ".*/[0-9A-F]*.yaml" -exec cat {} ";" | FileCheck %s --check-prefix=CHECK-YAML
+
+// Output correct conversion names.
+// CHECK-YAML: Name: 'operator T'
+
diff --git a/clang-tools-extra/test/clang-doc/yaml/single-file-public.cpp b/clang-tools-extra/test/clang-doc/yaml/single-file-public.cpp
new file mode 100644
index 0000000000000..db87444d70e38
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/yaml/single-file-public.cpp
@@ -0,0 +1,6 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: echo "" > %t/compile_flags.txt
+// RUN: cp "%S/../Inputs/single-file-public.cpp" "%t/test.cpp"
+// RUN: clang-doc --doxygen --public --executor=standalone -p %t %t/test.cpp -output=%t/docs
+// This produces two files, index.yaml and one for the record named by its USR
+
diff --git a/clang-tools-extra/test/clang-doc/single-file.cpp b/clang-tools-extra/test/clang-doc/yaml/single-file.cpp
similarity index 85%
rename from clang-tools-extra/test/clang-doc/single-file.cpp
rename to clang-tools-extra/test/clang-doc/yaml/single-file.cpp
index bea434eb2ed9a..2b7650ca2ffa1 100644
--- a/clang-tools-extra/test/clang-doc/single-file.cpp
+++ b/clang-tools-extra/test/clang-doc/yaml/single-file.cpp
@@ -1,23 +1,19 @@
// RUN: rm -rf %t && mkdir -p %t
// RUN: echo "" > %t/compile_flags.txt
-// RUN: cp "%s" "%t/test.cpp"
+// RUN: cp "%S/../Inputs/single-file.cpp" "%t/test.cpp"
// RUN: clang-doc --doxygen --executor=standalone -p %t %t/test.cpp -output=%t/docs
// RUN: FileCheck %s -input-file=%t/docs/index.yaml --check-prefix=CHECK
-void function(int x);
-
-void function(int x) {}
-
// CHECK: ---
// CHECK-NEXT: USR: '{{([0-9A-F]{40})}}'
// CHECK-NEXT: ChildFunctions:
// CHECK-NEXT: - USR: '{{([0-9A-F]{40})}}'
// CHECK-NEXT: Name: 'function'
// CHECK-NEXT: DefLocation:
-// CHECK-NEXT: LineNumber: 9
+// CHECK-NEXT: LineNumber: 3
// CHECK-NEXT: Filename: '{{.*}}
// CHECK-NEXT: Location:
-// CHECK-NEXT: - LineNumber: 7
+// CHECK-NEXT: - LineNumber: 1
// CHECK-NEXT: Filename: '{{.*}}'
// CHECK-NEXT: Params:
// CHECK-NEXT: - Type:
diff --git a/clang-tools-extra/test/clang-doc/yaml/templates.cpp b/clang-tools-extra/test/clang-doc/yaml/templates.cpp
new file mode 100644
index 0000000000000..21b7085ef39dd
--- /dev/null
+++ b/clang-tools-extra/test/clang-doc/yaml/templates.cpp
@@ -0,0 +1,148 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --doxygen --executor=standalone %S/../Inputs/templates.cpp -output=%t/docs
+// RUN: cat %t/docs/index.yaml | FileCheck %s --check-prefix=YAML
+
+// YAML: ---
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: ChildRecords:
+// YAML-NEXT: - Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
+// YAML-NEXT: ChildFunctions:
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'ParamPackFunction'
+// YAML-NEXT: Location:
+// YAML-NEXT: - LineNumber: 1
+// YAML-NEXT: Filename: '{{.*}}'
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'T...'
+// YAML-NEXT: QualName: 'T...'
+// YAML-NEXT: Name: 'args'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Name: 'void'
+// YAML-NEXT: QualName: 'void'
+// YAML-NEXT: Template:
+// YAML-NEXT: Params:
+// YAML-NEXT: - Contents: 'class... T'
+
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'function'
+// YAML-NEXT: DefLocation:
+// YAML-NEXT: LineNumber: 3
+// YAML-NEXT: Filename: '{{.*}}'
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'T'
+// YAML-NEXT: QualName: 'T'
+// YAML-NEXT: Name: 'x'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Name: 'void'
+// YAML-NEXT: QualName: 'void'
+// YAML-NEXT: Template:
+// YAML-NEXT: Params:
+// YAML-NEXT: - Contents: 'typename T'
+// YAML-NEXT: - Contents: 'int U = 1'
+
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'longFunction'
+// YAML-NEXT: DefLocation:
+// YAML-NEXT: LineNumber: 6
+// YAML-NEXT: Filename: '{{.*}}'
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'A'
+// YAML-NEXT: QualName: 'A'
+// YAML-NEXT: Name: 'a'
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'B'
+// YAML-NEXT: QualName: 'B'
+// YAML-NEXT: Name: 'b'
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'C'
+// YAML-NEXT: QualName: 'C'
+// YAML-NEXT: Name: 'c'
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'D'
+// YAML-NEXT: QualName: 'D'
+// YAML-NEXT: Name: 'd'
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'E'
+// YAML-NEXT: QualName: 'E'
+// YAML-NEXT: Name: 'e'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Name: 'void'
+// YAML-NEXT: QualName: 'void'
+// YAML-NEXT: Template:
+// YAML-NEXT: Params:
+// YAML-NEXT: - Contents: 'typename A'
+// YAML-NEXT: - Contents: 'typename B'
+// YAML-NEXT: - Contents: 'typename C'
+// YAML-NEXT: - Contents: 'typename D'
+// YAML-NEXT: - Contents: 'typename E'
+
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'function'
+// YAML-NEXT: DefLocation:
+// YAML-NEXT: LineNumber: 8
+// YAML-NEXT: Filename: '{{.*}}'
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Name: 'bool'
+// YAML-NEXT: QualName: 'bool'
+// YAML-NEXT: Name: 'x'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Name: 'void'
+// YAML-NEXT: QualName: 'void'
+// YAML-NEXT: Template:
+// YAML-NEXT: Specialization:
+// YAML-NEXT: SpecializationOf: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Params:
+// YAML-NEXT: - Contents: 'bool'
+// YAML-NEXT: - Contents: '0'
+
+// YAML-NEXT: - USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Name: 'func_with_tuple_param'
+// YAML-NEXT: Description:
+// YAML-NEXT: - Kind: FullComment
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: ParagraphComment
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: TextComment
+// YAML-NEXT: Text: 'A function with a tuple parameter'
+// YAML-NEXT: - Kind: ParagraphComment
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: TextComment
+// YAML-NEXT: - Kind: ParamCommandComment
+// YAML-NEXT: Direction: '[in]'
+// YAML-NEXT: ParamName: 't'
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: ParagraphComment
+// YAML-NEXT: Children:
+// YAML-NEXT: - Kind: TextComment
+// YAML-NEXT: Text: 'The input to func_with_tuple_param'
+// YAML-NEXT: DefLocation:
+// YAML-NEXT: LineNumber: 18
+// YAML-NEXT: Filename:
+// YAML-NEXT: Params:
+// YAML-NEXT: - Type:
+// YAML-NEXT: Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple<int, int, bool>'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
+// YAML-NEXT: Name: 't'
+// YAML-NEXT: ReturnType:
+// YAML-NEXT: Type:
+// YAML-NEXT: Type: Record
+// YAML-NEXT: Name: 'tuple'
+// YAML-NEXT: QualName: 'tuple<int, int, bool>'
+// YAML-NEXT: USR: '{{([0-9A-F]{40})}}'
+// YAML-NEXT: Path: 'GlobalNamespace'
+// YAML-NEXT: ...
More information about the llvm-branch-commits
mailing list