Skip to content

Commit 5fd9424

Browse files
author
Daniel Kroening
committed
test for promotion in compound assignment
The C frontend needs to apply the usual arithmetic promotion rules in compound assignments. Issue #3706.
1 parent f3793bd commit 5fd9424

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <assert.h>
2+
3+
int main()
4+
{
5+
unsigned char x = 50;
6+
short y = -5;
7+
x /= y;
8+
assert(x == (unsigned char)-10);
9+
return 0;
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
compound_promition.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
The C frontend needs to apply the usual arithmetic promotion rules in
11+
compound assignments. Issue #3706.

0 commit comments

Comments
 (0)