summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-modules-interface.cppm
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-09-08 23:14:54 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-09-08 23:14:54 +0000
commit8df390f9ebc87702ae2b6155e5d81477c481db6f (patch)
tree493246882f1e97949bb1b2966ca99a3a1da21aaa /clang/test/Parser/cxx-modules-interface.cppm
parent10037b93e90672f1819b3bc32d8d2dbeec68ae83 (diff)
downloadbcm5719-llvm-8df390f9ebc87702ae2b6155e5d81477c481db6f.tar.gz
bcm5719-llvm-8df390f9ebc87702ae2b6155e5d81477c481db6f.zip
C++ Modules TS: Add parsing and some semantic analysis support for
export-declarations. These don't yet have an effect on name visibility; we still export everything by default. llvm-svn: 280999
Diffstat (limited to 'clang/test/Parser/cxx-modules-interface.cppm')
-rw-r--r--clang/test/Parser/cxx-modules-interface.cppm43
1 files changed, 27 insertions, 16 deletions
diff --git a/clang/test/Parser/cxx-modules-interface.cppm b/clang/test/Parser/cxx-modules-interface.cppm
index 88747714e5c..f7835bd167b 100644
--- a/clang/test/Parser/cxx-modules-interface.cppm
+++ b/clang/test/Parser/cxx-modules-interface.cppm
@@ -1,21 +1,32 @@
-// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -DTEST=0
-// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -Dmodule=int -DTEST=1
-// 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
-// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -fmodule-file=%t.pcm -o %t.pcm -verify -Dfoo=bar -DTEST=3
+// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify
+// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t.pcm -verify -Dmodule=int -DERRORS
-#if TEST == 0
+module foo;
+#ifndef ERRORS
// expected-no-diagnostics
-#endif
+#else
+// expected-error@-4 {{expected module declaration at start of module interface}}
-module foo;
-#if TEST == 1
-// expected-error@-2 {{expected module declaration at start of module interface}}
-#elif TEST == 2
-// CHECK-2: error: redefinition of module 'foo'
-#endif
+// FIXME: support 'export module X;' and 'export { int n; module X; }'
+// FIXME: proclaimed-ownership-declarations?
+
+export {
+ int a;
+ int b;
+}
+export int c;
+
+namespace N {
+ export void f() {}
+}
+
+export struct T {} t;
-int n;
-#if TEST == 3
-// expected-error@-2 {{redefinition of 'n'}}
-// expected-note@-3 {{previous}}
+struct S {
+ export int n; // expected-error {{expected member name or ';'}}
+ export static int n; // expected-error {{expected member name or ';'}}
+};
+void f() {
+ export int n; // expected-error {{expected expression}}
+}
#endif
OpenPOWER on IntegriCloud