r293223 - [modules] Additional tests.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 26 15:08:00 PST 2017


Author: rsmith
Date: Thu Jan 26 17:07:59 2017
New Revision: 293223

URL: http://llvm.org/viewvc/llvm-project?rev=293223&view=rev
Log:
[modules] Additional tests.

Added:
    cfe/trunk/test/Modules/Inputs/anon-redecl/
    cfe/trunk/test/Modules/Inputs/anon-redecl/a.h
    cfe/trunk/test/Modules/Inputs/anon-redecl/b.h
    cfe/trunk/test/Modules/Inputs/anon-redecl/c1.h
    cfe/trunk/test/Modules/Inputs/anon-redecl/c2.h
    cfe/trunk/test/Modules/Inputs/anon-redecl/module.modulemap
    cfe/trunk/test/Modules/Inputs/hidden-names/
    cfe/trunk/test/Modules/Inputs/hidden-names/hidden.h
    cfe/trunk/test/Modules/Inputs/hidden-names/module.modulemap
    cfe/trunk/test/Modules/Inputs/hidden-names/visible.h
    cfe/trunk/test/Modules/Inputs/merge-function-defs/
    cfe/trunk/test/Modules/Inputs/merge-function-defs/a.h
    cfe/trunk/test/Modules/Inputs/merge-function-defs/b.h
    cfe/trunk/test/Modules/Inputs/merge-function-defs/map
    cfe/trunk/test/Modules/anon-redecl.cpp
    cfe/trunk/test/Modules/hidden-names.cpp
    cfe/trunk/test/Modules/merge-function-defs.cpp

Added: cfe/trunk/test/Modules/Inputs/anon-redecl/a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/anon-redecl/a.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/anon-redecl/a.h (added)
+++ cfe/trunk/test/Modules/Inputs/anon-redecl/a.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,2 @@
+struct X { union { int n; }; };
+inline int a(X x) { return x.n; }

Added: cfe/trunk/test/Modules/Inputs/anon-redecl/b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/anon-redecl/b.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/anon-redecl/b.h (added)
+++ cfe/trunk/test/Modules/Inputs/anon-redecl/b.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,2 @@
+struct X { union { int n; }; };
+inline int b(X x) { return x.n; }

Added: cfe/trunk/test/Modules/Inputs/anon-redecl/c1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/anon-redecl/c1.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/anon-redecl/c1.h (added)
+++ cfe/trunk/test/Modules/Inputs/anon-redecl/c1.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,2 @@
+#include "a.h"
+#include "b.h"

Added: cfe/trunk/test/Modules/Inputs/anon-redecl/c2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/anon-redecl/c2.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/anon-redecl/c2.h (added)
+++ cfe/trunk/test/Modules/Inputs/anon-redecl/c2.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,2 @@
+struct X { union { int n; }; };
+inline int c(X x) { return x.n; }

Added: cfe/trunk/test/Modules/Inputs/anon-redecl/module.modulemap
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/anon-redecl/module.modulemap?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/anon-redecl/module.modulemap (added)
+++ cfe/trunk/test/Modules/Inputs/anon-redecl/module.modulemap Thu Jan 26 17:07:59 2017
@@ -0,0 +1,6 @@
+module a { header "a.h" }
+module b { header "b.h" }
+module c {
+  module c1 { header "c1.h" }
+  module c2 { header "c2.h" }
+}

Added: cfe/trunk/test/Modules/Inputs/hidden-names/hidden.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/hidden-names/hidden.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/hidden-names/hidden.h (added)
+++ cfe/trunk/test/Modules/Inputs/hidden-names/hidden.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,3 @@
+namespace NS {
+  struct X {};
+}

Added: cfe/trunk/test/Modules/Inputs/hidden-names/module.modulemap
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/hidden-names/module.modulemap?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/hidden-names/module.modulemap (added)
+++ cfe/trunk/test/Modules/Inputs/hidden-names/module.modulemap Thu Jan 26 17:07:59 2017
@@ -0,0 +1,4 @@
+module hidden {
+  header "visible.h"
+  explicit module sub { header "hidden.h" }
+}

Added: cfe/trunk/test/Modules/Inputs/hidden-names/visible.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/hidden-names/visible.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/hidden-names/visible.h (added)
+++ cfe/trunk/test/Modules/Inputs/hidden-names/visible.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,2 @@
+// hidden-names/visible.h
+namespace NS {}

Added: cfe/trunk/test/Modules/Inputs/merge-function-defs/a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-function-defs/a.h?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-function-defs/a.h (added)
+++ cfe/trunk/test/Modules/Inputs/merge-function-defs/a.h Thu Jan 26 17:07:59 2017
@@ -0,0 +1,4 @@
+struct X {
+  virtual void f();
+};
+inline void X::f() {}

Added: cfe/trunk/test/Modules/Inputs/merge-function-defs/b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-function-defs/b.h?rev=293223&view=auto
==============================================================================
    (empty)

Added: cfe/trunk/test/Modules/Inputs/merge-function-defs/map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-function-defs/map?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-function-defs/map (added)
+++ cfe/trunk/test/Modules/Inputs/merge-function-defs/map Thu Jan 26 17:07:59 2017
@@ -0,0 +1,4 @@
+module m {
+  module a { header "a.h" }
+  module b { header "b.h" }
+}

Added: cfe/trunk/test/Modules/anon-redecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/anon-redecl.cpp?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/anon-redecl.cpp (added)
+++ cfe/trunk/test/Modules/anon-redecl.cpp Thu Jan 26 17:07:59 2017
@@ -0,0 +1,15 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodules-local-submodule-visibility \
+// RUN:            -fmodule-map-file=%S/Inputs/anon-redecl/module.modulemap \
+// RUN:            -I%S/Inputs/anon-redecl \
+// RUN:            -verify -std=c++11 %s
+
+#include "a.h"
+#include "b.h"
+#include "c1.h"
+#include "c2.h"
+
+// expected-no-diagnostics
+int x = a({});
+int y = b({});
+int z = c({});

Added: cfe/trunk/test/Modules/hidden-names.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/hidden-names.cpp?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/hidden-names.cpp (added)
+++ cfe/trunk/test/Modules/hidden-names.cpp Thu Jan 26 17:07:59 2017
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/hidden-names %s -verify
+// expected-no-diagnostics
+
+#include "visible.h"
+
+using namespace NS;
+
+namespace {
+  struct X { void f(); };
+}
+
+void X::f() {}

Added: cfe/trunk/test/Modules/merge-function-defs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/merge-function-defs.cpp?rev=293223&view=auto
==============================================================================
--- cfe/trunk/test/Modules/merge-function-defs.cpp (added)
+++ cfe/trunk/test/Modules/merge-function-defs.cpp Thu Jan 26 17:07:59 2017
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -I%S/Inputs/merge-function-defs -fmodules -fmodule-map-file=%S/Inputs/merge-function-defs/map -fmodules-cache-path=%t %s -emit-llvm-only
+
+#include "b.h"
+
+struct X {
+  virtual void f();
+};
+inline void X::f() {}
+
+X x;




More information about the cfe-commits mailing list