]> git.sur5r.net Git - cc65/blob - test/val/cc65091020.c
goto.c warning fix for implicit truncation
[cc65] / test / val / cc65091020.c
1 /*
2   !!DESCRIPTION!! bit field bug
3   !!ORIGIN!!      testsuite
4   !!LICENCE!!     Public Domain
5   !!AUTHOR!!      Johan Kotlinski
6 */
7
8 #include <stdio.h>
9 #include <assert.h>
10
11 struct {
12     int foo : 7;
13     int bar : 4;
14 } baz = { 0, 2 };
15
16 int main() {
17     char bar = baz.bar;
18
19     assert(2 == bar);
20
21     printf("it works :)\n");
22
23     /* if not assert() */
24     return 0;
25 }
26
27 /* Assert fails. (SVN rev 4381) */