diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2015-04-06 16:56:39 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2015-04-06 16:56:39 +0000 |
commit | 38bc66da56b5700fa307621e725275969a372b09 (patch) | |
tree | 0d1ee4aa2ae5b11de0be2318dc20e3bcd84f5cce /test/CodeGenObjC/compound-literal-property-access.m | |
parent | 412865c8ea9f94a487d9887360b8adb6032e6a80 (diff) | |
download | clang-38bc66da56b5700fa307621e725275969a372b09.tar.gz |
[Objective-C patch] Patch to fix a crash in IRGen because
of incorrect AST when a compound literal of Objective-C
property access is used to initialize a vertor of floats.
rdar://20407999
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC/compound-literal-property-access.m')
-rw-r--r-- | test/CodeGenObjC/compound-literal-property-access.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenObjC/compound-literal-property-access.m b/test/CodeGenObjC/compound-literal-property-access.m new file mode 100644 index 0000000000..bc1bd78e0c --- /dev/null +++ b/test/CodeGenObjC/compound-literal-property-access.m @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s +// rdar://20407999 + +typedef __attribute__((__ext_vector_type__(2))) float vector_float2; + +@interface GPAgent2D +@property (nonatomic, assign) vector_float2 position; +@end + +@interface GPGoal @end + +@implementation GPGoal +-(void)getForce { + GPAgent2D* targetAgent; + (vector_float2){targetAgent.position.x, targetAgent.position.y}; +} +@end + +// CHECK: [[CL:%.*]] = alloca <2 x float>, align 8 +// CHECK: store <2 x float> [[VECINIT:%.*]], <2 x float>* [[CL]] +// CHECK: [[FOURTEEN:%.*]] = load <2 x float>, <2 x float>* [[CL]] |