summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi
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/macosx/macabi
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/macosx/macabi')
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile13
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/TestMacABImacOSFramework.py28
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.c8
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.h1
-rw-r--r--gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/main.c5
5 files changed, 55 insertions, 0 deletions
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile
new file mode 100644
index 00000000000..2123af1dd70
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile
@@ -0,0 +1,13 @@
+C_SOURCES := main.c
+LD_EXTRAS := -L. -lfoo
+
+TRIPLE := x86_64-apple-ios13.0-macabi
+CFLAGS_EXTRAS := -target $(TRIPLE)
+
+all: libfoo.dylib a.out
+
+libfoo.dylib: foo.c
+ $(MAKE) -f $(MAKEFILE_RULES) \
+ DYLIB_ONLY=YES DYLIB_NAME=foo DYLIB_C_SOURCES=foo.c
+
+include Makefile.rules
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/TestMacABImacOSFramework.py b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/TestMacABImacOSFramework.py
new file mode 100644
index 00000000000..23b26772554
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/TestMacABImacOSFramework.py
@@ -0,0 +1,28 @@
+# TestMacABImacOSFramework.py
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+import os
+import unittest2
+
+
+class TestMacABImacOSFramework(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipIf(macos_version=["<", "10.15"])
+ @skipUnlessDarwin
+ @skipIfDarwinEmbedded
+ # There is a Clang driver change missing on llvm.org.
+ @expectedFailureAll(bugnumber="rdar://problem/54986190>")
+ def test_macabi(self):
+ """Test the x86_64-apple-ios-macabi target linked against a macos dylib"""
+ self.build()
+ lldbutil.run_to_source_breakpoint(self, "break here",
+ lldb.SBFileSpec('main.c'))
+ self.expect("image list -t -b",
+ patterns=["x86_64.*-apple-ios.*-macabi a\.out",
+ "x86_64.*-apple-macosx.* libfoo.dylib[^(]"])
+ self.expect("fr v s", "Hello MacABI")
+ self.expect("p s", "Hello MacABI")
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.c b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.c
new file mode 100644
index 00000000000..9c29d590f26
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.c
@@ -0,0 +1,8 @@
+#include "foo.h"
+
+void stop() {}
+
+int foo() {
+ stop();
+ return 0;
+}
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.h b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.h
new file mode 100644
index 00000000000..5d5f8f0c9e7
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/foo.h
@@ -0,0 +1 @@
+int foo();
diff --git a/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/main.c b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/main.c
new file mode 100644
index 00000000000..92069d902fd
--- /dev/null
+++ b/gnu/llvm/lldb/packages/Python/lldbsuite/test/macosx/macabi/main.c
@@ -0,0 +1,5 @@
+#include "foo.h"
+int main() {
+ const char *s = "Hello MacABI!";
+ return foo(); // break here
+}