1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -std=c++11 -emit-llvm -fblocks -o - | FileCheck %s
3 // CHECK: @"_ZZ11+[A shared]E1a" = internal global
4 // CHECK: @"_ZZ11-[A(Foo) f]E1a" = internal global
5 // CHECK: v56@0:8i16i20i24i28i32i36i40i44^i48
23 @implementation A(Foo)
25 // FIXME: Add a member function to s and make sure that it's mangled correctly.
37 - (void) process: (int)r3 :(int)r4 :(int)r5 :(int)r6 :(int)r7 :(int)r8 :(int)r9 :(int)r10 :(int &)i;
41 - (void) process: (int)r3 :(int)r4 :(int)r5 :(int)r6 :(int)r7 :(int)r8 :(int)r9 :(int)r10 :(int &)i {
53 // CHECK: call void @_Z11uiIsVisiblev
60 // Don't crash when mangling an enum whose semantic context
61 // is a class extension (which looks anonymous in the AST).
62 // The other tests here are just for coverage.
65 @property (assign) enum { T2x, T2y, T2z } axis;
68 @property (assign) enum { T2i, T2j, T2k } dimension;
70 @implementation Test2 {
72 enum { T2a, T2b, T2c } alt_axis;
75 template <class T> struct Test2Template { Test2Template() {} }; // must have a member that we'll instantiate and mangle
76 void test2(Test2 *t) {
77 Test2Template<decltype(t.axis)> t0;
78 Test2Template<decltype(t.dimension)> t1;
79 Test2Template<decltype(t->alt_axis)> t2;
83 void overload1(A<P>*) {}
84 // CHECK-LABEL: define void @_Z9overload1PU11objcproto1P1A
85 void overload1(const A<P>*) {}
86 // CHECK-LABEL: define void @_Z9overload1PKU11objcproto1P1A
87 void overload1(A<P>**) {}
88 // CHECK-LABEL: define void @_Z9overload1PPU11objcproto1P1A
89 void overload1(A<P>*const*) {}
90 // CHECK-LABEL: define void @_Z9overload1PKPU11objcproto1P1A
91 void overload1(A<P>***) {}
92 // CHECK-LABEL: define void @_Z9overload1PPPU11objcproto1P1A
93 void overload1(void (f)(A<P>*)) {}
94 // CHECK-LABEL: define void @_Z9overload1PFvPU11objcproto1P1AE
96 template<typename T> struct X { void f(); };
97 template<> void X<A*>::f() {}
98 // CHECK-LABEL: define void @_ZN1XIP1AE1fEv
99 template<> void X<A<P>*>::f() {}
100 // CHECK-LABEL: define void @_ZN1XIPU11objcproto1P1AE1fEv
102 // CHECK-LABEL: define void @_Z12kindof_test2PU8__kindof5Test2
103 void kindof_test2(__kindof Test2 *t2) { }
105 @interface Parameterized<T, U> : A
108 // CHECK-LABEL: define void @_Z19parameterized_test1P13ParameterizedIP1AP4TestE
109 void parameterized_test1(Parameterized<A *, Test *> *p) {}
111 // CHECK-LABEL: define void @_Z19parameterized_test2PU8__kindof13ParameterizedIP1AP4TestE
112 void parameterized_test2(__kindof Parameterized<A *, Test *> *p) {}
114 // CHECK-LABEL: define void @_Z19parameterized_test3P13Parameterized
115 void parameterized_test3(Parameterized *p) {}
117 // CHECK-LABEL: define {{.*}}void @_Z1fP11objc_object
118 void f(__attribute__((ns_consumed)) id) {}
119 // CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectS0_S0_E
120 void f(id (*fn)(__attribute__((ns_consumed)) id, id)) {}
121 // CHECK-LABEL: define {{.*}}void @_Z1fU13block_pointerFvP11objc_objectE
122 void f(void (^)(__attribute__((ns_consumed)) id)) {}