================
@@ -0,0 +1,10 @@
+// RUN: rm -rf %t && mkdir -p %t
+// RUN: clang-doc --compact --doxygen --output=%t --format=json 
--executor=standalone %s
+// RUN: FileCheck %s < %t/json/GlobalNamespace/_ZTV3Foo.json 
--check-prefix=CLASS
+// RUN: FileCheck %s < %t/json/index.json --check-prefix=INDEX
+
+class Foo {};
+
+// CLASS: 
{"Contexts":[{"DocumentationFileName":"index","End":true,"Name":"Global 
Namespace","QualName":"GlobalNamespace","RelativePath":"{{.*}}","USR":"0000000000000000000000000000000000000000"}],"DocumentationFileName":"_ZTV3Foo","HasContexts":true,"InfoType":"record","IsTypedef":false,"Location":{"Filename":"{{.*}}compact.cpp","LineNumber":6},"MangledName":"_ZTV3Foo","Name":"Foo","Namespace":["GlobalNamespace"],"Path":"GlobalNamespace","TagType":"class","USR":"{{([0-9A-F]{40})}}"}
----------------
ilovepi wrote:

 CHECK-SAME is exactly what you want., but first you want to match something 
partial as the first prefix.

```cpp
// CLASS: {"Contexts":
//  CLASS-SAME: {DocumentationFileName":"index"
// ...
```

We use this in clang drive tests all the time: 
https://github.com/llvm/llvm-project/blob/67ff7695616f8411abc538c634e14a0aa7141dc3/clang/test/Driver/sframe.c#L4

I didn't find it with a quick search, but there an options test that is 
basically one big CHECK-SAME

https://github.com/llvm/llvm-project/pull/190822
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to