Richard Smith | 8df390f | 2016-09-08 23:14:54 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify |
| 2 | // RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -Dmodule=int -DERRORS |
Richard Smith | bbcc9f0 | 2016-08-26 00:14:38 +0000 | [diff] [blame] | 3 | |
| 4 | module foo; |
Richard Smith | 8df390f | 2016-09-08 23:14:54 +0000 | [diff] [blame^] | 5 | #ifndef ERRORS |
| 6 | // expected-no-diagnostics |
| 7 | #else |
| 8 | // expected-error@-4 {{expected module declaration at start of module interface}} |
Richard Smith | bbcc9f0 | 2016-08-26 00:14:38 +0000 | [diff] [blame] | 9 | |
Richard Smith | 8df390f | 2016-09-08 23:14:54 +0000 | [diff] [blame^] | 10 | // FIXME: support 'export module X;' and 'export { int n; module X; }' |
| 11 | // FIXME: proclaimed-ownership-declarations? |
| 12 | |
| 13 | export { |
| 14 | int a; |
| 15 | int b; |
| 16 | } |
| 17 | export int c; |
| 18 | |
| 19 | namespace N { |
| 20 | export void f() {} |
| 21 | } |
| 22 | |
| 23 | export struct T {} t; |
| 24 | |
| 25 | struct S { |
| 26 | export int n; // expected-error {{expected member name or ';'}} |
| 27 | export static int n; // expected-error {{expected member name or ';'}} |
| 28 | }; |
| 29 | void f() { |
| 30 | export int n; // expected-error {{expected expression}} |
| 31 | } |
Richard Smith | bbcc9f0 | 2016-08-26 00:14:38 +0000 | [diff] [blame] | 32 | #endif |