diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-26 00:14:38 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-26 00:14:38 +0000 |
commit | bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4 (patch) | |
tree | 707cccea7fa2a04369d734745e2af81e860a1fde /clang/test/Parser/cxx-modules-interface.cppm | |
parent | 7c5ae7cbc60f1196bd4cde77c68f4b6995596215 (diff) | |
download | bcm5719-llvm-bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4.tar.gz bcm5719-llvm-bbcc9f0462c1b56e0bd6bdd830bd0250ec8ad2d4.zip |
C++ Modules TS: add frontend support for building pcm files from module
interface files. At the moment, all declarations (and no macros) are exported,
and 'export' declarations are not supported yet.
llvm-svn: 279794
Diffstat (limited to 'clang/test/Parser/cxx-modules-interface.cppm')
-rw-r--r-- | clang/test/Parser/cxx-modules-interface.cppm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-modules-interface.cppm b/clang/test/Parser/cxx-modules-interface.cppm new file mode 100644 index 00000000000..88747714e5c --- /dev/null +++ b/clang/test/Parser/cxx-modules-interface.cppm @@ -0,0 +1,21 @@ +// 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 + +#if TEST == 0 +// expected-no-diagnostics +#endif + +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 + +int n; +#if TEST == 3 +// expected-error@-2 {{redefinition of 'n'}} +// expected-note@-3 {{previous}} +#endif |