[cfe-commits] r144795 - in /cfe/trunk/test/Modules: Inputs/category_bottom.h Inputs/category_left.h Inputs/category_right.h Inputs/category_top.h Inputs/module.map Inputs/redeclarations_left.h Inputs/redeclarations_right.h load_failure.c objc-categories.m redeclarations.m

Douglas Gregor dgregor at apple.com
Wed Nov 16 07:22:03 PST 2011


Author: dgregor
Date: Wed Nov 16 09:22:03 2011
New Revision: 144795

URL: http://llvm.org/viewvc/llvm-project?rev=144795&view=rev
Log:
Switch the remaining modules tests over to -emit-module-from-map.

Added:
    cfe/trunk/test/Modules/Inputs/category_bottom.h
    cfe/trunk/test/Modules/Inputs/category_left.h
    cfe/trunk/test/Modules/Inputs/category_right.h
    cfe/trunk/test/Modules/Inputs/category_top.h
    cfe/trunk/test/Modules/Inputs/redeclarations_left.h
    cfe/trunk/test/Modules/Inputs/redeclarations_right.h
Modified:
    cfe/trunk/test/Modules/Inputs/module.map
    cfe/trunk/test/Modules/load_failure.c
    cfe/trunk/test/Modules/objc-categories.m
    cfe/trunk/test/Modules/redeclarations.m

Added: cfe/trunk/test/Modules/Inputs/category_bottom.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_bottom.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_bottom.h (added)
+++ cfe/trunk/test/Modules/Inputs/category_bottom.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,11 @@
+__import_module__ category_left;
+
+ at interface Foo(Bottom)
+-(void)bottom;
+ at end
+
+__import_module__ category_right;
+
+ at interface LeftFoo(Bottom)
+-(void)bottom;
+ at end

Added: cfe/trunk/test/Modules/Inputs/category_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_left.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_left.h (added)
+++ cfe/trunk/test/Modules/Inputs/category_left.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,15 @@
+__import_module__ category_top;
+
+ at interface Foo(Left)
+-(void)left;
+ at end
+
+ at interface LeftFoo
+-(void)left;
+ at end
+
+ at interface Foo(Duplicate)
+ at end
+
+ at interface Foo(Duplicate)
+ at end

Added: cfe/trunk/test/Modules/Inputs/category_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_right.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_right.h (added)
+++ cfe/trunk/test/Modules/Inputs/category_right.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,12 @@
+__import_module__ category_top;
+
+ at interface Foo(Right1)
+-(void)right1;
+ at end
+
+ at interface Foo(Right2)
+-(void)right2;
+ at end
+
+ at interface Foo(Duplicate) // expected-warning {{duplicate definition of category}}
+ at end

Added: cfe/trunk/test/Modules/Inputs/category_top.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/category_top.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/category_top.h (added)
+++ cfe/trunk/test/Modules/Inputs/category_top.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,6 @@
+ at interface Foo
+ at end
+
+ at interface Foo(Top)
+-(void)top;
+ at end

Modified: cfe/trunk/test/Modules/Inputs/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/module.map?rev=144795&r1=144794&r2=144795&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/module.map (original)
+++ cfe/trunk/test/Modules/Inputs/module.map Wed Nov 16 09:22:03 2011
@@ -10,3 +10,10 @@
 module module_private_left { umbrella "module_private_left.h" }
 module module_private_right { umbrella "module_private_right.h" }
 module macros { umbrella "macros.h" }
+module category_top { umbrella "category_top.h" }
+module category_left { umbrella "category_left.h" }
+module category_right { umbrella "category_right.h" }
+module category_bottom { umbrella "category_bottom.h" }
+module redeclarations_left { umbrella "redeclarations_left.h" }
+module redeclarations_right { umbrella "redeclarations_right.h" }
+module load_failure { umbrella "load_failure.h" }

Added: cfe/trunk/test/Modules/Inputs/redeclarations_left.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redeclarations_left.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redeclarations_left.h (added)
+++ cfe/trunk/test/Modules/Inputs/redeclarations_left.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,2 @@
+ at class NSObject;
+

Added: cfe/trunk/test/Modules/Inputs/redeclarations_right.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/redeclarations_right.h?rev=144795&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redeclarations_right.h (added)
+++ cfe/trunk/test/Modules/Inputs/redeclarations_right.h Wed Nov 16 09:22:03 2011
@@ -0,0 +1,2 @@
+ at interface NSObject
+ at end

Modified: cfe/trunk/test/Modules/load_failure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/load_failure.c?rev=144795&r1=144794&r2=144795&view=diff
==============================================================================
--- cfe/trunk/test/Modules/load_failure.c (original)
+++ cfe/trunk/test/Modules/load_failure.c Wed Nov 16 09:22:03 2011
@@ -6,12 +6,13 @@
 __import_module__ load_failure;
 #endif
 
