xref: /aosp_15_r20/external/clang/test/Modules/diagnostics.modulemap (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%S/Inputs/diagnostics-aux.modulemap -fmodule-map-file=%s -fsyntax-only -x c++ /dev/null 2>&1 | FileCheck %s
2*67e74705SXin Li
3*67e74705SXin Li// CHECK: In file included from {{.*}}diagnostics-aux.modulemap:3:
4*67e74705SXin Li// CHECK: diagnostics-aux-2.modulemap:2:3: error: expected
5*67e74705SXin Li
6*67e74705SXin Li// PR22299: Ensure we can produce diagnostics for duplicate modules from -fmodule-map-file=.
7*67e74705SXin Li//
8*67e74705SXin Li// CHECK: diagnostics.modulemap:[[@LINE+2]]:8: error: redefinition of module 'foo'
9*67e74705SXin Li// CHECK: diagnostics-aux.modulemap:1:8: note: previously defined here
10*67e74705SXin Limodule foo {}
11*67e74705SXin Li
12*67e74705SXin Li//* Check that we accept BCPL comments properly, not just as an extension. */
13*67e74705SXin Li
14*67e74705SXin Limodule bad_use {
15*67e74705SXin Li  // CHECK: diagnostics.modulemap:[[@LINE+1]]:22: error: use declarations are only allowed in top-level modules
16*67e74705SXin Li  module submodule { use foo }
17*67e74705SXin Li}
18