summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/objc
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2017-09-22 22:34:53 +0000
committerJason Molenda <jmolenda@apple.com>2017-09-22 22:34:53 +0000
commit0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4 (patch)
tree95d5c0a42ec723578ffa47571ac0b7c6c0ef9a05 /lldb/packages/Python/lldbsuite/test/lang/objc
parentdf963a38a9e27fc43b485dfdf52bc1b090087e06 (diff)
downloadbcm5719-llvm-0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4.tar.gz
bcm5719-llvm-0187a8f6f99d22bf2ce7727e705be4c18e8d6fe4.zip
Initial patchset to get the testsuite running against armv7 and arm64 iOS devices.
Normal customer devices won't be able to run these devices, we're hoping to get a public facing bot set up at some point. Both devices pass the testsuite without any errors or failures. I have seen some instability with the armv7 test runs, I may submit additional patches to address this. arm64 looks good. I'll be watching the bots for the rest of today; if any problems are introduced by this patch I'll revert it - if anyone sees a problem with their bot that I don't see, please do the same. I know it's a rather large patch. One change I had to make specifically for iOS devices was that debugserver can't create files. There were several tests that launch the inferior process redirecting its output to a file, then they retrieve the file. They were not trying to test file redirection in these tests, so I rewrote those to write their output to a file directly. llvm-svn: 314038
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/objc')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile16
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile28
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m6
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py8
7 files changed, 53 insertions, 17 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
index 3d24348618d..2d6de6f1514 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
@@ -1,6 +1,20 @@
LEVEL = ../../../make
-CFLAGS = -g -O0
+CC ?= clang
+ifeq "$(ARCH)" ""
+ ARCH = x86_64
+endif
+
+ifeq "$(OS)" ""
+ OS = $(shell uname -s)
+endif
+
+CFLAGS ?= -g -O0
+
+ifeq "$(OS)" "Darwin"
+ CFLAGS += -arch $(ARCH)
+endif
+
LDFLAGS = $(CFLAGS) -lobjc -framework Foundation
all: a.out libTest.dylib libTestExt.dylib
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
index 564a1e15c06..df3a41fedf6 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
@@ -21,6 +21,7 @@ class TestRealDefinition(TestBase):
if self.getArchitecture() == 'i386':
self.skipTest("requires modern objc runtime")
self.build()
+ self.shlib_names = ["libTestExt.dylib", "libTest.dylib"]
self.common_setup()
line = line_number('TestExt/TestExt.m', '// break here')
@@ -46,4 +47,7 @@ class TestRealDefinition(TestBase):
def common_setup(self):
exe = os.path.join(os.getcwd(), "a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.registerSharedLibrariesWithTarget(target, self.shlib_names)
+
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
index 329ceabeea9..bd940ab148c 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
@@ -1,12 +1,28 @@
LEVEL = ../../../make
-myclass.o: myclass.h myclass.m
- $(CC) myclass.m -c -o myclass.o
+CC ?= clang
+ifeq "$(ARCH)" ""
+ ARCH = x86_64
+endif
-repro: myclass.o repro.m
- $(CC) -g -O0 myclass.o repro.m -framework Foundation
+ifeq "$(OS)" ""
+ OS = $(shell uname -s)
+endif
-cleanup:
- rm -r myclass.o
+CFLAGS ?= -g -O0
+CFLAGS_NO_DEBUG =
+ifeq "$(OS)" "Darwin"
+ CFLAGS += -arch $(ARCH)
+ CFLAGS_NO_DEBUG += -arch $(ARCH)
+endif
+
+all: aout
+
+aout:
+ $(CC) $(CFLAGS_NO_DEBUG) myclass.m -c -o myclass.o
+ $(CC) $(CFLAGS) myclass.o repro.m -framework Foundation
+
+clean::
+ rm -f myclass.o
include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
index 79b7ee5dbfb..ab01c61375a 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -33,12 +33,7 @@ class ObjCiVarIMPTestCase(TestBase):
@no_debug_info_test
def test_imp_ivar_type(self):
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
- execute_command("make repro")
-
- def cleanup():
- execute_command("make cleanup")
- self.addTearDownHook(cleanup)
-
+ self.build()
exe = os.path.join(os.getcwd(), "a.out")
# Create a target from the debugger.
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
index 75f726340ef..650923a729e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
@@ -25,6 +25,7 @@ class TestObjCStructArgument(TestBase):
@skipUnlessDarwin
@add_test_categories(['pyapi'])
+ @skipIf(debug_info=no_match(["gmodules"]), oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'arm64']) # this test program only builds for ios with -gmodules
def test_with_python_api(self):
"""Test passing structs to Objective-C methods."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
index f013c560239..337ab3408ce 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
@@ -1,4 +1,10 @@
#import <Foundation/Foundation.h>
+#include <TargetConditionals.h>
+
+#if TARGET_OS_IPHONE
+@import CoreGraphics;
+typedef CGRect NSRect;
+#endif
struct things_to_sum {
int a;
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py b/lldb/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
index 26afe71d1de..d1956d46e7b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
@@ -46,13 +46,13 @@ class Rdar10967107TestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
# check that we correctly see the const char*, even with dynamic types
# on
- self.expect("frame variable my_string", substrs=['const char *'])
+ self.expect("frame variable -raw-output my_string", substrs=['const char *'])
self.expect(
- "frame variable my_string --dynamic-type run-target",
+ "frame variable my_string --raw-output --dynamic-type run-target",
substrs=['const char *'])
# check that expr also gets it right
- self.expect("expr my_string", substrs=['const char *'])
- self.expect("expr -d run -- my_string", substrs=['const char *'])
+ self.expect("e -R -- my_string", substrs=['const char *'])
+ self.expect("expr -R -d run -- my_string", substrs=['const char *'])
# but check that we get the real Foolie as such
self.expect("frame variable my_foolie", substrs=['FoolMeOnce *'])
self.expect(
OpenPOWER on IntegriCloud