Add a test for UsedDeclVisitor

This test is reduced from mlir/lib/Transforms/AffineDataCopyGeneration.cpp
to make sure there is no assertion due to UsedDeclVisitor.
This commit is contained in:
Yaxun (Sam) Liu 2020-03-19 00:22:58 -04:00
parent 2c1ba63ede
commit e778db6d72
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -o %t %s
// Make sure there is no assertion due to UsedDeclVisitor.
struct A {
int a;
};
static A a;
struct B {
B(int b = a.a) {}
};
void foo() {
B();
}