[cfe-commits] r144779 - in /cfe/trunk/test/Modules: Inputs/macros.h Inputs/module.map Inputs/module_private_left.h Inputs/module_private_right.h macros.c module-private.cpp

Douglas Gregor dgregor at apple.com
Tue Nov 15 21:16:30 PST 2011


Author: dgregor
Date: Tue Nov 15 23:16:30 2011
New Revision: 144779

URL: http://llvm.org/viewvc/llvm-project?rev=144779&view=rev
Log:
Migrate a few more modules tests over to -emit-module-from-map.

Added:
    cfe/trunk/test/Modules/Inputs/macros.h   (with props)
    cfe/trunk/test/Modules/Inputs/module_private_left.h   (with props)
    cfe/trunk/test/Modules/Inputs/module_private_right.h   (with props)
Modified:
    cfe/trunk/test/Modules/Inputs/module.map
    cfe/trunk/test/Modules/macros.c
    cfe/trunk/test/Modules/module-private.cpp

Added: cfe/trunk/test/Modules/Inputs/macros.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/macros.h?rev=144779&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/macros.h (added)
+++ cfe/trunk/test/Modules/Inputs/macros.h Tue Nov 15 23:16:30 2011
@@ -0,0 +1,10 @@
+#define MODULE
+#define INTEGER(X) int
+#define FLOAT float
+#define DOUBLE double
+
+#__export_macro__ INTEGER
+#__private_macro__ FLOAT
+#__private_macro__ MODULE
+
+int (INTEGER);

Propchange: cfe/trunk/test/Modules/Inputs/macros.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/Modules/Inputs/macros.h
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/Modules/Inputs/macros.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=144779&r1=144778&r2=144779&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/module.map Tue Nov 15 23:16:30 2011
@@ -7,3 +7,6 @@
 module lookup_right_objc { umbrella "lookup_right.h" }
 module lookup_left_cxx { umbrella "lookup_left.hpp" }
 module lookup_right_cxx { umbrella "lookup_right.hpp" }
+module module_private_left { umbrella "module_private_left.h" }
+module module_private_right { umbrella "module_private_right.h" }
+module macros { umbrella "macros.h" }

Added: cfe/trunk/test/Modules/Inputs/module_private_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module_private_left.h?rev=144779&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module_private_left.h (added)
+++ cfe/trunk/test/Modules/Inputs/module_private_left.h Tue Nov 15 23:16:30 2011
@@ -0,0 +1,26 @@
+__module_private__ struct HiddenStruct;
+
+struct HiddenStruct {
+};
+
+
+int &f0(int);
+
+template<typename T>
+__module_private__ void f1(T*);
+
+template<typename T>
+void f1(T*);
+
+template<typename T>
+__module_private__ class vector;
+
+template<typename T>
+class vector {
+};
+
+vector<float> vec_float;
+
+typedef __module_private__ int Integer;
+typedef int Integer;
+

Propchange: cfe/trunk/test/Modules/Inputs/module_private_left.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/Modules/Inputs/module_private_left.h
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/Modules/Inputs/module_private_left.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cfe/trunk/test/Modules/Inputs/module_private_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module_private_right.h?rev=144779&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module_private_right.h (added)
+++ cfe/trunk/test/Modules/Inputs/module_private_right.h Tue Nov 15 23:16:30 2011
@@ -0,0 +1,13 @@
+__module_private__ double &f0(double);
+double &f0(double);
+
+__module_private__ int hidden_var;
+
+inline void test_f0_in_right() {
+  double &dr = f0(hidden_var);
+}
+
+struct VisibleStruct {
+  __module_private__ int field;
+  __module_private__ virtual void setField(int f);
+};

Propchange: cfe/trunk/test/Modules/Inputs/module_private_right.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/test/Modules/Inputs/module_private_right.h
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/test/Modules/Inputs/module_private_right.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/test/Modules/macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/macros.c?rev=144779&r1=144778&r2=144779&view=diff
==============================================================================
--- cfe/trunk/test/Modules/macros.c (original)
+++ cfe/trunk/test/Modules/macros.c Tue Nov 15 23:16:30 2011
@@ -1,19 +1,7 @@
-// RUN: %clang_cc1 -emit-module -o %t/macros.pcm -DMODULE %s
-// RUN: %clang_cc1 -verify -fmodule-cache-path %t -fdisable-module-hash %s
-// RUN: %clang_cc1 -E -fmodule-cache-path %t -fdisable-module-hash %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
-
-#if defined(MODULE)
-#define INTEGER(X) int
-#define FLOAT float
-#define DOUBLE double
-
-#__export_macro__ INTEGER
-#__private_macro__ FLOAT
-#__private_macro__ MODULE
-
-int (INTEGER);
-
-#else
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
+// RUN: %clang_cc1 -verify -fmodule-cache-path %t %s
+// RUN: %clang_cc1 -E -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
 
 __import_module__ macros;
 
@@ -39,4 +27,3 @@
   // CHECK-PREPROCESSED: int i = INTEGER;
   int i = INTEGER; // the value was exported, the macro was not.
 }
-#endif

Modified: cfe/trunk/test/Modules/module-private.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/module-private.cpp?rev=144779&r1=144778&r2=144779&view=diff
==============================================================================
--- cfe/trunk/test/Modules/module-private.cpp (original)
+++ cfe/trunk/test/Modules/module-private.cpp Tue Nov 15 23:16:30 2011
@@ -1,54 +1,10 @@
-// RUN: mkdir -p %t
-// RUN: %clang_cc1 -x c++ -emit-module -o %t/left.pcm %s -D MODULE_LEFT
-// RUN: %clang_cc1 -x c++ -emit-module -o %t/right.pcm %s -D MODULE_RIGHT
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -verify
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_left -x c++ -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t -fmodule-name=module_private_right -x c++ -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
 
-#if defined(MODULE_LEFT)
-
-__module_private__ struct HiddenStruct;
-
-struct HiddenStruct {
-};
-
-
-int &f0(int);
-
-template<typename T>
-__module_private__ void f1(T*);
-
-template<typename T>
-void f1(T*);
-
-template<typename T>
-__module_private__ class vector;
-
-template<typename T>
-class vector {
-};
-
-vector<float> vec_float;
-
-typedef __module_private__ int Integer;
-typedef int Integer;
-
-#elif defined(MODULE_RIGHT)
-__module_private__ double &f0(double);
-double &f0(double);
-
-__module_private__ int hidden_var;
-
-inline void test_f0_in_right() {
-  double &dr = f0(hidden_var);
-}
-
-struct VisibleStruct {
-  __module_private__ int field;
-  __module_private__ virtual void setField(int f);
-};
-
-#else
-__import_module__ left;
-__import_module__ right;
+__import_module__ module_private_left;
+__import_module__ module_private_right;
 
 void test() {
   int &ir = f0(1.0); // okay: f0() from 'right' is not visible
@@ -137,4 +93,3 @@
 };
 
 int check_struct_size[sizeof(VisibleStruct) == sizeof(LikeVisibleStruct)? 1 : -1];
-#endif





More information about the cfe-commits mailing list