xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/objc-literal-debugger-test.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s -DINCLUDE_INTERFACES=1 | FileCheck %s
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc// We need two different RUN lines here because the first time a class/method is absent,
5*f4a2713aSLionel Sambuc// it will be added for -fdebugger-objc-literal.
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc#ifdef INCLUDE_INTERFACES
8*f4a2713aSLionel Sambuc@interface NSObject
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@interface NSNumber : NSObject
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface NSArray : NSObject
15*f4a2713aSLionel Sambuc@end
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc@interface NSDictionary : NSObject
18*f4a2713aSLionel Sambuc@end
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc@interface NSString : NSObject
21*f4a2713aSLionel Sambuc@end
22*f4a2713aSLionel Sambuc#endif
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambucint main() {
25*f4a2713aSLionel Sambuc  // object literals.
26*f4a2713aSLionel Sambuc  id l;
27*f4a2713aSLionel Sambuc  l = @'a';
28*f4a2713aSLionel Sambuc  l = @42;
29*f4a2713aSLionel Sambuc  l = @-42;
30*f4a2713aSLionel Sambuc  l = @42u;
31*f4a2713aSLionel Sambuc  l = @3.141592654f;
32*f4a2713aSLionel Sambuc  l = @__objc_yes;
33*f4a2713aSLionel Sambuc  l = @__objc_no;
34*f4a2713aSLionel Sambuc  l = @{ @"name":@666 };
35*f4a2713aSLionel Sambuc  l = @[ @"foo", @"bar" ];
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambuc#if __has_feature(objc_boxed_expressions)
38*f4a2713aSLionel Sambuc  // boxed expressions.
39*f4a2713aSLionel Sambuc  id b;
40*f4a2713aSLionel Sambuc  b = @('a');
41*f4a2713aSLionel Sambuc  b = @(42);
42*f4a2713aSLionel Sambuc  b = @(-42);
43*f4a2713aSLionel Sambuc  b = @(42u);
44*f4a2713aSLionel Sambuc  b = @(3.141592654f);
45*f4a2713aSLionel Sambuc  b = @(__objc_yes);
46*f4a2713aSLionel Sambuc  b = @(__objc_no);
47*f4a2713aSLionel Sambuc  b = @("hello");
48*f4a2713aSLionel Sambuc#else
49*f4a2713aSLionel Sambuc#error "boxed expressions not supported"
50*f4a2713aSLionel Sambuc#endif
51*f4a2713aSLionel Sambuc}
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc// CHECK: declare i8* @objc_msgSend(i8*, i8*, ...) [[NLB:#[0-9]+]]
54*f4a2713aSLionel Sambuc
55*f4a2713aSLionel Sambuc// CHECK: attributes [[NLB]] = { nonlazybind }
56