diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-10 22:35:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-10-10 22:35:27 +0000 |
commit | d97d35e1500d98f4f50938c5ecae98a1301a9a10 (patch) | |
tree | a25dd0bc78652222302147ca3b1cb546f9b7c6ad /clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface | |
parent | 149178d92bf4d405e71fabb4d93204292f89acc2 (diff) | |
download | bcm5719-llvm-d97d35e1500d98f4f50938c5ecae98a1301a9a10.tar.gz bcm5719-llvm-d97d35e1500d98f4f50938c5ecae98a1301a9a10.zip |
[Modules TS] Diagnose attempts to enter module implementation units without the module interface being available.
llvm-svn: 315381
Diffstat (limited to 'clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface')
-rw-r--r-- | clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp b/clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp index afe3a7a4858..0ec1a90e1a0 100644 --- a/clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp +++ b/clang/test/CXX/modules-ts/dcl.dcl/dcl.module/dcl.module.interface/p1.cpp @@ -1,17 +1,19 @@ // RUN: %clang_cc1 -fmodules-ts %s -verify -o /dev/null -// RUN: %clang_cc1 -fmodules-ts %s -DINTERFACE -verify -o /dev/null -// RUN: %clang_cc1 -fmodules-ts %s -DIMPLEMENTATION -verify -o /dev/null +// RUN: %clang_cc1 -fmodules-ts %s -DINTERFACE -verify -emit-module-interface -o %t +// RUN: %clang_cc1 -fmodules-ts %s -DIMPLEMENTATION -verify -fmodule-file=%t -o /dev/null // // RUN: %clang_cc1 -fmodules-ts %s -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null // RUN: %clang_cc1 -fmodules-ts %s -DINTERFACE -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null // RUN: %clang_cc1 -fmodules-ts %s -DIMPLEMENTATION -DBUILT_AS_INTERFACE -emit-module-interface -verify -o /dev/null #if INTERFACE +// expected-no-diagnostics export module A; #elif IMPLEMENTATION module A; #ifdef BUILT_AS_INTERFACE // expected-error@-2 {{missing 'export' specifier in module declaration while building module interface}} + #define INTERFACE #endif #else #ifdef BUILT_AS_INTERFACE @@ -19,9 +21,8 @@ module A; #endif #endif -export int a; #ifndef INTERFACE -// expected-error@-2 {{export declaration can only be used within a module interface unit}} +export int b; // expected-error {{export declaration can only be used within a module interface unit}} #else -// expected-no-diagnostics +export int a; #endif |