Files
swift-mirror/test/IRGen/objc_class_empty_fields.swift
Yuta Saito 5f684ec75f [wasm][test] Add objc_codegen feature to exclude enable-objc-interop tests
Clang does not accept `-x objective-c` with WebAssembly target and it
crashes with "Objective-C support is unimplemented for object file
format" for now. `-enable-objc-interop` can work without the objc
runtime support (which is indicated by `objc_interop` feature), so this
adds a new `objc_codegen` feature to require Objective-C support only
at compile-time.
2023-10-11 00:51:17 +00:00

30 lines
768 B
Swift

// RUN: %target-swift-frontend -primary-file %s -enable-objc-interop -emit-ir | %FileCheck %s --check-prefix=CHECK-%target-ptrsize
// REQUIRES: objc_codegen
// https://github.com/apple/swift/issues/43667
// CHECK-64: @_DATA__TtC23objc_class_empty_fields14OneEnumWrapper = internal constant { {{.*}} } { i32 {{[0-9]+}}, i32 16, i32 24
// CHECK-32: @_DATA__TtC23objc_class_empty_fields14OneEnumWrapper = internal constant { {{.*}} } { i32 {{[0-9]+}}, i32 8, i32 12
enum OneCaseEnum {
case X
}
class OneEnumWrapper {
var myVar: OneCaseEnum
var whyVar: OneCaseEnum
var x: Int
init(v: OneCaseEnum)
{
self.myVar = v
self.whyVar = v
self.x = 0
}
}
let e = OneCaseEnum.X
print(e)
let x = OneEnumWrapper(v: e)
print(x)