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-06-03 16:04:55 +0200 |
commit | 219e50ea45470552de25428c5bc5e9b21f1b70ce (patch) | |
tree | c4537b299073753392115c5f49a4f255125feea8 /gcc/testsuite | |
parent | 7c602275177faf913c761b1d358bd8e0e17e8bb7 (diff) |
fixing tests
Diffstat (limited to 'gcc/testsuite')
-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); - } - |