Richard Smith | 8f4d3ff | 2015-03-26 22:10:01 +0000 | [diff] [blame] | 1 | // 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 Smith | ac425e9 | 2015-01-23 00:01:13 +0000 | [diff] [blame] | 2 | |
Richard Smith | ae6df27 | 2015-07-14 02:06:01 +0000 | [diff] [blame] | 3 | // CHECK: In file included from {{.*}}diagnostics-aux.modulemap:3: |
| 4 | // CHECK: diagnostics-aux-2.modulemap:2:3: error: expected |
| 5 | |
Richard Smith | ac425e9 | 2015-01-23 00:01:13 +0000 | [diff] [blame] | 6 | // PR22299: Ensure we can produce diagnostics for duplicate modules from -fmodule-map-file=. |
| 7 | // |
Richard Smith | 8f4d3ff | 2015-03-26 22:10:01 +0000 | [diff] [blame] | 8 | // CHECK: diagnostics.modulemap:[[@LINE+2]]:8: error: redefinition of module 'foo' |
| 9 | // CHECK: diagnostics-aux.modulemap:1:8: note: previously defined here |
Richard Smith | ac425e9 | 2015-01-23 00:01:13 +0000 | [diff] [blame] | 10 | module foo {} |
Richard Smith | 0414b85 | 2015-02-14 05:32:00 +0000 | [diff] [blame] | 11 | |
| 12 | //* Check that we accept BCPL comments properly, not just as an extension. */ |
Richard Smith | 8f4d3ff | 2015-03-26 22:10:01 +0000 | [diff] [blame] | 13 | |
| 14 | module 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 | } |