File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo) | %FileCheck %s
2+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -O) | %FileCheck %s
3+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -Osize) | %FileCheck %s
4+
5+ // REQUIRES: swift_in_compiler
6+ // REQUIRES: executable_test
7+ // REQUIRES: optimized_stdlib
8+ // REQUIRES: OS=macosx || OS=linux-gnu
9+
10+ public var global : AnyObject ? = nil
11+
12+ func test( anyObject: AnyObject ) {
13+ global = anyObject
14+ }
15+
16+ class MyClass { }
17+ class MyOtherClass { }
18+ protocol MyProto : AnyObject { }
19+ extension MyClass : MyProto { }
20+ extension MyOtherClass : MyProto { }
21+
22+ @main
23+ struct Main {
24+ static func main( ) {
25+ test ( anyObject: MyClass ( ) )
26+ test ( anyObject: MyOtherClass ( ) )
27+ test ( anyObject: MyClass ( ) as AnyObject )
28+ test ( anyObject: MyOtherClass ( ) as AnyObject )
29+ test ( anyObject: MyClass ( ) as MyProto )
30+ test ( anyObject: MyOtherClass ( ) as MyProto )
31+ print ( " OK! " )
32+ // CHECK: OK!
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments