ChuanqiXu9 wrote:
> > > I'm not much familiar with clang AST Visitor testing, but is there any
> > > unit or other tests for `clang/lib/AST`? If so, we better make test there
> > > as well. Apart from this, lgtm with nit
> >
> >
> > It is fine generally if we have lit test. But I didn't notice the lit test
> > doesn't belong to clang itself. Yeah, it is better to have a lit test under
> > clang. We wrote unit tests less than lit test.
>
> @vbvictor @ChuanqiXu9 Thanks for the review. I couldn't find any existing
> tests for `StmtProfile` and `VisitGCCAsmStmt`, so I'm not sure where the new
> test should be added. Could you suggest the appropriate place for it?
You can define two modules. And two headers. Two different GCCAsmStmt. And if
we can diagnose it, it works as expected.
The shape may be:
```C++
// a.h
inline int func() { return 43; }
// a.v1.h
inline int func() { return 44; }
// a.cppm
module;
#include "a.h"
export module a;
export using ::func;
// b.cppm
module;
#include "a.v1.h"
export module b;
export using ::func;
// use.cc
import a;
import b;
int v = func(); // It should diagnose.
```
https://github.com/llvm/llvm-project/pull/201481
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits