mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
ZAM fix for inlining empty function bodies as the sole elements of an if-else
This commit is contained in:
parent
a3a0155825
commit
286c4dc776
3 changed files with 30 additions and 2 deletions
2
testing/btest/Baseline/opt.null-inline-branch/output
Normal file
2
testing/btest/Baseline/opt.null-inline-branch/output
Normal file
|
@ -0,0 +1,2 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
got through the conditional
|
19
testing/btest/opt/null-inline-branch.zeek
Normal file
19
testing/btest/opt/null-inline-branch.zeek
Normal file
|
@ -0,0 +1,19 @@
|
|||
# @TEST-DOC: Regression test for past ZAM issues with inlining empty functions in conditionals
|
||||
#
|
||||
# @TEST-EXEC: zeek -b -O ZAM %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
function empty_func() {}
|
||||
|
||||
# Use a global to avoid constant propagation optimizing out the conditional.
|
||||
global bar = F;
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
if ( bar )
|
||||
empty_func();
|
||||
else
|
||||
empty_func();
|
||||
|
||||
print "got through the conditional";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue