summaryrefslogtreecommitdiff
path: root/test/Modules/dependency-dump-dependent-module.m
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-06-19 19:36:03 +0000
committerJustin Bogner <mail@justinbogner.com>2014-06-19 19:36:03 +0000
commit329c41fc3dddc19b8d77419560fa30ac2ed0ee51 (patch)
treecb1454301f5a23cb4e13fad8270d1fda199a8864 /test/Modules/dependency-dump-dependent-module.m
parentb6fcb1e475ea0d1395915c1d56a195128f654837 (diff)
downloadclang-329c41fc3dddc19b8d77419560fa30ac2ed0ee51.tar.gz
Frontend: Add a CC1 flag to dump module dependencies to a directory
This adds the -module-dependency-dir to clang -cc1, which specifies a directory to copy all of a module's dependencies into in a form suitable to be used as a VFS using -ivfsoverlay with the generated vfs.yaml. This is useful for crashdumps that involve modules, so that the module dependencies will be intact when a crash report script is used to reproduce a problem on another machine. We currently encode the absolute path to the dump directory, due to limitations in the VFS system. Until we can handle relative paths in the VFS, users of the VFS map may need to run a simple search and replace in the file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/dependency-dump-dependent-module.m')
-rw-r--r--test/Modules/dependency-dump-dependent-module.m27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Modules/dependency-dump-dependent-module.m b/test/Modules/dependency-dump-dependent-module.m
new file mode 100644
index 0000000000..5308f7efba
--- /dev/null
+++ b/test/Modules/dependency-dump-dependent-module.m
@@ -0,0 +1,27 @@
+// When a module depends on another, check that we dump the dependency header
+// files for both.
+
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -module-dependency-dir %t/vfs -F %S/Inputs -I %S/Inputs -verify %s
+// expected-no-diagnostics
+
+// RUN: FileCheck %s -check-prefix=VFS < %t/vfs/vfs.yaml
+// VFS: 'name': "AlsoDependsOnModule.h"
+// VFS: 'name': "SubFramework.h"
+// VFS: 'name': "Treasure.h"
+// VFS: 'name': "Module.h"
+// VFS: 'name': "Sub.h"
+// VFS: 'name': "Sub2.h"
+
+// TODO: We need shell to use find here. Is there a simpler way?
+// REQUIRES: shell
+
+// RUN: find %t/vfs -type f | FileCheck %s -check-prefix=DUMP
+// DUMP: AlsoDependsOnModule.framework/Headers/AlsoDependsOnModule.h
+// DUMP: Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h
+// DUMP: Module.framework/Headers/Buried/Treasure.h
+// DUMP: Module.framework/Headers/Module.h
+// DUMP: Module.framework/Headers/Sub.h
+// DUMP: Module.framework/Headers/Sub2.h
+
+@import AlsoDependsOnModule;