Fariborz Jahanian | 6fb9439 | 2010-05-07 00:28:49 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | // CHECK: v17@0:8{vector<float, float, float>=}16 |
| 4 | // CHECK: {vector<float, float, float>=} |
John McCall | 532ec7b | 2010-05-17 23:56:34 +0000 | [diff] [blame] | 5 | // CHECK: v24@0:816 |
Fariborz Jahanian | 6fb9439 | 2010-05-07 00:28:49 +0000 | [diff] [blame] | 6 | |
| 7 | template <typename T1, typename T2, typename T3> struct vector { |
Douglas Gregor | 68dd3ee | 2010-05-20 02:24:22 +0000 | [diff] [blame] | 8 | vector(); |
| 9 | vector(T1,T2,T3); |
Fariborz Jahanian | 6fb9439 | 2010-05-07 00:28:49 +0000 | [diff] [blame] | 10 | }; |
| 11 | |
| 12 | typedef vector< float, float, float > vector3f; |
| 13 | |
| 14 | @interface SceneNode |
| 15 | { |
| 16 | vector3f position; |
| 17 | } |
| 18 | |
| 19 | @property (assign, nonatomic) vector3f position; |
| 20 | |
| 21 | @end |
| 22 | |
| 23 | @interface MyOpenGLView |
| 24 | { |
| 25 | @public |
| 26 | vector3f position; |
| 27 | } |
| 28 | @property vector3f position; |
| 29 | @end |
| 30 | |
| 31 | @implementation MyOpenGLView |
| 32 | |
| 33 | @synthesize position; |
| 34 | |
| 35 | -(void)awakeFromNib { |
| 36 | SceneNode *sn; |
| 37 | vector3f VF3(1.0, 1.0, 1.0); |
| 38 | [sn setPosition:VF3]; |
| 39 | } |
| 40 | @end |
John McCall | 532ec7b | 2010-05-17 23:56:34 +0000 | [diff] [blame] | 41 | |
| 42 | |
| 43 | class Int3 { int x, y, z; }; |
| 44 | |
| 45 | // Enforce @encoding for member pointers. |
| 46 | @interface MemPtr {} |
| 47 | - (void) foo: (int (Int3::*)) member; |
| 48 | @end |
| 49 | @implementation MemPtr |
| 50 | - (void) foo: (int (Int3::*)) member { |
| 51 | } |
| 52 | @end |
Fariborz Jahanian | e6012c7 | 2010-10-07 21:25:25 +0000 | [diff] [blame] | 53 | |
| 54 | // rdar: // 8519948 |
| 55 | typedef float HGVec4f __attribute__ ((vector_size(16))); |
| 56 | |
| 57 | @interface RedBalloonHGXFormWrapper { |
| 58 | HGVec4f m_Transform[4]; |
| 59 | } |
| 60 | @end |
| 61 | |
| 62 | @implementation RedBalloonHGXFormWrapper |
| 63 | @end |
| 64 | |