Richard Smith | bbcc9f0 | 2016-08-26 00:14:38 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -DTEST=0 |
| 2 | // RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -Dmodule=int -DTEST=1 |
| 3 | // RUN: not %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -fmodule-file=%t.pcm -o %t.pcm -DTEST=2 2>&1 | FileCheck %s --check-prefix=CHECK-2 |
| 4 | // RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -fmodule-file=%t.pcm -o %t.pcm -verify -Dfoo=bar -DTEST=3 |
| 5 | |
| 6 | #if TEST == 0 |
| 7 | // expected-no-diagnostics |
| 8 | #endif |
| 9 | |
| 10 | module foo; |
| 11 | #if TEST == 1 |
| 12 | // expected-error@-2 {{expected module declaration at start of module interface}} |
| 13 | #elif TEST == 2 |
| 14 | // CHECK-2: error: redefinition of module 'foo' |
| 15 | #endif |
| 16 | |
| 17 | int n; |
| 18 | #if TEST == 3 |
| 19 | // expected-error@-2 {{redefinition of 'n'}} |
| 20 | // expected-note@-3 {{previous}} |
| 21 | #endif |