diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-01-29 00:26:55 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-28 23:35:27 +0200 |
commit | 7de5a2c3a641d295da46d99a668812dfa85635a7 (patch) | |
tree | 2b2485209d4d4010a16f8856fbd132b962ed8fd6 /gcc/testsuite/gcc.dg | |
parent | cb221d31b451fba0351cbe4cc41c3b7531a98f4f (diff) |
fixing tests
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-30-heterogenous-struct-0.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-structreorg-31-heterogenous-struct-0.c | 6 |
2 files changed, 11 insertions, 12 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-30-heterogenous-struct-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-30-heterogenous-struct-0.c index 8cf5b0c717e..dddee00ac36 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-30-heterogenous-struct-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-30-heterogenous-struct-0.c @@ -8,13 +8,12 @@ int main() { - // pre-transform = { .a = 0, b = 1, c = 5, d = 6, e = 10 } - // post-transform = { .a = 0, c = 1, d = 5, e = 6 } - struct astruct_s { _Bool a; int b; _Bool c; int d; _Bool e;}; - struct astruct_s astruct; - _Bool *a = &(astruct.a); - _Bool *e = &(astruct.e); - ptrdiff_t diff = e - a; - assert(d == (2*sizeof(_Bool) + 1*sizeof(int)); + // unmodified { a = 1, b = 4; c = 5; d = 8; e = 12 + // modified { a = 1, c = 2; d = 4, e = 8 +struct astruct_s { _Bool a; int b; _Bool c; int d; _Bool e;}; +struct astruct_s astruct; +_Bool *a = &(astruct.a); +_Bool *e = &(astruct.e); +ptrdiff_t diff = e - a; +assert(diff == 8); } - diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-31-heterogenous-struct-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-31-heterogenous-struct-0.c index ec35fd46776..22dedb90432 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-31-heterogenous-struct-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-structreorg-31-heterogenous-struct-0.c @@ -8,13 +8,13 @@ int main() { +// unmodified a = 0, d = 1; e = 2; f = 3; b = 4; c = 8 +// modified a = 0, d = 1, e = 2, f = 3, c = 4; struct astruct_s { _Bool a; _Bool d; _Bool e; _Bool f; _Bool b; int c;}; struct astruct_s astruct; struct astruct_s *p = &astruct; _Bool *a = &(p->a); -_Bool *c = &(p->c); +_Bool *c = (_Bool*)&(p->c); ptrdiff_t d = c - a; assert(d == 4); - } - |