Skip to content

Commit 836cebb

Browse files
committed
test: avoid use of CLong in test
`CLong` expands differently across LP64 and LLP64 targets. Use a different type for the test.
1 parent 3a4dbd6 commit 836cebb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/ClangImporter/ctypes_parse.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ func testFunctionPointers() {
208208
var anotherFP: @convention(c) (CInt, CLong, UnsafeMutableRawPointer?) -> Void
209209
= getFunctionPointer2()
210210

211+
var sizedFP: (@convention(c) (CInt, CInt, UnsafeMutableRawPointer?) -> Void)?
212+
211213
useFunctionPointer2(anotherFP)
212-
anotherFP = fp // expected-error {{cannot assign value of type 'fptr?' (aka 'Optional<@convention(c) (Int32) -> Int32>') to type '@convention(c) (CInt, CLong, UnsafeMutableRawPointer?) -> Void' (aka '@convention(c) (Int32, Int, Optional<UnsafeMutableRawPointer>) -> ()')}}
214+
sizedFP = fp // expected-error {{cannot assign value of type 'fptr?' (aka 'Optional<@convention(c) (Int32) -> Int32>') to type '(@convention(c) (CInt, CInt, UnsafeMutableRawPointer?) -> Void)?'}}
213215
}
214216

215217
func testStructDefaultInit() {

0 commit comments

Comments
 (0)