Skip to content

Commit 57bee9c

Browse files
committed
[test] load a value of the 128-bit floating point type
1 parent a9a740d commit 57bee9c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

validation-test/stdlib/UnsafeRawPointerInternal.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ UnsafeRawPointerTestSuite.test("load.unaligned.largeAlignment")
1717
var offset = 3
1818
let int128 = withUnsafeTemporaryAllocation(of: UInt8.self, capacity: 64) {
1919
temporary -> Builtin.Int128 in
20-
_ = temporary.initialize(from: 0..<64)
2120
let buffer = UnsafeRawBufferPointer(temporary)
21+
_ = temporary.initialize(from: repeatElement(0, count: 64))
22+
// Load a 128-bit floating point value
23+
let fp = buffer.loadUnaligned(fromByteOffset: offset, as: Builtin.FPIEEE128.self)
24+
noop(fp)
25+
temporary.baseAddress!.deinitialize(count: 64)
26+
_ = temporary.initialize(from: 0..<64)
2227
let aligned = buffer.baseAddress!.alignedUp(for: Builtin.Int128.self)
2328
offset += buffer.baseAddress!.distance(to: aligned)
29+
// Load and return a 128-bit integer value
2430
return buffer.loadUnaligned(fromByteOffset: offset, as: Builtin.Int128.self)
2531
}
2632
withUnsafeBytes(of: int128) {

0 commit comments

Comments
 (0)