xref: /aosp_15_r20/external/clang/test/Modules/build-fail-notes.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: rm -rf %t
2*67e74705SXin Li// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -DgetModuleVersion="epic fail" %s 2>&1 | FileCheck %s
3*67e74705SXin Li
4*67e74705SXin Li@import DependsOnModule;
5*67e74705SXin Li
6*67e74705SXin Li// CHECK: While building module 'DependsOnModule' imported from
7*67e74705SXin Li// CHECK: While building module 'Module' imported from
8*67e74705SXin Li// CHECK: error: expected ';' after top level declarator
9*67e74705SXin Li// CHECK: note: expanded from here
10*67e74705SXin Li// CHECK: fatal error: could not build module 'Module'
11*67e74705SXin Li// CHECK: fatal error: could not build module 'DependsOnModule'
12*67e74705SXin Li// CHECK-NOT: error:
13*67e74705SXin Li
14*67e74705SXin Li// RUN: not %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs %s -fdiagnostics-show-note-include-stack 2>&1 | FileCheck -check-prefix=CHECK-REDEF %s
15*67e74705SXin Liextern int Module;
16*67e74705SXin Li
17*67e74705SXin Li// CHECK-REDEF: In module 'DependsOnModule' imported from
18*67e74705SXin Li// CHECK-REDEF: In module 'Module' imported from
19*67e74705SXin Li// CHECK-REDEF: Module.h:15:12: note: previous definition is here
20*67e74705SXin Li
21*67e74705SXin Li// RUN: not %clang_cc1 -Wincomplete-umbrella -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -DgetModuleVersion="epic fail" -serialize-diagnostic-file %t/tmp.diag %s 2>&1
22*67e74705SXin Li// RUN: c-index-test -read-diagnostics %t/tmp.diag 2>&1 | FileCheck -check-prefix=CHECK-SDIAG %s
23*67e74705SXin Li
24*67e74705SXin Li// CHECK-SDIAG: Module.h:9:13: error: expected ';' after top level declarator
25*67e74705SXin Li// CHECK-SDIAG: build-fail-notes.m:4:9: note: while building module 'DependsOnModule' imported from
26*67e74705SXin Li// CHECK-SDIAG: DependsOnModule.h:1:10: note: while building module 'Module' imported from
27*67e74705SXin Li// CHECK-SDIAG: note: expanded from here
28*67e74705SXin Li// CHECK-SDIAG: warning: umbrella header for module 'Module' does not include header 'NotInModule.h' [-Wincomplete-umbrella]
29*67e74705SXin Li// CHECK-SDIAG: DependsOnModule.h:1:10: fatal: could not build module 'Module'
30*67e74705SXin Li// CHECK-SDIAG: build-fail-notes.m:4:9: note: while building module 'DependsOnModule' imported from
31*67e74705SXin Li
32