1#import <Foundation/Foundation.h>
2
3// Tests to run:
4
5// Breakpoint 1
6// --
7// (lldb) expr (int)[str compare:@"hello"]
8// (int) $0 = 0
9// (lldb) expr (int)[str compare:@"world"]
10// (int) $1 = -1
11// (lldb) expr (int)[@"" length]
12// (int) $2 = 0
13
14int main ()
15{
16 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
17
18 NSString *str = [NSString stringWithCString:"hello" encoding:NSASCIIStringEncoding];
19
20 NSLog(@"String \"%@\" has length %lu", str, [str length]); // Set breakpoint here.
21
22 [pool drain];
23 return 0;
24}
25

source code of lldb/test/API/lang/objc/foundation/const-strings.m