Skip to content

Commit edb3312

Browse files
committed
Rename tests
1 parent 01fa6dc commit edb3312

16 files changed

+188
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import ConstructorCallsFunction
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("constructor calls function") {
11+
expectEqual(42, callConstructor(41))
12+
}
13+
14+
runAllTests()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import ConstructorCallsFunctionFromNestedStruct
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("constructor calls function from nested struct") {
11+
expectEqual(42, callConstructor(41))
12+
}
13+
14+
runAllTests()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import ConstructorCallsFunctionFromNestedStruct
4+
5+
public func getIncrementorValue() -> CInt {
6+
return callConstructor(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_Z9incrementi|"\?increment@@YAHH@Z"}}(i32 %t)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import ConstructorCallsFunction
4+
5+
public func getIncrementorValue() -> CInt {
6+
return callConstructor(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_Z9incrementi|"\?increment@@YAHH@Z"}}(i32 %t)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import ConstructorCallsMethod
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("constructor calls method") {
11+
expectEqual(42, callConstructor(41))
12+
}
13+
14+
runAllTests()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import ConstructorCallsMethod
4+
5+
public func getIncrementorValue() -> CInt {
6+
return callConstructor(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_ZN11Incrementor9incrementEi|"\?increment@Incrementor@@QEAAHH@Z"}}(%struct.Incrementor* %this, i32 %t)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import FieldInitCallsFunction
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("field init calls function") {
11+
expectEqual(42, initializeField())
12+
}
13+
14+
runAllTests()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import FieldInitCallsFunction
4+
5+
public func getInitializedField() -> CInt {
6+
return initializeField()
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_Z9incrementi|"\?increment@@YAHH@Z"}}(i32 %t)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import MethodCallsFunction
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("method calls function") {
11+
expectEqual(42, callMethod(41))
12+
}
13+
14+
runAllTests()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import MethodCallsFunction
4+
5+
public func getValueFromMethod() -> CInt {
6+
return callMethod(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_Z9incrementi|"\?increment@@YAHH@Z"}}(i32 %t)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import MethodCallsMethod
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("method calls method") {
11+
expectEqual(42, callMethod(41))
12+
}
13+
14+
runAllTests()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop)
2+
//
3+
// REQUIRES: executable_test
4+
5+
import MethodCallsMethodFromNestedStruct
6+
import StdlibUnittest
7+
8+
var MembersTestSuite = TestSuite("MembersTestSuite")
9+
10+
MembersTestSuite.test("method calls method from nested struct") {
11+
expectEqual(42, callMethod(41))
12+
}
13+
14+
runAllTests()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import MethodCallsMethodFromNestedStruct
4+
5+
public func getValueFromMethod() -> CInt {
6+
return callMethod(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_ZN13IncrementUser11Incrementor9incrementEi|"\?increment@Incrementor@IncrementUser@@QEAAHH@Z"}}(%"struct.IncrementUser::Incrementor"* %this, i32 %t)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
2+
3+
import MethodCallsMethod
4+
5+
public func getValueFromMethod() -> CInt {
6+
return callMethod(41)
7+
}
8+
9+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_ZN11Incrementor9incrementEi|"\?increment@Incrementor@@QEAAHH@Z"}}(%struct.Incrementor* %this, i32 %t)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-cxx-interop -Xfrontend -validate-tbd-against-ir=none)
2+
//
3+
// REQUIRES: executable_test
4+
5+
// TODO: See why -validate-tbd-against-ir=none is needed here
6+
7+
import StaticVarInitCallsFunction
8+
import StdlibUnittest
9+
10+
var MembersTestSuite = TestSuite("MembersTestSuite")
11+
12+
MembersTestSuite.test("static var init calls function") {
13+
expectEqual(42, initializeStaticVar())
14+
}
15+
16+
runAllTests()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop -validate-tbd-against-ir=none | %FileCheck %s
2+
3+
// TODO: See why -validate-tbd-against-ir=none is needed here
4+
5+
import StaticVarInitCallsFunction
6+
7+
public func getInitializedStaticVar() -> CInt {
8+
return initializeStaticVar()
9+
}
10+
11+
// CHECK: define linkonce_odr{{( dso_local)?}} i32 @{{_Z9incrementi|"\?increment@@YAHH@Z"}}(i32 %t)

0 commit comments

Comments
 (0)