xref: /llvm-project/clang/test/Modules/cycles.c (revision 47972afd102f557553d7c6555240bd80982afdd1)
1f31caeecSDouglas Gregor // RUN: rm -rf %t
2*47972afdSRichard Smith // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -F %S/Inputs %s 2>&1 | FileCheck %s
3da82e703SDouglas Gregor // FIXME: When we have a syntax for modules in C, use that.
4c50d4924SDouglas Gregor @import MutuallyRecursive1;
5f31caeecSDouglas Gregor 
6af8f0263SDouglas Gregor // CHECK: While building module 'MutuallyRecursive1' imported from
7af8f0263SDouglas Gregor // CHECK: While building module 'MutuallyRecursive2' imported from
8c50d4924SDouglas Gregor // CHECK: MutuallyRecursive2.h:3:9: fatal error: cyclic dependency in module 'MutuallyRecursive1': MutuallyRecursive1 -> MutuallyRecursive2 -> MutuallyRecursive1
9c50d4924SDouglas Gregor // CHECK: MutuallyRecursive1.h:2:9: fatal error: could not build module 'MutuallyRecursive2'
10c50d4924SDouglas Gregor // CHECK: cycles.c:4:9: fatal error: could not build module 'MutuallyRecursive1'
116b930967SDouglas Gregor // CHECK: 3 errors generated
126b930967SDouglas Gregor 
13f31caeecSDouglas Gregor 
14