36 lines · cpp
1// Regression test for https://github.com/llvm/llvm-project/issues/598192 3// RUN: rm -rf %t && mkdir -p %t4// RUN: clang-doc --format=md --doxygen --output=%t --executor=standalone %s5// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS-LINE6// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.md --check-prefix=MD-MYCLASS7 8// RUN: clang-doc --format=html --doxygen --output=%t --executor=standalone %s9// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MYCLASS-LINE10// RUN: FileCheck %s < %t/GlobalNamespace/MyClass.html --check-prefix=HTML-MYCLASS11 12#define DECLARE_METHODS \13 /** 14 * @brief Declare a method to calculate the sum of two numbers15 */ \16 int Add(int a, int b) { \17 return a + b; \18 }19 20// MD-MYCLASS: ### Add21// MD-MYCLASS: *public int Add(int a, int b)*22// MD-MYCLASS: **brief** Declare a method to calculate the sum of two numbers23 24// HTML-MYCLASS: <p>public int Add(int a, int b)</p>25// HTML-MYCLASS: <div>brief</div>26// HTML-MYCLASS: <p> Declare a method to calculate the sum of two numbers</p>27 28 29class MyClass {30public:31// MD-MYCLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}comments-in-macros.cpp#[[@LINE+2]]*32// HTML-MYCLASS-LINE: <p>Defined at line [[@LINE+1]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}comments-in-macros.cpp</p>33 DECLARE_METHODS34};35 36