X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fregression%2Fstruct1.c;h=32baf80876fd9fbc7986b5604c6373e8eade31e8;hb=fdae13dc9bca4bdd2284a7437c0c50fe615228a2;hp=e7a607e8d18cc1f0db5ab6d92ae84cb09c62a3f7;hpb=b4d69dfd516f175255aa87b18b59dcf309d98b46;p=fw%2Fsdcc diff --git a/src/regression/struct1.c b/src/regression/struct1.c index e7a607e8..32baf808 100644 --- a/src/regression/struct1.c +++ b/src/regression/struct1.c @@ -39,10 +39,11 @@ unsigned char *acharP = 0; struct chars { unsigned char c0, c1; + unsigned int i0, i1; }; -struct chars char_struct; +struct chars struct1; void done () @@ -56,15 +57,15 @@ void struct_test (void) { - if (char_struct.c0 || char_struct.c1) + if (struct1.c0 || struct1.c1) failures++; - char_struct.c0++; + struct1.c0++; - if (char_struct.c0 != 1) + if (struct1.c0 != 1) failures++; } - +/* void ptr_to_struct (struct chars *p) { @@ -78,17 +79,29 @@ ptr_to_struct (struct chars *p) if (p->c1 != 1) failures++; } +*/ +void add_chars(void) +{ + + achar0 = struct1.c0 + struct1.c1; + if(achar0 != 1) + failures++; +} void main (void) { - char_struct.c0 = 0; - char_struct.c1 = 0; + struct1.c0 = 0; + struct1.c1 = 0; struct_test (); - ptr_to_struct (&char_struct); + // ptr_to_struct (&struct1); + + struct1.c0 = 0; + struct1.c1 = 1; + add_chars(); success = failures; done ();