blob: 3b5b6a5c0396cce22d816a02d3f08271f382d5a3 [file] [log] [blame]
Richard Smith8f4d3ff2015-03-26 22:10:01 +00001// 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
Richard Smithac425e92015-01-23 00:01:13 +00002
Richard Smithae6df272015-07-14 02:06:01 +00003// CHECK: In file included from {{.*}}diagnostics-aux.modulemap:3:
4// CHECK: diagnostics-aux-2.modulemap:2:3: error: expected
5
Richard Smithac425e92015-01-23 00:01:13 +00006// PR22299: Ensure we can produce diagnostics for duplicate modules from -fmodule-map-file=.
7//
Richard Smith8f4d3ff2015-03-26 22:10:01 +00008// CHECK: diagnostics.modulemap:[[@LINE+2]]:8: error: redefinition of module 'foo'
9// CHECK: diagnostics-aux.modulemap:1:8: note: previously defined here
Richard Smithac425e92015-01-23 00:01:13 +000010module foo {}
Richard Smith0414b852015-02-14 05:32:00 +000011
12//* Check that we accept BCPL comments properly, not just as an extension. */
Richard Smith8f4d3ff2015-03-26 22:10:01 +000013
14module bad_use {
15 // CHECK: diagnostics.modulemap:[[@LINE+1]]:22: error: use declarations are only allowed in top-level modules
16 module submodule { use foo }
17}