summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 14:33:06 +0000
commit061da546b983eb767bad15e67af1174fb0bcf31c (patch)
tree83c78b820819d70aa40c36d90447978b300078c5 /gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache
parentImport LLVM 10.0.0 release including clang, lld and lldb. (diff)
downloadwireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.tar.xz
wireguard-openbsd-061da546b983eb767bad15e67af1174fb0bcf31c.zip
Import LLVM 10.0.0 release including clang, lld and lldb.
ok hackroom tested by plenty
Diffstat (limited to 'gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache')
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile2
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py35
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h1
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m5
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap3
5 files changed, 46 insertions, 0 deletions
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile
new file mode 100644
index 00000000000..d0aadc1af9e
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile
@@ -0,0 +1,2 @@
+OBJC_SOURCES := main.m
+include Makefile.rules
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
new file mode 100644
index 00000000000..3a12b23a79c
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
@@ -0,0 +1,35 @@
+"""Test that the clang modules cache directory can be controlled."""
+
+
+
+import unittest2
+import os
+import shutil
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class ObjCModulesTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessDarwin
+ def test_expr(self):
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.m")
+ self.runCmd("settings set target.auto-import-clang-modules true")
+ mod_cache = self.getBuildArtifact("my-clang-modules-cache")
+ if os.path.isdir(mod_cache):
+ shutil.rmtree(mod_cache)
+ self.assertFalse(os.path.isdir(mod_cache),
+ "module cache should not exist")
+ self.runCmd('settings set symbols.clang-modules-cache-path "%s"' % mod_cache)
+ self.runCmd('settings set target.clang-module-search-paths "%s"'
+ % self.getSourceDir())
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Set breakpoint here", self.main_source_file)
+ self.runCmd("expr @import Foo")
+ self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h
new file mode 100644
index 00000000000..56757a701bf
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h
@@ -0,0 +1 @@
+void f() {}
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m
new file mode 100644
index 00000000000..6009d28d81b
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m
@@ -0,0 +1,5 @@
+#include "f.h"
+int main() {
+ f(); // Set breakpoint here.
+ return 0;
+}
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap
new file mode 100644
index 00000000000..f54534a1c07
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap
@@ -0,0 +1,3 @@
+module Foo {
+ header "f.h"
+}