From: Richard Smith Date: Thu, 22 Jan 2015 23:07:47 +0000 (+0000) Subject: Reorganize test/Modules: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cff53ae64d0d04e96c9e05293614d6b6e39c559e;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226875 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Modules/macro-reexport/a1.h b/test/Modules/Inputs/macro-reexport/a1.h similarity index 100% rename from test/Modules/macro-reexport/a1.h rename to test/Modules/Inputs/macro-reexport/a1.h diff --git a/test/Modules/macro-reexport/a2.h b/test/Modules/Inputs/macro-reexport/a2.h similarity index 100% rename from test/Modules/macro-reexport/a2.h rename to test/Modules/Inputs/macro-reexport/a2.h diff --git a/test/Modules/macro-reexport/b1.h b/test/Modules/Inputs/macro-reexport/b1.h similarity index 100% rename from test/Modules/macro-reexport/b1.h rename to test/Modules/Inputs/macro-reexport/b1.h diff --git a/test/Modules/macro-reexport/b2.h b/test/Modules/Inputs/macro-reexport/b2.h similarity index 100% rename from test/Modules/macro-reexport/b2.h rename to test/Modules/Inputs/macro-reexport/b2.h diff --git a/test/Modules/macro-reexport/c1.h b/test/Modules/Inputs/macro-reexport/c1.h similarity index 100% rename from test/Modules/macro-reexport/c1.h rename to test/Modules/Inputs/macro-reexport/c1.h diff --git a/test/Modules/macro-reexport/d1.h b/test/Modules/Inputs/macro-reexport/d1.h similarity index 100% rename from test/Modules/macro-reexport/d1.h rename to test/Modules/Inputs/macro-reexport/d1.h diff --git a/test/Modules/macro-reexport/d2.h b/test/Modules/Inputs/macro-reexport/d2.h similarity index 100% rename from test/Modules/macro-reexport/d2.h rename to test/Modules/Inputs/macro-reexport/d2.h diff --git a/test/Modules/macro-reexport/e1.h b/test/Modules/Inputs/macro-reexport/e1.h similarity index 100% rename from test/Modules/macro-reexport/e1.h rename to test/Modules/Inputs/macro-reexport/e1.h diff --git a/test/Modules/macro-reexport/e2.h b/test/Modules/Inputs/macro-reexport/e2.h similarity index 100% rename from test/Modules/macro-reexport/e2.h rename to test/Modules/Inputs/macro-reexport/e2.h diff --git a/test/Modules/macro-reexport/f1.h b/test/Modules/Inputs/macro-reexport/f1.h similarity index 100% rename from test/Modules/macro-reexport/f1.h rename to test/Modules/Inputs/macro-reexport/f1.h diff --git a/test/Modules/macro-reexport/module.modulemap b/test/Modules/Inputs/macro-reexport/module.modulemap similarity index 100% rename from test/Modules/macro-reexport/module.modulemap rename to test/Modules/Inputs/macro-reexport/module.modulemap diff --git a/test/Modules/redecls/a.h b/test/Modules/Inputs/redecls/a.h similarity index 100% rename from test/Modules/redecls/a.h rename to test/Modules/Inputs/redecls/a.h diff --git a/test/Modules/redecls/b.h b/test/Modules/Inputs/redecls/b.h similarity index 100% rename from test/Modules/redecls/b.h rename to test/Modules/Inputs/redecls/b.h diff --git a/test/Modules/redecls/module.map b/test/Modules/Inputs/redecls/module.map similarity index 100% rename from test/Modules/redecls/module.map rename to test/Modules/Inputs/redecls/module.map diff --git a/test/Modules/self-import-header/af.framework/Headers/a1.h b/test/Modules/Inputs/self-import-header/af.framework/Headers/a1.h similarity index 100% rename from test/Modules/self-import-header/af.framework/Headers/a1.h rename to test/Modules/Inputs/self-import-header/af.framework/Headers/a1.h diff --git a/test/Modules/self-import-header/af.framework/Headers/a2.h b/test/Modules/Inputs/self-import-header/af.framework/Headers/a2.h similarity index 100% rename from test/Modules/self-import-header/af.framework/Headers/a2.h rename to test/Modules/Inputs/self-import-header/af.framework/Headers/a2.h diff --git a/test/Modules/self-import-header/af.framework/module.map b/test/Modules/Inputs/self-import-header/af.framework/module.map similarity index 100% rename from test/Modules/self-import-header/af.framework/module.map rename to test/Modules/Inputs/self-import-header/af.framework/module.map diff --git a/test/Modules/self-import-header/depend_builtin/h1.h b/test/Modules/Inputs/self-import-header/depend_builtin/h1.h similarity index 100% rename from test/Modules/self-import-header/depend_builtin/h1.h rename to test/Modules/Inputs/self-import-header/depend_builtin/h1.h diff --git a/test/Modules/self-import-header/depend_builtin/module.map b/test/Modules/Inputs/self-import-header/depend_builtin/module.map similarity index 100% rename from test/Modules/self-import-header/depend_builtin/module.map rename to test/Modules/Inputs/self-import-header/depend_builtin/module.map diff --git a/test/Modules/dependency-gen.modulemap.cpp b/test/Modules/dependency-gen.modulemap similarity index 84% rename from test/Modules/dependency-gen.modulemap.cpp rename to test/Modules/dependency-gen.modulemap index c49714c14e..5cb8a4dba9 100644 --- a/test/Modules/dependency-gen.modulemap.cpp +++ b/test/Modules/dependency-gen.modulemap @@ -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 * diff --git a/test/Modules/macro-reexport/macro-reexport.cpp b/test/Modules/macro-reexport.cpp similarity index 50% rename from test/Modules/macro-reexport/macro-reexport.cpp rename to test/Modules/macro-reexport.cpp index af2ec847ce..1df49b948d 100644 --- a/test/Modules/macro-reexport/macro-reexport.cpp +++ b/test/Modules/macro-reexport.cpp @@ -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" diff --git a/test/Modules/redecls/main.m b/test/Modules/redecls.m similarity index 56% rename from test/Modules/redecls/main.m rename to test/Modules/redecls.m index bf3788a96d..fa643b90ac 100644 --- a/test/Modules/redecls/main.m +++ b/test/Modules/redecls.m @@ -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 diff --git a/test/Modules/self-import-header/test.m b/test/Modules/self-import-header.m similarity index 64% rename from test/Modules/self-import-header/test.m rename to test/Modules/self-import-header.m index 377c01d66e..4acc310fde 100644 --- a/test/Modules/self-import-header/test.m +++ b/test/Modules/self-import-header.m @@ -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; diff --git a/test/lit.cfg b/test/lit.cfg index b7e64b6a28..0d6fb91b3b 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -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