Skip to content

Commit 3d7b8a5

Browse files
committed
test(effect): test DCE with unused result of subexpression
1 parent cbe0d16 commit 3d7b8a5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/pass/effect.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int add(int k, int y)
2+
{
3+
return k + y;
4+
}
5+
6+
int main(int K)
7+
{
8+
int a = add(10, 20);
9+
return 0;
10+
}

tests/pass/effect.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
local function add(k, y)
2+
return (k + y)
3+
end
4+
5+
os.exit((function(args)
6+
local args_table = args
7+
local K = args_table and tonumber(args_table[1]) or 0
8+
add(10, 20)
9+
return 0
10+
end)(arg))

0 commit comments

Comments
 (0)