mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This was discussed here: https://forums.swift.org/t/reorganize-swift-compiler-tests-for-c-objc-c-interop/34411 Resolves: [SR-12475](https://bugs.swift.org/browse/SR-12475)
13 lines
649 B
Swift
13 lines
649 B
Swift
// RUN: %target-swift-frontend -I %S/Inputs -enable-cxx-interop -emit-ir -o - %s | %FileCheck %s
|
|
|
|
import MemoryLayout
|
|
|
|
var v = PrivateMemberLayout()
|
|
// Check that even though the private member variable `a` is not imported, it is
|
|
// still taken into account for computing the layout of the class. In other
|
|
// words, we use Clang's, not Swift's view of the class to compute the memory
|
|
// layout.
|
|
// The important point here is that the second index is 1, not 0.
|
|
// CHECK: store i32 42, i32* getelementptr inbounds (%TSo19PrivateMemberLayoutV, %TSo19PrivateMemberLayoutV* @"$s4main1vSo19PrivateMemberLayoutVvp", i32 0, i32 1, i32 0), align 4
|
|
v.b = 42
|