File: compound-literal-property-access.m

package info (click to toggle)
llvm-toolchain-18 1%3A18.1.8-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,908,340 kB
  • sloc: cpp: 6,667,937; ansic: 1,440,452; asm: 883,619; python: 230,549; objc: 76,880; f90: 74,238; lisp: 35,989; pascal: 16,571; sh: 10,229; perl: 7,459; ml: 5,047; awk: 3,523; makefile: 2,987; javascript: 2,149; xml: 892; fortran: 649; cs: 573
file content (20 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s

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:%.*]], ptr [[CL]]
// CHECK: [[FOURTEEN:%.*]] = load <2 x float>, ptr [[CL]]