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 {
52 // CHECK: call void @_Z11uiIsVisiblev
57 // Don't crash when mangling an enum whose semantic context
58 // is a class extension (which looks anonymous in the AST).
59 // The other tests here are just for coverage.
62 @property (assign) enum { T2x, T2y, T2z } axis;
65 @property (assign) enum { T2i, T2j, T2k } dimension;
67 @implementation Test2 {
69 enum { T2a, T2b, T2c } alt_axis;
72 template <class T> struct Test2Template { Test2Template() {} }; // must have a member that we'll instantiate and mangle
73 void test2(Test2 *t) {
74 Test2Template<decltype(t.axis)> t0;
75 Test2Template<decltype(t.dimension)> t1;
76 Test2Template<decltype(t->alt_axis)> t2;
80 void overload1(A<P>*) {}
81 // CHECK-LABEL: define{{.*}} void @_Z9overload1PU11objcproto1P1A
82 void overload1(const A<P>*) {}
83 // CHECK-LABEL: define{{.*}} void @_Z9overload1PKU11objcproto1P1A
84 void overload1(A<P>**) {}
85 // CHECK-LABEL: define{{.*}} void @_Z9overload1PPU11objcproto1P1A
86 void overload1(A<P>*const*) {}
87 // CHECK-LABEL: define{{.*}} void @_Z9overload1PKPU11objcproto1P1A
88 void overload1(A<P>***) {}
89 // CHECK-LABEL: define{{.*}} void @_Z9overload1PPPU11objcproto1P1A
90 void overload1(void (f)(A<P>*)) {}
91 // CHECK-LABEL: define{{.*}} void @_Z9overload1PFvPU11objcproto1P1AE
93 template<typename T> struct X { void f(); };
94 template<> void X<A*>::f() {}
95 // CHECK-LABEL: define{{.*}} void @_ZN1XIP1AE1fEv
96 template<> void X<A<P>*>::f() {}
97 // CHECK-LABEL: define{{.*}} void @_ZN1XIPU11objcproto1P1AE1fEv
99 // CHECK-LABEL: define{{.*}} void @_Z12kindof_test2PU8__kindof5Test2
100 void kindof_test2(__kindof Test2 *t2) { }
102 @interface Parameterized<T, U> : A
105 // CHECK-LABEL: define{{.*}} void @_Z19parameterized_test1P13ParameterizedIP1AP4TestE
106 void parameterized_test1(Parameterized<A *, Test *> *p) {}
108 // CHECK-LABEL: define{{.*}} void @_Z19parameterized_test2PU8__kindof13ParameterizedIP1AP4TestE
109 void parameterized_test2(__kindof Parameterized<A *, Test *> *p) {}
111 // CHECK-LABEL: define{{.*}} void @_Z19parameterized_test3P13Parameterized
112 void parameterized_test3(Parameterized *p) {}
114 // CHECK-LABEL: define {{.*}}void @_Z1fP11objc_object
115 void f(__attribute__((ns_consumed)) id) {}
116 // CHECK-LABEL: define {{.*}}void @_Z1fPFP11objc_objectS0_S0_E
117 void f(id (*fn)(__attribute__((ns_consumed)) id, id)) {}
118 // CHECK-LABEL: define {{.*}}void @_Z1fU13block_pointerFvP11objc_objectE
119 void f(void (^)(__attribute__((ns_consumed)) id)) {}