Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Last active November 22, 2017 00:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save AlexDaniel/f7e43792ad2e4a29c3f13dfdf2453506 to your computer and use it in GitHub Desktop.
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