John McCall | 924046f | 2013-04-10 06:08:21 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -std=c++11 -emit-llvm -o - | FileCheck %s |
Anders Carlsson | bf569460 | 2009-12-10 03:14:39 +0000 | [diff] [blame] | 2 | |
| 3 | // CHECK: @"_ZZ11+[A shared]E1a" = internal global |
| 4 | // CHECK: @"_ZZ11-[A(Foo) f]E1a" = internal global |
Fariborz Jahanian | 9ffd706 | 2010-04-13 23:45:47 +0000 | [diff] [blame] | 5 | // CHECK: v56@0:8i16i20i24i28i32i36i40i44^i48 |
Anders Carlsson | bf569460 | 2009-12-10 03:14:39 +0000 | [diff] [blame] | 6 | |
| 7 | @interface A |
| 8 | @end |
| 9 | |
| 10 | @implementation A |
| 11 | |
| 12 | + (A *)shared { |
| 13 | static A* a; |
| 14 | |
| 15 | return a; |
| 16 | } |
| 17 | |
| 18 | @end |
| 19 | |
| 20 | @interface A(Foo) |
| 21 | @end |
| 22 | |
| 23 | @implementation A(Foo) |
| 24 | - (int)f { |
| 25 | // FIXME: Add a member function to s and make sure that it's mangled correctly. |
| 26 | struct s { |
| 27 | }; |
| 28 | |
| 29 | static s a; |
| 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | @end |
Fariborz Jahanian | 9ffd706 | 2010-04-13 23:45:47 +0000 | [diff] [blame] | 34 | |
| 35 | // PR6468 |
| 36 | @interface Test |
| 37 | - (void) process: (int)r3 :(int)r4 :(int)r5 :(int)r6 :(int)r7 :(int)r8 :(int)r9 :(int)r10 :(int &)i; |
| 38 | @end |
| 39 | |
| 40 | @implementation Test |
| 41 | - (void) process: (int)r3 :(int)r4 :(int)r5 :(int)r6 :(int)r7 :(int)r8 :(int)r9 :(int)r10 :(int &)i { |
| 42 | } |
| 43 | @end |
| 44 | |
Fariborz Jahanian | 624b299 | 2011-06-09 19:25:01 +0000 | [diff] [blame] | 45 | // rdar://9566314 |
| 46 | @interface NX |
| 47 | - (void)Meth; |
| 48 | @end |
| 49 | |
| 50 | @implementation NX |
| 51 | - (void)Meth { |
| 52 | void uiIsVisible(); |
| 53 | // CHECK: call void @_Z11uiIsVisiblev |
| 54 | uiIsVisible(); |
| 55 | } |
| 56 | @end |
John McCall | 924046f | 2013-04-10 06:08:21 +0000 | [diff] [blame^] | 57 | |
| 58 | // rdar://13434937 |
| 59 | // |
| 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. |
| 63 | @interface Test2 @end |
| 64 | @interface Test2 () |
| 65 | @property (assign) enum { T2x, T2y, T2z } axis; |
| 66 | @end |
| 67 | @interface Test2 (a) |
| 68 | @property (assign) enum { T2i, T2j, T2k } dimension; |
| 69 | @end |
| 70 | @implementation Test2 { |
| 71 | @public |
| 72 | enum { T2a, T2b, T2c } alt_axis; |
| 73 | } |
| 74 | @end |
| 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; |
| 80 | } |