[Lldb-commits] [lldb] 29bd219 - [lldb] Added test for objc_direct calls with categories

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 20 02:08:32 PST 2019


Author: Raphael Isemann
Date: 2019-12-20T11:07:30+01:00
New Revision: 29bd2194979c50097edb39a4beb714bff8c153a1

URL: https://github.com/llvm/llvm-project/commit/29bd2194979c50097edb39a4beb714bff8c153a1
DIFF: https://github.com/llvm/llvm-project/commit/29bd2194979c50097edb39a4beb714bff8c153a1.diff

LOG: [lldb] Added test for objc_direct calls with categories

As pointed out in D71694 this wasn't tested before in LLDB.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lang/objc/objc_direct-methods/main.m

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lang/objc/objc_direct-methods/main.m b/lldb/packages/Python/lldbsuite/test/lang/objc/objc_direct-methods/main.m
index 1a199acdda45..6799f22500c9 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/objc_direct-methods/main.m
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/objc_direct-methods/main.m
@@ -24,6 +24,7 @@ -(int) entryPoint
             //%self.expect("expr [self directCallNSStringArg: str]", substrs=['@"some string"'])
             //%self.expect("expr [self directCallIdArg: (id)str]", substrs=['@"some string appendix"'])
             //%self.expect("expr [self directCallConflictingName]", substrs=["correct function"])
+            //%self.expect("expr [self directCallWithCategory]", substrs=["called function with category"])
 }
 
 // Declare several objc_direct functions we can test.
@@ -61,6 +62,17 @@ -(const char *) directCallConflictingName  __attribute__((objc_direct))
 }
 @end
 
+
+ at interface Foo (Cat)
+ at end
+
+ at implementation Foo (Cat)
+-(const char *) directCallWithCategory  __attribute__((objc_direct))
+{
+  return "called function with category";
+}
+ at end
+
 int main()
 {
   Foo *foo = [[Foo alloc] init];
@@ -75,5 +87,6 @@ int main()
                      //%self.expect("expr [foo directCallNSStringArg: str]", substrs=['@"some string"'])
                      //%self.expect("expr [foo directCallIdArg: (id)str]", substrs=['@"some string appendix"'])
                      //%self.expect("expr [foo directCallConflictingName]", substrs=["correct function"])
+                     //%self.expect("expr [foo directCallWithCategory]", substrs=["called function with category"])
   return 0;
 }


        


More information about the lldb-commits mailing list