r226875 - Reorganize test/Modules:

Richard Smith richard-llvm at metafoo.co.uk
Thu Jan 22 15:07:47 PST 2015


Author: rsmith
Date: Thu Jan 22 17:07:47 2015
New Revision: 226875

URL: http://llvm.org/viewvc/llvm-project?rev=226875&view=rev
Log:
Reorganize test/Modules:
 * Put all input files under Inputs/, move corresponding tests into test/Modules.
 * Rename a modulemap test file to [...].modulemap, and teach lit that such files are tests.

Added:
    cfe/trunk/test/Modules/Inputs/macro-reexport/
      - copied from r226698, cfe/trunk/test/Modules/macro-reexport/
    cfe/trunk/test/Modules/Inputs/redecls/
      - copied from r226698, cfe/trunk/test/Modules/redecls/
    cfe/trunk/test/Modules/Inputs/self-import-header/
      - copied from r226698, cfe/trunk/test/Modules/self-import-header/
    cfe/trunk/test/Modules/dependency-gen.modulemap
      - copied, changed from r226698, cfe/trunk/test/Modules/dependency-gen.modulemap.cpp
    cfe/trunk/test/Modules/macro-reexport.cpp
      - copied, changed from r226698, cfe/trunk/test/Modules/macro-reexport/macro-reexport.cpp
    cfe/trunk/test/Modules/redecls.m
      - copied, changed from r226698, cfe/trunk/test/Modules/redecls/main.m
    cfe/trunk/test/Modules/self-import-header.m
      - copied, changed from r226698, cfe/trunk/test/Modules/self-import-header/test.m
Removed:
    cfe/trunk/test/Modules/Inputs/macro-reexport/macro-reexport.cpp
    cfe/trunk/test/Modules/Inputs/redecls/main.m
    cfe/trunk/test/Modules/Inputs/self-import-header/test.m
    cfe/trunk/test/Modules/dependency-gen.modulemap.cpp
    cfe/trunk/test/Modules/macro-reexport/
    cfe/trunk/test/Modules/redecls/
    cfe/trunk/test/Modules/self-import-header/
Modified:
    cfe/trunk/test/lit.cfg

Removed: cfe/trunk/test/Modules/Inputs/macro-reexport/macro-reexport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/macro-reexport/macro-reexport.cpp?rev=226698&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/macro-reexport/macro-reexport.cpp (original)
+++ cfe/trunk/test/Modules/Inputs/macro-reexport/macro-reexport.cpp (removed)
@@ -1,30 +0,0 @@
-// RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -DC1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DC1 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD1 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD2 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD2 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DF1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DF1 -I. -fmodules %s -fmodules-cache-path=%t -verify
-
-#if defined(F1)
-#include "f1.h"
-void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}}
-#include "e2.h" // undefines d1's macro
-void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
-#elif defined(D1)
-#include "e1.h" // undefines c1's macro but not d1's macro
-#include "d1.h"
-void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}}
-#include "e2.h" // undefines d1's macro
-void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
-#elif defined(D2)
-#include "d2.h"
-void f() { return assert(true); } // expected-error {{undeclared identifier 'b'}}
-#else
-// e2 undefines d1's macro, which overrides c1's macro.
-#include "e2.h"
-#include "c1.h"
-void f() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
-#endif

Removed: cfe/trunk/test/Modules/Inputs/redecls/main.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redecls/main.m?rev=226698&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/redecls/main.m (original)
+++ cfe/trunk/test/Modules/Inputs/redecls/main.m (removed)
@@ -1,27 +0,0 @@
-// RUN: rm -rf %t.mcp
-// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=a %S/module.map -fmodules-cache-path=%t.mcp
-// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=b %S/module.map -fmodules-cache-path=%t.mcp
-// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t1.pch -fmodules-cache-path=%t.mcp -I %S
-// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t2.pch -include-pch %t1.pch -fmodules-cache-path=%t.mcp -I %S
-// RUN: %clang_cc1 -fmodules %s -fsyntax-only -include-pch %t2.pch -I %S -fmodules-cache-path=%t.mcp -verify
-
-#ifndef HEADER1
-#define HEADER1
-
- at import a;
-
-#elif !defined(HEADER2)
-#define HEADER2
-
- at class AA;
- at import b;
-
-#else
-
-// rdar://13712705
- at interface SS : AA
- at end
-
-#warning parsed this
-#endif
-// expected-warning at -2{{parsed this}}

