File: property-complex.m

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (61 lines) | stat: -rw-r--r-- 1,765 bytes parent folder | download | duplicates (24)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o %t %s

@interface I0 {
@public
  _Complex float iv0;
}

@property(assign) _Complex float p0;

-(_Complex float) im0;
-(void) setIm0: (_Complex float) a0;
@end

@implementation I0 
@dynamic p0;

-(id) init {
  self->iv0 = 5.0 + 2.0i;
  return self;
}

-(_Complex float) im0 {
  printf("im0: %.2f + %.2fi\n", __real iv0, __imag iv0);
  return iv0 + (.1 + .2i);
}
-(void) setIm0: (_Complex float) a0 {
  printf("setIm0: %.2f + %.2fi\n", __real a0, __imag a0);
  iv0 = a0 + (.3 + .4i);
}

-(_Complex float) p0 {
  printf("p0: %.2f + %.2fi\n", __real iv0, __imag iv0);
  return iv0 + (.5 + .6i);
}
-(void) setP0: (_Complex float) a0 {
  printf("setP0: %.2f + %.2fi\n", __real a0, __imag a0);
  iv0 = a0 + (.7 + .8i);
}
@end

void f0(I0 *a0) {
    float l0 = __real a0.im0;
    float l1 = __imag a0->iv0;
    _Complex float l2 = (a0.im0 = a0.im0);
    _Complex float l3 = a0->iv0;
    _Complex float l4 = (a0->iv0 = a0->iv0);
    _Complex float l5 = a0->iv0;
    _Complex float l6 = (a0.p0 = a0.p0);
    _Complex float l7 = a0->iv0;
    _Complex float l8 = [a0 im0];
    printf("l0: %.2f + %.2fi\n", __real l0, __imag l0);
    printf("l1: %.2f + %.2fi\n", __real l1, __imag l1);
    printf("l2: %.2f + %.2fi\n", __real l2, __imag l2);
    printf("l3: %.2f + %.2fi\n", __real l3, __imag l3);
    printf("l4: %.2f + %.2fi\n", __real l4, __imag l4);
    printf("l5: %.2f + %.2fi\n", __real l5, __imag l5);
    printf("l6: %.2f + %.2fi\n", __real l6, __imag l6);
    printf("l7: %.2f + %.2fi\n", __real l7, __imag l7);
    printf("l8: %.2f + %.2fi\n", __real l8, __imag l8);
}