Files
swift-mirror/test/IRGen/metadata.swift
Ben Langmuir cda65d1304 [test] Fix test/IRGen/metadata.swift to match the correct symbol
When this test was updated for new platforms it was accidentally changed
to match the _METACLASS_DATA symbol instead of the _DATA symbol. Fix
that and update the flags to match. This lets us remove the instance
start value 40 from the checks, so the test now matches the comment
saying it should be 8 or 16.

rdar://135453916
2024-09-11 11:09:11 -07:00

36 lines
1.5 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -enable-library-evolution -emit-module-path=%t/resilient_struct.swiftmodule -module-name=resilient_struct %S/../Inputs/resilient_struct.swift
// RUN: %target-swift-frontend -module-name A -I %t %S/Inputs/metadata2.swift -primary-file %s -emit-ir | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-os
import resilient_struct
enum Singleton {
case only
}
// CHECK: @"$s1A1GC14zeroSizedFieldAA9SingletonOvpWvd" = hidden constant i{{(64|32)}} 0
// Check that the instance start is after the header (at 8 or 16).
// CHECK-macosx: @_DATA__TtC1A1G = internal constant {{.*}} { i32 {{(128|192)}}, i32 {{(16|8)}}
// CHECK-ios: @_DATA__TtC1A1G = internal constant {{.*}} { i32 {{(128|192)}}, i32 {{(16|8)}}
// CHECK-watchos: @_DATA__TtC1A1G = internal constant {{.*}} { i32 {{(128|192)}}, i32 {{(16|8)}}
// CHECK-tvos: @_DATA__TtC1A1G = internal constant {{.*}} { i32 {{(128|192)}}, i32 {{(16|8)}}
class G {
var zeroSizedField = Singleton.only
var r = ResilientInt(i:1)
}
// CHECK-LABEL: define {{.*}}swiftcc %swift.metadata_response @"$s1A12MyControllerCMr"(ptr %0, ptr %1, ptr %2)
// CHECK-NOT: ret
// CHECK: call swiftcc %swift.metadata_response @"$s1A17InternalContainerVMa"(
// CHECK: ret
class MyController {
var c = InternalContainer(item: [])
var c2 = InternalContainer2(item: [])
var e = InternalSingletonEnum()
var e2 = InternalSingletonEnum2()
func update(_ n: InternalContainer) {
c = n
}
}