r184472 - Test files for private header patch.

Lawrence Crowl crowl at google.com
Thu Jun 20 14:15:51 PDT 2013


Author: crowl
Date: Thu Jun 20 16:15:51 2013
New Revision: 184472

URL: http://llvm.org/viewvc/llvm-project?rev=184472&view=rev
Log:
Test files for private header patch.


Added:
    cfe/trunk/test/Modules/Inputs/private/
    cfe/trunk/test/Modules/Inputs/private/common.h
    cfe/trunk/test/Modules/Inputs/private/module.map
    cfe/trunk/test/Modules/Inputs/private/private1.h
    cfe/trunk/test/Modules/Inputs/private/private2.h
    cfe/trunk/test/Modules/Inputs/private/public1.h
    cfe/trunk/test/Modules/Inputs/private/public2.h
    cfe/trunk/test/Modules/Inputs/private0/
    cfe/trunk/test/Modules/Inputs/private0/common.h
    cfe/trunk/test/Modules/Inputs/private1/
    cfe/trunk/test/Modules/Inputs/private1/module.map
    cfe/trunk/test/Modules/Inputs/private1/private1.h
    cfe/trunk/test/Modules/Inputs/private1/public1.h
    cfe/trunk/test/Modules/Inputs/private2/
    cfe/trunk/test/Modules/Inputs/private2/module.map
    cfe/trunk/test/Modules/Inputs/private2/private2.h
    cfe/trunk/test/Modules/Inputs/private2/public2.h
    cfe/trunk/test/Modules/private.cpp
    cfe/trunk/test/Modules/private1.cpp

Added: cfe/trunk/test/Modules/Inputs/private/common.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/common.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/common.h (added)
+++ cfe/trunk/test/Modules/Inputs/private/common.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,6 @@
+#ifndef COMMON_H
+#define COMMON_H
+
+typedef int common;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/module.map?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/module.map (added)
+++ cfe/trunk/test/Modules/Inputs/private/module.map Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+module libPrivate1 {
+  header "public1.h"
+  private header "private1.h"
+}
+
+module libPrivate2 {
+  header "public2.h"
+  private header "private2.h"
+}

Added: cfe/trunk/test/Modules/Inputs/private/private1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/private1.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/private1.h (added)
+++ cfe/trunk/test/Modules/Inputs/private/private1.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PRIVATE1_H
+#define PRIVATE1_H
+
+#include "common.h"
+
+struct mitts_off1 { common field; };
+struct mitts_off1 hidden_variable1;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private/private2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/private2.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/private2.h (added)
+++ cfe/trunk/test/Modules/Inputs/private/private2.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PRIVATE2_H
+#define PRIVATE2_H
+
+#include "common.h"
+
+struct mitts_off2 { common field; };
+struct mitts_off2 hidden_variable2;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private/public1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/public1.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/public1.h (added)
+++ cfe/trunk/test/Modules/Inputs/private/public1.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PUBLIC1_H
+#define PUBLIC1_H
+
+#include "private1.h"
+
+struct use_this1 { struct mitts_off1 field; };
+struct use_this1 public_variable1;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private/public2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private/public2.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private/public2.h (added)
+++ cfe/trunk/test/Modules/Inputs/private/public2.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PUBLIC2_H
+#define PUBLIC2_H
+
+#include "private2.h"
+
+struct use_this2 { struct mitts_off2 field; };
+struct use_this2 public_variable2;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private0/common.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private0/common.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private0/common.h (added)
+++ cfe/trunk/test/Modules/Inputs/private0/common.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,6 @@
+#ifndef COMMON_H
+#define COMMON_H
+
+typedef int common;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private1/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private1/module.map?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private1/module.map (added)
+++ cfe/trunk/test/Modules/Inputs/private1/module.map Thu Jun 20 16:15:51 2013
@@ -0,0 +1,4 @@
+module libPrivate1 {
+  header "public1.h"
+  private header "private1.h"
+}

Added: cfe/trunk/test/Modules/Inputs/private1/private1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private1/private1.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private1/private1.h (added)
+++ cfe/trunk/test/Modules/Inputs/private1/private1.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PRIVATE1_H
+#define PRIVATE1_H
+
+#include "common.h"
+
+struct mitts_off1 { common field; };
+struct mitts_off1 hidden_variable1;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private1/public1.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private1/public1.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private1/public1.h (added)
+++ cfe/trunk/test/Modules/Inputs/private1/public1.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PUBLIC1_H
+#define PUBLIC1_H
+
+#include "private1.h"
+
+struct use_this1 { struct mitts_off1 field; };
+struct use_this1 public_variable1;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private2/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private2/module.map?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private2/module.map (added)
+++ cfe/trunk/test/Modules/Inputs/private2/module.map Thu Jun 20 16:15:51 2013
@@ -0,0 +1,4 @@
+module libPrivate2 {
+  header "public2.h"
+  private header "private2.h"
+}

Added: cfe/trunk/test/Modules/Inputs/private2/private2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private2/private2.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private2/private2.h (added)
+++ cfe/trunk/test/Modules/Inputs/private2/private2.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PRIVATE2_H
+#define PRIVATE2_H
+
+#include "common.h"
+
+struct mitts_off2 { common field; };
+struct mitts_off2 hidden_variable2;
+
+#endif

Added: cfe/trunk/test/Modules/Inputs/private2/public2.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/private2/public2.h?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/private2/public2.h (added)
+++ cfe/trunk/test/Modules/Inputs/private2/public2.h Thu Jun 20 16:15:51 2013
@@ -0,0 +1,9 @@
+#ifndef PUBLIC2_H
+#define PUBLIC2_H
+
+#include "private2.h"
+
+struct use_this2 { struct mitts_off2 field; };
+struct use_this2 public_variable2;
+
+#endif

Added: cfe/trunk/test/Modules/private.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/private.cpp?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/private.cpp (added)
+++ cfe/trunk/test/Modules/private.cpp Thu Jun 20 16:15:51 2013
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -I %S/Inputs/private %s -verify
+
+#include "common.h"
+ at import libPrivate1;
+#include "private1.h" // expected-error {{use of private header from outside its module}}
+#include "public2.h"
+#include "private2.h" // expected-error {{use of private header from outside its module}}
+
+struct use_this1 client_variable1;
+struct use_this2 client_variable2;
+struct mitts_off1 client_variable3;
+struct mitts_off2 client_variable4;

Added: cfe/trunk/test/Modules/private1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/private1.cpp?rev=184472&view=auto
==============================================================================
--- cfe/trunk/test/Modules/private1.cpp (added)
+++ cfe/trunk/test/Modules/private1.cpp Thu Jun 20 16:15:51 2013
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c -fmodules-cache-path=%t -fmodules -I %S/Inputs/private0 -I %S/Inputs/private1 -I %S/Inputs/private2 %s -verify
+
+#include "common.h"
+ at import libPrivate1;
+#include "private1.h" // expected-error {{use of private header from outside its module}}
+#include "public2.h"
+#include "private2.h" // expected-error {{use of private header from outside its module}}
+
+struct use_this1 client_variable1;
+struct use_this2 client_variable2;
+struct mitts_off1 client_variable3;
+struct mitts_off2 client_variable4;





More information about the cfe-commits mailing list