|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-swift-frontend %s -typecheck -module-name Properties -clang-header-expose-public-decls -emit-clang-header-path %t/properties.h |
| 3 | +// RUN: %FileCheck %s < %t/properties.h |
| 4 | + |
| 5 | +// RUN: %check-interop-cxx-header-in-clang(%t/properties.h) |
| 6 | + |
| 7 | +public struct IsHasProperties { |
| 8 | + public var isEmpty: Bool { return true } |
| 9 | + |
| 10 | + public let hasFlavor: Bool = false |
| 11 | + |
| 12 | + public var isSolid: Bool = true |
| 13 | + |
| 14 | + public var flag: Bool = false |
| 15 | + |
| 16 | + public let has: Bool = true |
| 17 | + |
| 18 | + public let isOption: Int = 0 |
| 19 | + |
| 20 | + // make it a large struct for easier ABI matching. |
| 21 | + let x1, x2, x3, x4, x5, x6: Int |
| 22 | +} |
| 23 | + |
| 24 | +// CHECK: class IsHasProperties |
| 25 | + |
| 26 | +// CHECK: inline bool isEmpty() const; |
| 27 | +// CHECK-NEXT: inline bool hasFlavor() const; |
| 28 | +// CHECK-NEXT: inline bool isSolid() const; |
| 29 | +// CHECK-NEXT: inline void setIsSolid(bool value); |
| 30 | +// CHECK-NEXT: inline bool getFlag() const; |
| 31 | +// CHECK-NEXT: inline void setFlag(bool value); |
| 32 | +// CHECK-NEXT: inline bool getHas() const; |
| 33 | +// CHECK-NEXT: inline swift::Int getIsOption() const; |
| 34 | + |
| 35 | +// CHECK: inline bool IsHasProperties::isEmpty() const { |
| 36 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V7isEmptySbvg(_getOpaquePointer()); |
| 37 | +// CHECK-NEXT: } |
| 38 | +// CHECK-NEXT: inline bool IsHasProperties::hasFlavor() const { |
| 39 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V9hasFlavorSbvg(_getOpaquePointer()); |
| 40 | +// CHECK-NEXT: } |
| 41 | +// CHECK-NEXT: inline bool IsHasProperties::isSolid() const { |
| 42 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V7isSolidSbvg(_getOpaquePointer()); |
| 43 | +// CHECK-NEXT: } |
| 44 | +// CHECK-NEXT: inline void IsHasProperties::setIsSolid(bool value) { |
| 45 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V7isSolidSbvs(value, _getOpaquePointer()); |
| 46 | +// CHECK-NEXT: } |
| 47 | +// CHECK-NEXT: inline bool IsHasProperties::getFlag() const { |
| 48 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V4flagSbvg(_getOpaquePointer()); |
| 49 | +// CHECK-NEXT: } |
| 50 | +// CHECK-NEXT: inline void IsHasProperties::setFlag(bool value) { |
| 51 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V4flagSbvs(value, _getOpaquePointer()); |
| 52 | +// CHECK-NEXT: } |
| 53 | +// CHECK-NEXT: inline bool IsHasProperties::getHas() const { |
| 54 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V3hasSbvg(_getOpaquePointer()); |
| 55 | +// CHECK-NEXT: } |
| 56 | +// CHECK-NEXT: inline swift::Int IsHasProperties::getIsOption() const { |
| 57 | +// CHECK-NEXT: return _impl::$s10Properties05IsHasA0V8isOptionSivg(_getOpaquePointer()); |
| 58 | +// CHECK-NEXT: } |
0 commit comments