Files
swift-mirror/test/Interop/Cxx/class/memory-layout-silgen.swift
Finagolfin 15e1c73969 [android][test] Enable several C++ Interop and other tests
Also, fix lit.cfg for running the test suite natively in Android and mark one
SILOptimizer executable_test as such.
2024-07-20 17:56:51 +05:30

13 lines
599 B
Swift

// RUN: %target-swiftxx-frontend -I %S/Inputs -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, ptr getelementptr inbounds (%TSo19PrivateMemberLayoutV, ptr @"$s4main1vSo19PrivateMemberLayoutVvp", i32 0, i32 1), align 4
v.b = 42