mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 18:02:43 +00:00
[lldb] Added test for objc_direct calls with categories
As pointed out in D71694 this wasn't tested before in LLDB.
This commit is contained in:
parent
acbc9aed72
commit
29bd219497
@ -24,6 +24,7 @@ const char *directCallConflictingName() {
|
||||
//%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() {
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@interface Foo (Cat)
|
||||
@end
|
||||
|
||||
@implementation Foo (Cat)
|
||||
-(const char *) directCallWithCategory __attribute__((objc_direct))
|
||||
{
|
||||
return "called function with category";
|
||||
}
|
||||
@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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user