r297037 - [modules] Add missing test from r297030.
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 6 09:47:59 PST 2017
Author: vvassilev
Date: Mon Mar 6 11:47:57 2017
New Revision: 297037
URL: http://llvm.org/viewvc/llvm-project?rev=297037&view=rev
Log:
[modules] Add missing test from r297030.
Added:
cfe/trunk/test/Modules/Inputs/gnumode-non-benign/
cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.h
cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.modulemap
cfe/trunk/test/Modules/gnumode-non-benign.cpp
Added: cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.h?rev=297037&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.h (added)
+++ cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.h Mon Mar 6 11:47:57 2017
@@ -0,0 +1,5 @@
+// Check for GNUMode = 1 by looking for the "linux" define which only exists
+// for GNUMode = 1.
+#ifdef linux
+ #error "Submodule has GNUMode=1"
+#endif
Added: cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.modulemap
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.modulemap?rev=297037&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.modulemap (added)
+++ cfe/trunk/test/Modules/Inputs/gnumode-non-benign/module.modulemap Mon Mar 6 11:47:57 2017
@@ -0,0 +1 @@
+module "module.h" { header "module.h"}
Added: cfe/trunk/test/Modules/gnumode-non-benign.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/gnumode-non-benign.cpp?rev=297037&view=auto
==============================================================================
--- cfe/trunk/test/Modules/gnumode-non-benign.cpp (added)
+++ cfe/trunk/test/Modules/gnumode-non-benign.cpp Mon Mar 6 11:47:57 2017
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/gnumode-non-benign -verify %s
+
+// expected-no-diagnostics
+
+// This test ensures that submodules have the same GNUMode language option
+// setting as the main clang invocation.
+// Note that we set GNUMode = 0 with -std=c++11 for this file.
+
+// This module fails to compile with GNUMode = 1.
+#include "module.h"
More information about the cfe-commits
mailing list