summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/ms-property.cpp
blob: afeb5f042889e1b9c73b4685fd93ac73cebe93be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1 -emit-llvm -triple=x86_64-pc-win32 -fms-compatibility %s -o - | FileCheck %s

class Test1 {
private:
  int x_;

public:
  Test1(int x) : x_(x) {}
  __declspec(property(get = get_x)) int X;
  int get_x() const { return x_; }
  static Test1 *GetTest1() { return new Test1(10); }
};

// CHECK-LABEL: main
int main(int argc, char **argv) {
  // CHECK: [[CALL:%.+]] = call %class.Test1* @"\01?GetTest1@Test1@@SAPEAV1@XZ"()
  // CHECK-NEXT: call i32 @"\01?get_x@Test1@@QEBAHXZ"(%class.Test1* [[CALL]])
  return Test1::GetTest1()->X;
}
OpenPOWER on IntegriCloud