From 5019eef8d654bdccf1b3bf906e9fa56933c7a8de Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 11 Jan 2019 14:20:01 +0100 Subject: [PATCH] Add a testcase (PR middle-end/88758). 2019-01-11 Martin Liska PR middle-end/88758 * g++.dg/lto/pr88758_0.C: New test. * g++.dg/lto/pr88758_1.C: New test. From-SVN: r267840 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/lto/pr88758_0.C | 7 +++++++ gcc/testsuite/g++.dg/lto/pr88758_1.C | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/lto/pr88758_0.C create mode 100644 gcc/testsuite/g++.dg/lto/pr88758_1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5fbeb1e5f5b..a3de38e52e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-01-11 Martin Liska + + PR middle-end/88758 + * g++.dg/lto/pr88758_0.C: New test. + * g++.dg/lto/pr88758_1.C: New test. + 2019-01-11 Jan Beulich * gcc.target/i386/avx512f-vcvtsd2si-1.c, diff --git a/gcc/testsuite/g++.dg/lto/pr88758_0.C b/gcc/testsuite/g++.dg/lto/pr88758_0.C new file mode 100644 index 00000000000..eccbf63c358 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr88758_0.C @@ -0,0 +1,7 @@ +// { dg-lto-do link } +// { dg-require-effective-target fpic } +// { dg-require-effective-target shared } +// { dg-lto-options { { -O3 -fPIC -flto -shared } } } + +void PreEvaluate(void); +int main() { PreEvaluate(); return 0; } diff --git a/gcc/testsuite/g++.dg/lto/pr88758_1.C b/gcc/testsuite/g++.dg/lto/pr88758_1.C new file mode 100644 index 00000000000..64ff57aeeb2 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr88758_1.C @@ -0,0 +1,9 @@ +extern int a[]; +int b; +int c; + +void PreEvaluate(void) { + b = 0; + for (; b < 8; b++) + a[b] = c * (b > 0 ? b - 1 : 0); +} -- 2.30.2