Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,7 @@ and intOfAttrparam (a:attrparam) : int option =
match a with
AInt(n) -> n
| ABinOp(Shiftlt, a1, a2) -> (doit a1) lsl (doit a2)
| ABinOp(Mult, a1, a2) -> (doit a1) * (doit a2)
| ABinOp(Div, a1, a2) -> (doit a1) / (doit a2)
| ASizeOf(t) ->
let bs = bitsSizeOf t in
Expand Down
8 changes: 8 additions & 0 deletions test/small1/attr-multiplication.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
struct S1 {
char a;
} __attribute__((aligned(sizeof(short) * sizeof(int))));


struct S2 {
int x: __builtin_choose_expr(__alignof__ (struct S1) == sizeof(short) * sizeof(int), 1, -1);
} s2;
1 change: 1 addition & 0 deletions test/testcil.pl
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ sub addToGroup {
addTest("test/attr11 _GNUCC=1");
addTest("test/attr12 _GNUCC=1");
addTest("test/attr13 _GNUCC=1");
addTest("test/attr-multiplication");
# addTest("test/attr-assign"); # TODO: only on OSX, Linux GCC errors on introduced
# addTest("test/attr-enumerator"); # TODO: only on OSX, Linux GCC errors on introduced
addTest("testrun/packed _GNUCC=1 WARNINGS_ARE_ERRORS=1");
Expand Down