Skip to content

Commit a6a1916

Browse files
committed
Fixes #59819. The underlying problem was fixed in https://reviews.llvm.org/D142560, but this patch adds a proper regression test.
1 parent 6bbd45d commit a6a1916

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Fixes #59819. The underlying problem was fixed in https://reviews.llvm.org/D142560, but this patch adds a proper regression test.
2+
// RUN: rm -rf %t && mkdir -p %t
3+
// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s
4+
// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s
5+
// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass-LINE
6+
// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MyClass
7+
// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass-LINE
8+
// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MyClass
9+
10+
#define DECLARE_METHODS \
11+
/** \
12+
* @brief Declare a method to calculate the sum of two numbers\
13+
*/ \
14+
int Add(int a, int b) \
15+
{ \
16+
return a + b; \
17+
}
18+
19+
// MD-MyClass: ### Add
20+
// MD-MyClass: *public int Add(int a, int b)*
21+
// MD-MyClass: **brief** Declare a method to calculate the sum of two numbers
22+
23+
// HTML-MyClass: <p>public int Add(int a, int b)</p>
24+
// HTML-MyClass: <div>brief</div>
25+
// HTML-MyClass: <p> Declare a method to calculate the sum of two numbers</p>
26+
27+
28+
class MyClass {
29+
public:
30+
// MD-MyClass-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}macro.cpp#[[@LINE+2]]*
31+
// HTML-MyClass-LINE: <p>Defined at line [[@LINE+1]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}macro.cpp</p>
32+
DECLARE_METHODS
33+
};
34+
35+

0 commit comments

Comments
 (0)