summaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm
blob: 7b005a2086d0233c9b6226063ca7513233baaef1 (plain)
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
//===-- main.mm -----------------------------------------------*- ObjC -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#import <Foundation/Foundation.h>

class MyCPPClass {
public:
    MyCPPClass(float f) : f(f) {}
    
    float setF(float f) {
      float oldf = this->f;
      this->f = f;
      return oldf;
    }
    
    float getF() {
      return f;
    }
private:
    float f;
};

typedef MyCPPClass MyClass;

@interface MyObjCClass : NSObject {
  int x;
}
- (id)init;
- (int)read;
@end

@implementation MyObjCClass {
  int y;
}
- (id)init {
  if (self = [super init]) {
    self->x = 12;
    self->y = 24;
  }
  return self;
}
- (int)read {
  return self->x + self->y;
}
@end

int main (int argc, const char * argv[])
{
  MyClass my_cpp(3.1415);
  return 0; // break here
}