diff --git a/clang-tools-extra/test/clang-doc/Inputs/basic-project/include/Calculator.h b/clang-tools-extra/test/clang-doc/Inputs/basic-project/include/Calculator.h index 6811834bc0159..195721d56fff6 100644 --- a/clang-tools-extra/test/clang-doc/Inputs/basic-project/include/Calculator.h +++ b/clang-tools-extra/test/clang-doc/Inputs/basic-project/include/Calculator.h @@ -43,4 +43,25 @@ class Calculator { * @throw std::invalid_argument if b is zero. */ double divide(int a, int b); -}; \ No newline at end of file + + /** + * @brief Performs the mod operation on integers. + * + * @param a First integer. + * @param b Second integer. + * @return The result of a % b. + */ + static int mod(int a, int b) { + return a % b; + } + + /** + * @brief A static value. + */ + static constexpr int static_val = 10; + + /** + * @brief Holds a public value. + */ + int public_val = -1; +}; 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 258ea22e46184..483d050e3225a 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 @@ -15,3 +15,4 @@ int Calculator::multiply(int a, int b) { double Calculator::divide(int a, int b) { return static_cast(a) / b; } + diff --git a/clang-tools-extra/test/clang-doc/basic-project.test b/clang-tools-extra/test/clang-doc/basic-project.test index ef26e5b8916b4..94484b393df59 100644 --- a/clang-tools-extra/test/clang-doc/basic-project.test +++ b/clang-tools-extra/test/clang-doc/basic-project.test @@ -129,6 +129,12 @@ // HTML-CALC:
brief
// HTML-CALC:

A simple calculator class.

// HTML-CALC:

Provides basic arithmetic operations.

+ +// HTML-CALC:

Members

+// HTML-CALC:
brief
+// HTML-CALC:

Holds a public value.

+// HTML-CALC:
public int public_val
+ // HTML-CALC:

Functions

// HTML-CALC:

add

// HTML-CALC:

public int add(int a, int b)

@@ -185,6 +191,18 @@ // HTML-CALC:
throw
// HTML-CALC:

if b is zero.

+// HTML-CALC:

public int mod(int a, int b)

+// CALC-NO-REPOSITORY: Defined at line 54 of file .{{.}}include{{.}}Calculator.h +// CALC-REPOSITORY: Defined at line +// CALC-REPOSITORY-NEXT: 54 +// CALC-LINE-PREFIX: 54 +// CALC-REPOSITORY-NEXT: of file +// CALC-REPOSITORY-NEXT: Calculator.h +// HTML-CALC:
brief
+// HTML-CALC:

Performs the mod operation on integers.

+// HTML-CALC:
return
+// HTML-CALC:

The result of a % b.

+ // HTML-RECTANGLE:

class Rectangle

// RECTANGLE-NO-REPOSITORY:

Defined at line 10 of file .{{.}}include{{.}}Rectangle.h

// RECTANGLE-REPOSITORY:

@@ -306,6 +324,8 @@ // MD-CALC: *Defined at .{{[\/]}}include{{[\/]}}Calculator.h#8* // MD-CALC: **brief** A simple calculator class. // MD-CALC: Provides basic arithmetic operations. +// MD-CALC: ## Members +// MD-CALC: public int public_val // MD-CALC: ## Functions // MD-CALC: ### add // MD-CALC: *public int add(int a, int b)* @@ -336,6 +356,13 @@ // MD-CALC: **b** Second integer. // MD-CALC: **return** double The result of a / b. // MD-CALC: **throw**if b is zero. +// MD-CALC: ### mod +// MD-CALC: *public int mod(int a, int b)* +// MD-CALC: *Defined at ./include{{[\/]}}Calculator.h#54* +// MD-CALC: **brief** Performs the mod operation on integers. +// MD-CALC: **a** First integer. +// MD-CALC: **b** Second integer. +// MD-CALC: **return** The result of a % b. // MD-CIRCLE: # class Circle // MD-CIRCLE: *Defined at .{{[\/]}}include{{[\/]}}Circle.h#10*