[squeak-dev] FFI: FFI-Tests-mt.70.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 14 13:51:01 UTC 2022


Marcel Taeumel uploaded a new version of FFI-Tests to project FFI:
http://source.squeak.org/FFI/FFI-Tests-mt.70.mcz

==================== Summary ====================

Name: FFI-Tests-mt.70
Author: mt
Time: 14 April 2022, 3:51:01.09255 pm
UUID: f595a7cb-2679-4a97-a029-dea014d5a82c
Ancestors: FFI-Tests-mt.69

Documents an issue in the current ARM64 abi support in the FFI plugin. See VMMaker.oscog-mt.3182.

=============== Diff against FFI-Tests-mt.69 ===============

Item was added:
+ ----- Method: FFIPluginTests>>arm64Check (in category 'support') -----
+ arm64Check
+ 	"Mark the current test as failure to avoid segmentation fault due to issues in the plugin code."
+ 	
+ 	(FFIPlatformDescription current isARM and: [FFIPlatformDescription current wordSize = 8])
+ 		ifTrue: [self fail: 'Not supported. Segmentation fault avoided.'].!

Item was changed:
  ----- Method: FFIPluginTests>>testSumStructSSdi5 (in category 'tests - structure') -----
  testSumStructSSdi5
  	"Test passing a structure larger than 8 eighbytes"
  	| sdi1 sdi2 sdi3 sdi4 sdi5 ssdi5 sum |
+ 	self arm64Check. "mt: Struct larger than 16 bytes."
  	sdi1 := FFITestSdi new.
  	sdi1 d1: 0.5; i2: 16r12345678.
  	sdi2 := FFITestSdi new.
  	sdi2 d1: 0.25; i2: 16r01234567.
  	sdi3 := FFITestSdi new.
  	sdi3 d1: 0.125; i2: 3.
  	sdi4 := FFITestSdi new.
  	sdi4 d1: 2.0; i2: 1.
  	sdi5 := FFITestSdi new.
  	sdi5 d1: 4.0; i2: 2.
  	ssdi5 := FFITestSSdi5 new.
  	ssdi5 sdi1: sdi1; sdi2: sdi2; sdi3: sdi3; sdi4: sdi4; sdi5: sdi5.
  	sum := self invoke: 'ffiTestSumSSdi5' with: ssdi5.
  	self assert: 0.5 + 16r12345678 + 0.25 + 16r01234567 + 0.125 + 3 + 2.0 + 1 + 4.0 + 2 equals: sum!

Item was changed:
  ----- Method: FFIPluginTests>>testSumStructSslf (in category 'tests - structure') -----
  testSumStructSslf
  	"Test passing structure short long float"
  	| sslf sum |
+ 	self arm64Check. "mt: Struct larger than 16 bytes."
  	sslf := FFITestSslf new.
  	sslf s1: -32768; l2: 16r1234560000; f3: 65536.0.
  	sum := self invoke: 'ffiTestSumSslf' with: sslf.
  	self assert: -32768 + 16r1234560000 + 65536.0 equals: sum!

Item was changed:
  ----- Method: FFIPluginTests>>testSumStructSslf2 (in category 'tests - structure') -----
  testSumStructSslf2
  	"Test passing structure short long float"
  	| sslf1 sslf2 sum |
+ 	self arm64Check. "mt: Struct larger than 16 bytes."
  	sslf1 := FFITestSslf new.
  	sslf1 s1: -32768; l2: 16r123456789012; f3: 65536.0.
  	sslf2 := FFITestSslf new.
  	sslf2 s1: 32767; l2: (-1 << 31); f3: -65536.0.	
  	sum := self invoke: 'ffiTestSumSslf_2' with: sslf1 with: sslf2.
  	self
  		assert: sslf1 s1 + sslf1 l2 + sslf1 f3 + sslf2 s1 + sslf2 l2 + sslf2 f3
  		equals: sum!

Item was changed:
  ----- Method: FFIPluginTests>>testSumStructSslf4 (in category 'tests - structure') -----
  testSumStructSslf4
  	"Test passing structure short long float"
  	| sslf1 sslf2 sslf3 sslf4 sum |
+ 	self arm64Check. "mt: Struct larger than 16 bytes."
  	sslf1 := FFITestSslf new.
  	sslf1 s1: -32768; l2: 16r123456789012; f3: 65536.0.
  	sslf2 := FFITestSslf new.
  	sslf2 s1: 32767; l2: (-1 << 31); f3: -65536.0.
  	sslf3 := FFITestSslf new.
  	sslf3 s1: 1; l2: 16r123456789012; f3: 123.456.	
  	sslf4 := FFITestSslf new.
  	sslf4 s1: 2; l2: (-1 << 31); f3: 456.123.	
  	sum := self invoke: 'ffiTestSumSslf_4' with: sslf1 with: sslf2 with: sslf3 with: sslf4.
  	self
  		assert: sslf1 s1 + sslf1 l2 + sslf1 f3 + sslf2 s1 + sslf2 l2 + sslf2 f3
  			+ sslf3 s1 + sslf3 l2 + sslf3 f3 + sslf4 s1 + sslf4 l2 + sslf4 f3
  		equals: sum!



More information about the Squeak-dev mailing list