/12-sizeof-golfed.t Secret
Last active
November 22, 2017 00:08
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use lib <lib t/04-nativecall>; | |
use CompileTestLib; | |
use NativeCall; | |
use Test; | |
plan 1; | |
compile_test_lib('12-sizeof'); | |
class Foo is repr<CStruct> { | |
has int8 $.foo1; | |
has int32 $.foo2; | |
has int16 $.foo3; | |
has int16 $.foo4; | |
} | |
class Bar is repr<CStruct> { | |
has int8 $.bar1; | |
has int16 $.bar2; | |
has int8 $.bar3; | |
has int32 $.bar4; | |
has int16 $.bar5; | |
} | |
sub SizeofBar() returns int32 is native('./12-sizeof') { * } | |
is nativesizeof(Bar), SizeofBar(), 'sizeof(Bar)'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment