summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2017-06-02 01:24:18 +0000
committerSean Callanan <scallanan@apple.com>2017-06-02 01:24:18 +0000
commitddf802a04d5e873d7d58c0e85b8b243af0c13315 (patch)
tree31e24960d7aa5c61fda1a4317c8ee678504d4bce /lldb/packages/Python/lldbsuite
parenta44a6ac81f0d2acffecbe422a166c7392a19160c (diff)
downloadbcm5719-llvm-ddf802a04d5e873d7d58c0e85b8b243af0c13315.tar.gz
bcm5719-llvm-ddf802a04d5e873d7d58c0e85b8b243af0c13315.zip
[TypeSystem] Handle Clang AttributedTypes
When parsing types originating in modules, it is possible to encounter AttributedTypes (such as the type generated for NSString *_Nonnull). Some of LLDB's ClangASTContext methods deal with them; others do not. In particular, one function that did not was GetTypeInfo, causing TestObjCNewSyntax to fail. This fixes that, treating AttributedType as essentially transparent and getting the information for the modified type. In addition, however, TestObjCNewSyntax is a monolithic test that verifies a bunch of different things, all of which can break independently of one another. I broke it apart into smaller tests so that we get more precise failures when something (like this) breaks. Differential Revision: https://reviews.llvm.org/D33812 llvm-svn: 304510
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py131
1 files changed, 121 insertions, 10 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
index add3f7a01ad..96c5a33f14b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
@@ -26,16 +26,7 @@ class ObjCNewSyntaxTestCase(TestBase):
# Find the line number to break inside main().
self.line = line_number('main.m', '// Set breakpoint 0 here.')
- @skipUnlessDarwin
- @expectedFailureAll(
- oslist=['macosx'],
- compiler='clang',
- compiler_version=[
- '<',
- '7.0.0'])
- @skipIf(macos_version=["<", "10.12"])
- @expectedFailureAll(archs=["i[3-6]86"])
- def test_expr(self):
+ def runToBreakpoint(self):
self.build()
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -55,6 +46,18 @@ class ObjCNewSyntaxTestCase(TestBase):
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs=[' resolved, hit count = 1'])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_read_array(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- immutable_array[0]",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -65,6 +68,18 @@ class ObjCNewSyntaxTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
substrs=["foo"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_update_array(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- mutable_array[0] = @\"bar\"",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -75,6 +90,18 @@ class ObjCNewSyntaxTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
substrs=["bar"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_read_dictionary(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- immutable_dictionary[@\"key\"]",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -85,6 +112,18 @@ class ObjCNewSyntaxTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
substrs=["value"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_update_dictionary(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -95,6 +134,18 @@ class ObjCNewSyntaxTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
substrs=["object"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_array_literal(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- @[ @\"foo\", @\"bar\" ]",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -103,6 +154,18 @@ class ObjCNewSyntaxTestCase(TestBase):
"foo",
"bar"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_dictionary_literal(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- @{ @\"key\" : @\"object\" }",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -110,9 +173,33 @@ class ObjCNewSyntaxTestCase(TestBase):
"key",
"object"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_char_literal(self):
+ self.runToBreakpoint()
+
self.expect("expr --object-description -- @'a'",
VARIABLES_DISPLAYED_CORRECTLY, substrs=[str(ord('a'))])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_integer_literals(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- @1",
VARIABLES_DISPLAYED_CORRECTLY,
@@ -138,9 +225,33 @@ class ObjCNewSyntaxTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
substrs=["1"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_float_literal(self):
+ self.runToBreakpoint()
+
self.expect("expr -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
substrs=["NSNumber", "123.45"])
+ @skipUnlessDarwin
+ @expectedFailureAll(
+ oslist=['macosx'],
+ compiler='clang',
+ compiler_version=[
+ '<',
+ '7.0.0'])
+ @skipIf(macos_version=["<", "10.12"])
+ @expectedFailureAll(archs=["i[3-6]86"])
+ def test_expressions_in_literals(self):
+ self.runToBreakpoint()
+
self.expect(
"expr --object-description -- @( 1 + 3 )",
VARIABLES_DISPLAYED_CORRECTLY,
OpenPOWER on IntegriCloud