diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-03-08 15:04:27 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-03-08 14:04:27 +0000 |
commit | 752e334b3acacf188a9bb14aec278c93ea42988b (patch) | |
tree | dc5b14aa73c063802edbbe366c153bd91748df22 /gcc | |
parent | c7904d9e08a0ca3f733be3c2e8a3b912fa851fc5 (diff) | |
download | gcc-752e334b3acacf188a9bb14aec278c93ea42988b.zip gcc-752e334b3acacf188a9bb14aec278c93ea42988b.tar.gz gcc-752e334b3acacf188a9bb14aec278c93ea42988b.tar.bz2 |
Add tests for resolved PR (PR c/85870).
2019-03-08 Jakub Jelinek <jakub@redhat.com>
PR c/85870
* gcc.dg/lto/pr85870_0.c: New test.
* gcc.dg/lto/pr85870_1.c: New test.
From-SVN: r269495
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr85870_0.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr85870_1.c | 27 |
3 files changed, 67 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d386f6..b566c62 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-03-08 Jakub Jelinek <jakub@redhat.com> + + PR c/85870 + * gcc.dg/lto/pr85870_0.c: New test. + * gcc.dg/lto/pr85870_1.c: New test. + 2019-03-08 Martin Liska <mliska@suse.cz> PR target/86952 diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_0.c b/gcc/testsuite/gcc.dg/lto/pr85870_0.c new file mode 100644 index 0000000..4b59f60 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr85870_0.c @@ -0,0 +1,34 @@ +/* PR c/85870 */ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -flto -O2 } } } */ + +typedef struct abc_s { + char a1; + short a2; + unsigned int a3; + unsigned int a4; +} abc; + +typedef struct xyz_s { + unsigned x1; + unsigned x2; + abc *x3; +} xyz; + +extern xyz XYZ[3]; +static const abc Arr1[]={ + {0,0,0xdeadbeaf,0xbeefdead} , +#line 1040 + {0,0,0xdeadbeaf,0xbeefdead} }; + +void init_xyz_0() { + XYZ[0].x1=975753; + XYZ[0].x2=1024; + XYZ[0].x3=(abc *)Arr1; + +} + +int +main () +{ +} diff --git a/gcc/testsuite/gcc.dg/lto/pr85870_1.c b/gcc/testsuite/gcc.dg/lto/pr85870_1.c new file mode 100644 index 0000000..cd1cd31 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/pr85870_1.c @@ -0,0 +1,27 @@ +typedef struct abc_s { + char a1; + short a2; + unsigned int a3; + unsigned int a4; +} abc; + + +typedef struct xyz_s { + unsigned int x1; + unsigned int x2; + abc *x3; +} xyz; + + +extern xyz XYZ[3]; +static const abc Arr2[]={ + {0,0,0xbeafdead,0xdeadbeef} , +#line 1048594 + {0,0,0xbeafdead,0xdeadbeef} }; + +void init_xyz_1() { + XYZ[1].x1=425753; + XYZ[1].x2=1048576; + XYZ[1].x3=(abc *)Arr2; + +} |