Add a test to cover structural match for recursive data types

This didn't use to work prior to r370639, now that this is supported
add a testcase to prevent regressions.

rdar://problem/53602368
This commit is contained in:
Bruno Cardoso Lopes 2019-11-14 13:44:18 -08:00
parent a4c76be506
commit 3466cebe94
5 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,2 @@
// rec-types/a.h
#include "b.h"

View File

@ -0,0 +1,2 @@
// rec-types/b.h
#include "c.h"

View File

@ -0,0 +1,7 @@
struct some_descriptor
{
// commenting line above make this struct work
void *(*thunk)(struct some_descriptor *);
unsigned long key;
};

View File

@ -0,0 +1,9 @@
module a {
header "a.h"
// Hide content by not re-exporting module b.
}
module b {
header "b.h"
export *
}

View File

@ -0,0 +1,7 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/rec-types -fsyntax-only %s -verify
#include "a.h"
#include "c.h"
void foo(struct some_descriptor *st) { (void)st->thunk; }
// expected-no-diagnostics