code wiki / (root) / nx_boolean_evaluation_probe_t365.nx

nx_boolean_evaluation_probe_t365.nx source

↩ module page · 4 lines · 488 B

1import "nx_gate_verdict.nx" 2static SFP_CALLS:i64=0 3func sfp_rhs()->i64{SFP_CALLS=SFP_CALLS+1;return 1} 4func main(argc:i64,argv:*i64)->i64{let g:*i64=gv_ctr();gv_head("Native boolean evaluation observation" as *u8);if (0==1)&&(sfp_rhs()==1){SFP_CALLS=SFP_CALLS+100};gv_check("false left operand still evaluates right function" as *u8,(SFP_CALLS==1) as i64,g);return gv_verdict("boolean_evaluation_observation" as *u8,g,"observed compiler behavior only; no language safety repair" as *u8)}