Files
swift-mirror/test/SILGen/required_init.swift
Dmitri Hrybenko 3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00

27 lines
921 B
Swift

// RUN: %target-swift-frontend -emit-silgen %s | FileCheck %s
func subclassFloatLiteral() -> Bar {
let x: Bar = 1.0
return x
}
// CHECK-LABEL: sil hidden @_TF13required_init20subclassFloatLiteralFT_CS_3Bar
// CHECK: class_method {{%.*}} : $@thick Foo.Type, #Foo.init!allocator.1
class Foo: FloatLiteralConvertible {
required init(floatLiteral: Float) { }
func identify() { println("Foo") }
}
class Bar: Foo {
override func identify() { println("Bar") }
}
// CHECK-LABEL: sil_vtable Foo {
// CHECK: #Foo.init!allocator.1: _TFC13required_init3FooCfMS0_FT12floatLiteralSf_S0_
// CHECK: #Foo.init!initializer.1: _TFC13required_init3FoocfMS0_FT12floatLiteralSf_S0_
// CHECK-LABEL: sil_vtable Bar {
// CHECK: #Foo.init!allocator.1: _TFC13required_init3BarCfMS0_FT12floatLiteralSf_S0_
// CHECK: #Foo.init!initializer.1: _TFC13required_init3BarcfMS0_FT12floatLiteralSf_S0_