-// RUN: %clang_cc1 -x c++ -emit-module -o %T/load_failure.pcm %S/Inputs/load_failure.h
-// RUN: %clang_cc1 -fmodule-cache-path %T -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x c++ -fmodule-cache-path %t -fdisable-module-hash -emit-module-from-map -fmodule-name=load_failure %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
 // CHECK-NONEXISTENT: load_failure.c:2:19: fatal error: module 'load_nonexistent' not found
 
-// RUN: not %clang_cc1 -fmodule-cache-path %T -fdisable-module-hash %s -DFAILURE 2> %t
-// RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t
+// RUN: not %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -DFAILURE 2> %t.out
+// RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out
 
 // FIXME: Clean up diagnostic text below and give it a location
 // CHECK-FAILURE: error: C99 was disabled in PCH file but is currently enabled

Modified: cfe/trunk/test/Modules/objc-categories.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/objc-categories.m?rev=144795&r1=144794&r2=144795&view=diff
==============================================================================
--- cfe/trunk/test/Modules/objc-categories.m (original)
+++ cfe/trunk/test/Modules/objc-categories.m Wed Nov 16 09:22:03 2011
@@ -1,77 +1,17 @@
-// RUN: mkdir -p %t
-// RUN: %clang_cc1 -emit-module -o %t/diamond_top.pcm %s -D MODULE_TOP
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -emit-module -o %t/diamond_left.pcm %s -D MODULE_LEFT
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -emit-module -o %t/diamond_right.pcm %s -D MODULE_RIGHT
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -emit-module -o %t/diamond_bottom.pcm %s -D MODULE_BOTTOM
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash %s -verify
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_top -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_left -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_right -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t -x objective-c -fmodule-name=category_bottom -emit-module-from-map %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
 
-/*============================================================================*/
-#ifdef MODULE_TOP
+__import_module__ category_bottom;
 
- at interface Foo
- at end
-
- at interface Foo(Top)
--(void)top;
- at end
-
-/*============================================================================*/
-#elif defined(MODULE_LEFT)
-
-__import_module__ diamond_top;
-
- at interface Foo(Left)
--(void)left;
- at end
-
- at interface LeftFoo
--(void)left;
- at end
-
- at interface Foo(Duplicate) // expected-note {{previous definition}}
- at end
-
- at interface Foo(Duplicate)
- at end
-
-/*============================================================================*/
-#elif defined(MODULE_RIGHT)
-
-__import_module__ diamond_top;
 
- at interface Foo(Right1)
--(void)right1;
- at end
-
- at interface Foo(Right2)
--(void)right2;
- at end
-
- at interface Foo(Duplicate) // expected-warning {{duplicate definition of category}}
- at end
-
-/*============================================================================*/
-#elif defined(MODULE_BOTTOM)
-
-__import_module__ diamond_left;
-
- at interface Foo(Bottom)
--(void)bottom;
- at end
-
-__import_module__ diamond_right;
-
- at interface LeftFoo(Bottom)
--(void)bottom;
- at end
-
-/*============================================================================*/
-#else
-
-__import_module__ diamond_bottom;
+// in category_left.h: expected-note {{previous definition}}
 
 @interface Foo(Source)
--(void)source;
+-(void)source; 
 @end
 
 void test(Foo *foo, LeftFoo *leftFoo) {
@@ -85,5 +25,3 @@
   [leftFoo left];
   [leftFoo bottom];
 }
-
-#endif

Modified: cfe/trunk/test/Modules/redeclarations.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redeclarations.m?rev=144795&r1=144794&r2=144795&view=diff
==============================================================================
--- cfe/trunk/test/Modules/redeclarations.m (original)
+++ cfe/trunk/test/Modules/redeclarations.m Wed Nov 16 09:22:03 2011
@@ -1,22 +1,11 @@
-#ifdef MODULE_LEFT
- at class NSObject;
-#endif
-
-#ifdef MODULE_RIGHT
- at interface NSObject
- at end
-#endif
-
-#ifdef APP
-__import_module__ Right;
-__import_module__ Left;
+__import_module__ redeclarations_left;
+__import_module__ redeclarations_right;
 
 @interface MyObject : NSObject
 @end
-#endif
 
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -emit-module -o %t/Left.pcm -DMODULE_LEFT %s
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -emit-module -o %t/Right.pcm -DMODULE_RIGHT %s
-// RUN: %clang_cc1 -fmodule-cache-path %t -fdisable-module-hash -DAPP %s -verify
+// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module-from-map -fmodule-name=redeclarations_left %S/Inputs/module.map
+// RUN: %clang_cc1 -x objective-c -fmodule-cache-path %t -emit-module-from-map -fmodule-name=redeclarations_right %S/Inputs/module.map
+// RUN: %clang_cc1 -fmodule-cache-path %t %s -verify
 





More information about the cfe-commits mailing list