// RUN: %swift -disable-legacy-type-info -target i386-apple-ios7 %s -gnone -emit-ir | %FileCheck %s // RUN: %swift -disable-legacy-type-info -target armv7-apple-ios7 %s -gnone -emit-ir | %FileCheck %s // REQUIRES: CODEGENERATOR=X86 // REQUIRES: CODEGENERATOR=ARM // Check that we correctly lay out single-payload enums with a class reference // payload as nullable pointers. sil_stage canonical import Builtin class C {} sil_vtable C {} sil @$s11enum_32_bit1CCfD : $@convention(thin) (@owned C) -> () enum Foo { case A(C) case B } @objc protocol ClassExistential {} enum Bar { case A(ClassExistential) case B } enum Bas { case A(ClassExistential) case B(C) case Z } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(i32 %0) sil @foo : $@convention(thin) (@owned Foo) -> () { entry(%0 : $Foo): return undef : $() } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @bar(i32 %0) sil @bar : $@convention(thin) (@owned Bar) -> () { entry(%0 : $Bar): return undef : $() } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @bas(i32 %0) sil @bas : $@convention(thin) (@owned Bas) -> () { entry(%0 : $Bas): return undef : $() } // Force instantiation of the IR types sil @indirect_foo : $@convention(thin) (@in Foo) -> () sil @indirect_bar : $@convention(thin) (@in Bar) -> () sil @indirect_bas : $@convention(thin) (@in Bas) -> ()