mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Migrate Serialization tests to swift 4
This commit is contained in:
@@ -30,7 +30,7 @@ public func different<T : Equatable>(a: T, b: T) -> Bool {
|
||||
return a != b
|
||||
}
|
||||
|
||||
public func different2<T where T : Equatable>(a: T, b: T) -> Bool {
|
||||
public func different2<T>(a: T, b: T) -> Bool where T : Equatable {
|
||||
return a != b
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ public protocol Wrapped {
|
||||
|
||||
public func differentWrapped<
|
||||
T : Wrapped, U : Wrapped
|
||||
where
|
||||
T.Value == U.Value
|
||||
>(a: T, b: U) -> Bool {
|
||||
>(a: T, b: U) -> Bool
|
||||
where T.Value == U.Value
|
||||
{
|
||||
return a.getValue() != b.getValue()
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public func testNoReturnAttrPoly<T>(x: T) -> Never { exit() }
|
||||
@_silgen_name("primitive") public func primitive()
|
||||
|
||||
public protocol EqualOperator {
|
||||
func ==(x: Self, y: Self) -> Bool
|
||||
static func ==(x: Self, y: Self) -> Bool
|
||||
}
|
||||
|
||||
public func throws1() throws {}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
func doSomething()
|
||||
}
|
||||
|
||||
@objc public class ObjCClass {
|
||||
@objc @objcMembers public class ObjCClass {
|
||||
public dynamic class func classMethod() {}
|
||||
public dynamic func implicitlyObjC() {}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@IBAction public func performAction(_: AnyObject?) {}
|
||||
}
|
||||
|
||||
public class NonObjCClass : ObjCProto {
|
||||
@objcMembers public class NonObjCClass : ObjCProto {
|
||||
public dynamic func doSomething() {}
|
||||
|
||||
dynamic public func objcMethod() {}
|
||||
|
||||
@@ -89,8 +89,8 @@ public struct ResettableWrapper<T : Resettable> : AnotherAssociated {
|
||||
|
||||
public func cacheViaWrappers<
|
||||
T : HasAssociatedType, U : AnotherAssociated
|
||||
where T.ComputableType == U.ResettableType
|
||||
>(_ computable : T, _ resettable : U) {}
|
||||
>(_ computable : T, _ resettable : U)
|
||||
where T.ComputableType == U.ResettableType {}
|
||||
|
||||
|
||||
// Subscripts
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
public class C {}
|
||||
|
||||
@_transparent public func foo(x x: Builtin.Int1, y: Builtin.Int1) -> Builtin.Int1 {
|
||||
@_transparent public func foo(x: Builtin.Int1, y: Builtin.Int1) -> Builtin.Int1 {
|
||||
return Builtin.cmp_eq_Int1(x, y)
|
||||
}
|
||||
|
||||
@_transparent public func destroy_obj(x x: Builtin.RawPointer) {
|
||||
return Builtin.destroy(Builtin.NativeObject, x)
|
||||
@_transparent public func destroy_obj(x: Builtin.RawPointer) {
|
||||
return Builtin.destroy(Builtin.NativeObject.self, x)
|
||||
}
|
||||
|
||||
@_transparent public func assign_tuple(x x: (Builtin.Int64, Builtin.NativeObject),
|
||||
@_transparent public func assign_tuple(x: (Builtin.Int64, Builtin.NativeObject),
|
||||
y: Builtin.RawPointer) {
|
||||
Builtin.assign(x, y)
|
||||
}
|
||||
|
||||
@_transparent public func class_to_native_object(c c: C) -> Builtin.NativeObject {
|
||||
@_transparent public func class_to_native_object(c: C) -> Builtin.NativeObject {
|
||||
return Builtin.castToNativeObject(c)
|
||||
}
|
||||
|
||||
@_transparent public func class_from_native_object(p p: Builtin.NativeObject) -> C {
|
||||
@_transparent public func class_from_native_object(p: Builtin.NativeObject) -> C {
|
||||
return Builtin.castFromNativeObject(p)
|
||||
}
|
||||
|
||||
@_transparent public func class_to_raw_pointer(c c: C) -> Builtin.RawPointer {
|
||||
@_transparent public func class_to_raw_pointer(c: C) -> Builtin.RawPointer {
|
||||
return Builtin.bridgeToRawPointer(c)
|
||||
}
|
||||
|
||||
@_transparent public func class_from_raw_pointer(p p: Builtin.RawPointer) -> C {
|
||||
@_transparent public func class_from_raw_pointer(p: Builtin.RawPointer) -> C {
|
||||
return Builtin.bridgeFromRawPointer(p)
|
||||
}
|
||||
|
||||
@_transparent public func gep32(p p: Builtin.RawPointer, i: Builtin.Int32) -> Builtin.RawPointer {
|
||||
@_transparent public func gep32(p: Builtin.RawPointer, i: Builtin.Int32) -> Builtin.RawPointer {
|
||||
return Builtin.gepRaw_Int32(p, i)
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ public struct BasStruct : Bassable {
|
||||
}
|
||||
|
||||
|
||||
prefix operator ~~~ {}
|
||||
prefix operator ~~~
|
||||
|
||||
public protocol _CyclicAssociated {
|
||||
associatedtype Assoc = CyclicImpl
|
||||
}
|
||||
|
||||
public protocol CyclicAssociated : _CyclicAssociated {
|
||||
prefix func ~~~(_: Self.Type)
|
||||
static prefix func ~~~(_: Self.Type)
|
||||
}
|
||||
|
||||
prefix public func ~~~ <T: _CyclicAssociated>(_: T.Type) {}
|
||||
|
||||
@@ -3,8 +3,8 @@ public struct SpecialInt {
|
||||
public init() {}
|
||||
}
|
||||
|
||||
prefix operator +++ {}
|
||||
postfix operator +++ {}
|
||||
prefix operator +++
|
||||
postfix operator +++
|
||||
|
||||
prefix public func +++(base: inout SpecialInt) {
|
||||
base.value += 2
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -module-name def_class -o %t/stage1.swiftmodule %S/Inputs/def_class.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -parse-as-library -o %t/def_class.swiftmodule %t/stage1.swiftmodule -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-sil -sil-debug-serialization -I %t %S/class.swift -swift-version 3 | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: %target-swift-frontend -emit-module -module-name def_class -o %t/stage1.swiftmodule %S/Inputs/def_class.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop
|
||||
// RUN: %target-swift-frontend -emit-module -parse-as-library -o %t/def_class.swiftmodule %t/stage1.swiftmodule
|
||||
// RUN: %target-swift-frontend -emit-sil -sil-debug-serialization -I %t %S/class.swift | %FileCheck %s -check-prefix=SIL
|
||||
|
||||
// SIL-LABEL: sil public_external [transparent] [serialized] [canonical] @$SSi1poiyS2i_SitFZ : $@convention(method) (Int, Int, @thin Int.Type) -> Int
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-object -emit-module -o %t %S/Inputs/def_class.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-object -emit-module -o %t %S/Inputs/def_class.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop
|
||||
// RUN: llvm-bcanalyzer %t/def_class.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-sil -sil-debug-serialization -I %t %s -swift-version 3 | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: %target-swift-frontend -emit-sil -sil-debug-serialization -I %t %s | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: echo "import def_class; struct A : ClassProto {}" | not %target-swift-frontend -typecheck -I %t - 2>&1 | %FileCheck %s -check-prefix=CHECK-STRUCT
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
@@ -48,8 +48,8 @@ p.second = 5.0
|
||||
|
||||
struct Int {}
|
||||
|
||||
var gc = GenericCtor<Int>()
|
||||
gc.doSomething()
|
||||
var gc = GenericCtor<Int>(42)
|
||||
gc.doSomething(42)
|
||||
|
||||
|
||||
a = StillEmpty()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift
|
||||
// RUN: llvm-bcanalyzer %t/def_func.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -module-name function -emit-silgen -I %t %s -swift-version 3 | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: %target-swift-frontend -module-name function -emit-silgen -I %t %s | %FileCheck %s -check-prefix=SIL
|
||||
|
||||
// CHECK-NOT: FALL_BACK_TO_TRANSLATION_UNIT
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/has_generic_witness.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/has_generic_witness.swift
|
||||
// RUN: llvm-bcanalyzer %t/has_generic_witness.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-ir -I %t %s -o /dev/null -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-ir -I %t %s -o /dev/null
|
||||
|
||||
// We have to perform IRGen to actually check that the generic substitutions
|
||||
// are being used.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift -module-name new_module -swift-version 3
|
||||
// RUN: not %target-swift-frontend %s -typecheck -I %t -show-diagnostics-after-fatal -swift-version 3 2>&1 | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift -module-name new_module
|
||||
// RUN: not %target-swift-frontend %s -typecheck -I %t -show-diagnostics-after-fatal 2>&1 | %FileCheck %s
|
||||
|
||||
import swift // CHECK: error: {{cannot load module 'Swift' as 'swift'|no such module 'swift'}}
|
||||
import NEW_MODULE // CHECK: error: {{cannot load module 'new_module' as 'NEW_MODULE'|no such module 'NEW_MODULE'}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend %s -typecheck -verify -show-diagnostics-after-fatal -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift -module-name new_module -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -verify -show-diagnostics-after-fatal
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_func.swift -module-name new_module
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
|
||||
// These errors should happen before we've built the module to import.
|
||||
import new_module // expected-error{{no such module 'new_module'}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_objc.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_objc.swift -disable-objc-attr-requires-foundation-module -enable-objc-interop
|
||||
// RUN: llvm-bcanalyzer %t/def_objc.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -module-name objc -emit-silgen -I %t %s -o - -swift-version 3 | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: %target-swift-frontend -module-name objc -emit-silgen -I %t %s -o - | %FileCheck %s -check-prefix=SIL
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %empty-directory(%t/secret)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/secret %S/Inputs/struct_with_operators.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/secret %S/Inputs/struct_with_operators.swift
|
||||
// RUN: %empty-directory(%t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias
|
||||
|
||||
// RUN: cd %t/secret && %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I . -F ../Frameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -swift-version 3
|
||||
// RUN: cd %t/secret && %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I . -F ../Frameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -Xcc -ivfsoverlay -Xcc %S/../Inputs/unextended-module-overlay.yaml -Xcc -DDUMMY
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
|
||||
// Check the actual serialized search paths.
|
||||
// RUN: llvm-bcanalyzer -dump %t/has_xref.swiftmodule > %t/has_xref.swiftmodule.txt
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %empty-directory(%t/secret)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/secret %S/Inputs/struct_with_operators.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/secret %S/Inputs/struct_with_operators.swift
|
||||
// RUN: %empty-directory(%t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/Frameworks/has_alias.framework/Modules/has_alias.swiftmodule/%target-swiftmodule-name %S/Inputs/alias.swift -module-name has_alias
|
||||
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -verify -show-diagnostics-after-fatal -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -verify -show-diagnostics-after-fatal
|
||||
|
||||
// Try again, treating has_xref as a main file to force serialization to occur.
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks %S/Inputs/has_xref.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks %S/Inputs/has_xref.swift
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift -serialize-debugging-options -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift -serialize-debugging-options
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift -application-extension -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift -application-extension
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
|
||||
// Make sure we don't end up with duplicate search paths.
|
||||
// RUN: %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options -swift-version 3
|
||||
// RUN: %target-swiftc_driver -emit-module -o %t/has_xref.swiftmodule -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -parse-as-library %S/Inputs/has_xref.swift %S/../Inputs/empty.swift -Xfrontend -serialize-debugging-options
|
||||
// RUN: %target-swift-frontend %s -typecheck -I %t
|
||||
// RUN: llvm-bcanalyzer -dump %t/has_xref.swiftmodule | %FileCheck %s
|
||||
|
||||
// RUN: %target-swift-frontend %s -emit-module -o %t/main.swiftmodule -I %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks -swift-version 3
|
||||
// RUN: %target-swift-frontend %s -emit-module -o %t/main.swiftmodule -I %t -I %t/secret -F %t/Frameworks -Fsystem %t/SystemFrameworks
|
||||
// RUN: llvm-bcanalyzer -dump %t/main.swiftmodule | %FileCheck %s
|
||||
|
||||
import has_xref // expected-error {{missing required modules: 'has_alias', 'struct_with_operators'}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_struct.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_struct.swift
|
||||
// RUN: llvm-bcanalyzer %t/def_struct.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t %s -o /dev/null -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t %s -o /dev/null
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
@@ -41,8 +41,8 @@ var p = Pair(a: 1, b: 2.5)
|
||||
p.first = 2
|
||||
p.second = 5.0
|
||||
|
||||
var gc = GenericCtor<Int>()
|
||||
gc.doSomething()
|
||||
var gc = GenericCtor<Int>(42)
|
||||
gc.doSomething(42)
|
||||
|
||||
var wrappedTypeVar : ComputableWrapper<AnotherIntWrapper>.ComputableType
|
||||
wrappedTypeVar = intWrapper2
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -parse-stdlib -o %t %S/Inputs/def_transparent_std.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -parse-stdlib -o %t %S/Inputs/def_transparent_std.swift
|
||||
// RUN: llvm-bcanalyzer %t/def_transparent_std.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-sil -sil-debug-serialization -parse-stdlib -I %t %s -swift-version 3 | %FileCheck %s -check-prefix=SIL
|
||||
// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-sil -sil-debug-serialization -parse-stdlib -I %t %s | %FileCheck %s -check-prefix=SIL
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-build-swift -module-name alias -emit-module -o %t %S/Inputs/alias.swift -swift-version 3
|
||||
// RUN: %target-build-swift -I %t %s -module-name typealias -emit-module-path %t/typealias.swiftmodule -o %t/typealias.o -swift-version 3
|
||||
// RUN: %target-build-swift -module-name alias -emit-module -o %t %S/Inputs/alias.swift
|
||||
// RUN: %target-build-swift -I %t %s -module-name typealias -emit-module-path %t/typealias.swiftmodule -o %t/typealias.o
|
||||
// RUN: llvm-bcanalyzer %t/alias.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-build-swift -I %t %s -swift-version 3 -o %t/a.out
|
||||
// RUN: %target-build-swift -I %t %s -o %t/a.out
|
||||
// RUN: %target-run %t/a.out | %FileCheck -check-prefix=OUTPUT %s
|
||||
// REQUIRES: executable_test
|
||||
|
||||
@@ -40,8 +40,8 @@ print("\(monadic(i))\n", terminator: "")
|
||||
|
||||
// OUTPUT: -42
|
||||
|
||||
func subtract(x: MyInt64, y: MyInt64) -> MyInt64 {
|
||||
return x - y
|
||||
func subtract(_ t : (x: MyInt64, y: MyInt64)) -> MyInt64 {
|
||||
return t.x - t.y
|
||||
}
|
||||
var dyadic : TwoIntFunction = subtract
|
||||
print("\(dyadic((named.b, i))) \(dyadic(both))\n", terminator: "")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/struct_with_operators.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/alias.swift -module-name has_alias -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t %S/Inputs/has_xref.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/struct_with_operators.swift
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/alias.swift -module-name has_alias
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t %S/Inputs/has_xref.swift
|
||||
// RUN: llvm-bcanalyzer %t/has_xref.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t -primary-file %s %S/Inputs/xref-multi-file-other.swift -module-name main -swift-version 3 > /dev/null
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t -primary-file %s %S/Inputs/xref-multi-file-other.swift -module-name main > /dev/null
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/struct_with_operators.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/alias.swift -module-name has_alias -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/xref_distraction.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t %S/Inputs/has_xref.swift -swift-version 3
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/struct_with_operators.swift
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/alias.swift -module-name has_alias
|
||||
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/xref_distraction.swift
|
||||
// RUN: %target-swift-frontend -emit-module -o %t -I %t %S/Inputs/has_xref.swift
|
||||
// RUN: llvm-bcanalyzer %t/has_xref.swiftmodule | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t %s -swift-version 3 > /dev/null
|
||||
// RUN: %target-swift-frontend -emit-silgen -I %t %s > /dev/null
|
||||
|
||||
// CHECK-NOT: UnknownCode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user