Skip to content

Commit

Permalink
Add test for code generation of comma operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Lai-YT authored and leewei05 committed Jun 13, 2024
1 parent 6e79126 commit 1b66997
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/codegen/bin_expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ int main() {
__builtin_print(0 && 2);
__builtin_print(5 || 0);
__builtin_print(0 || 0);
__builtin_print((1, 2));
return 0;
}
1 change: 1 addition & 0 deletions test/codegen/bin_expr.exp
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
0
1
0
2
7 changes: 7 additions & 0 deletions test/codegen/comma_expr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int main() {
int i;
int* p;
__builtin_print((i = 3, p = &i, i));
__builtin_print(*p);
return 0;
}
2 changes: 2 additions & 0 deletions test/codegen/comma_expr.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3
3

0 comments on commit 1b66997

Please sign in to comment.