Removed: cfe/trunk/test/Modules/Inputs/self-import-header/test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/self-import-header/test.m?rev=226698&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/self-import-header/test.m (original)
+++ cfe/trunk/test/Modules/Inputs/self-import-header/test.m (removed)
@@ -1,8 +0,0 @@
-// rdar://13840148
-
-// RUN: rm -rf %t
-// RUN: %clang -fsyntax-only -isysroot %S/../Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
-// RUN:    -target x86_64-darwin \
-// RUN:    -F %S -I %S %s -D__need_wint_t -Werror=implicit-function-declaration
-
- at import af;

Copied: cfe/trunk/test/Modules/dependency-gen.modulemap (from r226698, cfe/trunk/test/Modules/dependency-gen.modulemap.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/dependency-gen.modulemap?p2=cfe/trunk/test/Modules/dependency-gen.modulemap&p1=cfe/trunk/test/Modules/dependency-gen.modulemap.cpp&r1=226698&r2=226875&rev=226875&view=diff
==============================================================================
--- cfe/trunk/test/Modules/dependency-gen.modulemap.cpp (original)
+++ cfe/trunk/test/Modules/dependency-gen.modulemap Thu Jan 22 17:07:47 2015
@@ -3,7 +3,7 @@
 // RUN: cd %S
 // RUN: rm -f %t.cpm %t-base.pcm %t-base.d %t.d
 // RUN: %clang_cc1 -I. -x c++ -fmodule-maps -fmodule-name=test-base -fno-modules-implicit-maps -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse Inputs/dependency-gen-base.modulemap -dependency-file %t-base.d -MT %t-base.pcm -o %t-base.pcm -fmodule-map-file-home-is-cwd
-// RUN: %clang_cc1 -I. -x c++ -fmodule-maps -fmodule-name=test -fno-modules-implicit-maps -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse -fmodule-file=%t-base.pcm dependency-gen.modulemap.cpp -dependency-file %t.d -MT %t.pcm -o %t.pcm -fmodule-map-file-home-is-cwd
+// RUN: %clang_cc1 -I. -x c++ -fmodule-maps -fmodule-name=test -fno-modules-implicit-maps -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse -fmodule-file=%t-base.pcm %s -dependency-file %t.d -MT %t.pcm -o %t.pcm -fmodule-map-file-home-is-cwd
 // RUN: FileCheck %s < %t.d
 module "test" {
   export *

Removed: cfe/trunk/test/Modules/dependency-gen.modulemap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/dependency-gen.modulemap.cpp?rev=226874&view=auto
==============================================================================
--- cfe/trunk/test/Modules/dependency-gen.modulemap.cpp (original)
+++ cfe/trunk/test/Modules/dependency-gen.modulemap.cpp (removed)
@@ -1,18 +0,0 @@
-// REQUIRES: shell
-//
-// RUN: cd %S
-// RUN: rm -f %t.cpm %t-base.pcm %t-base.d %t.d
-// RUN: %clang_cc1 -I. -x c++ -fmodule-maps -fmodule-name=test-base -fno-modules-implicit-maps -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse Inputs/dependency-gen-base.modulemap -dependency-file %t-base.d -MT %t-base.pcm -o %t-base.pcm -fmodule-map-file-home-is-cwd
-// RUN: %clang_cc1 -I. -x c++ -fmodule-maps -fmodule-name=test -fno-modules-implicit-maps -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse -fmodule-file=%t-base.pcm dependency-gen.modulemap.cpp -dependency-file %t.d -MT %t.pcm -o %t.pcm -fmodule-map-file-home-is-cwd
-// RUN: FileCheck %s < %t.d
-module "test" {
-  export *
-  header "Inputs/dependency-gen.h"
-  use "test-base"
-  use "test-base2"
-}
-extern module "test-base2" "Inputs/dependency-gen-base2.modulemap"
-extern module "test-base" "Inputs/dependency-gen-base.modulemap"
-
-// CHECK: {{ |\./}}Inputs/dependency-gen-included2.h
-// CHECK: {{ |\./}}Inputs/dependency-gen-base.modulemap

Copied: cfe/trunk/test/Modules/macro-reexport.cpp (from r226698, cfe/trunk/test/Modules/macro-reexport/macro-reexport.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/macro-reexport.cpp?p2=cfe/trunk/test/Modules/macro-reexport.cpp&p1=cfe/trunk/test/Modules/macro-reexport/macro-reexport.cpp&r1=226698&r2=226875&rev=226875&view=diff
==============================================================================
--- cfe/trunk/test/Modules/macro-reexport/macro-reexport.cpp (original)
+++ cfe/trunk/test/Modules/macro-reexport.cpp Thu Jan 22 17:07:47 2015
@@ -1,12 +1,12 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fsyntax-only -DC1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DC1 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD1 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD2 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DD2 -I. -fmodules %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DF1 -I. %s -fmodules-cache-path=%t -verify
-// RUN: %clang_cc1 -fsyntax-only -DF1 -I. -fmodules %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport -fmodules %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport -fmodules %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport -fmodules %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
+// RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport -fmodules %s -fmodules-cache-path=%t -verify
 
 #if defined(F1)
 #include "f1.h"

Copied: cfe/trunk/test/Modules/redecls.m (from r226698, cfe/trunk/test/Modules/redecls/main.m)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/redecls.m?p2=cfe/trunk/test/Modules/redecls.m&p1=cfe/trunk/test/Modules/redecls/main.m&r1=226698&r2=226875&rev=226875&view=diff
==============================================================================
--- cfe/trunk/test/Modules/redecls/main.m (original)
+++ cfe/trunk/test/Modules/redecls.m Thu Jan 22 17:07:47 2015
@@ -1,9 +1,7 @@
 // RUN: rm -rf %t.mcp
-// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=a %S/module.map -fmodules-cache-path=%t.mcp
-// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-name=b %S/module.map -fmodules-cache-path=%t.mcp
-// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t1.pch -fmodules-cache-path=%t.mcp -I %S
-// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t2.pch -include-pch %t1.pch -fmodules-cache-path=%t.mcp -I %S
-// RUN: %clang_cc1 -fmodules %s -fsyntax-only -include-pch %t2.pch -I %S -fmodules-cache-path=%t.mcp -verify
+// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t1.pch -fmodules-cache-path=%t.mcp -I %S/Inputs/redecls
+// RUN: %clang_cc1 -fmodules %s -emit-pch -o %t2.pch -include-pch %t1.pch -fmodules-cache-path=%t.mcp -I %S/Inputs/redecls
+// RUN: %clang_cc1 -fmodules %s -fsyntax-only -include-pch %t2.pch -I %S/Inputs/redecls -fmodules-cache-path=%t.mcp -verify
 
 #ifndef HEADER1
 #define HEADER1

Copied: cfe/trunk/test/Modules/self-import-header.m (from r226698, cfe/trunk/test/Modules/self-import-header/test.m)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/self-import-header.m?p2=cfe/trunk/test/Modules/self-import-header.m&p1=cfe/trunk/test/Modules/self-import-header/test.m&r1=226698&r2=226875&rev=226875&view=diff
==============================================================================
--- cfe/trunk/test/Modules/self-import-header/test.m (original)
+++ cfe/trunk/test/Modules/self-import-header.m Thu Jan 22 17:07:47 2015
@@ -3,6 +3,6 @@
 // RUN: rm -rf %t
 // RUN: %clang -fsyntax-only -isysroot %S/../Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
 // RUN:    -target x86_64-darwin \
-// RUN:    -F %S -I %S %s -D__need_wint_t -Werror=implicit-function-declaration
+// RUN:    -F %S -I %S/Inputs/self-import-header %s -D__need_wint_t -Werror=implicit-function-declaration
 
 @import af;

Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=226875&r1=226874&r2=226875&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Thu Jan 22 17:07:47 2015
@@ -44,7 +44,7 @@ else:
 config.test_format = lit.formats.ShTest(execute_external)
 
 # suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S']
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap']
 
 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
 # subdirectories contain auxiliary inputs for various tests in their parent





More information about the cfe-commits mailing list