diff options
author | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-05-15 17:30:52 +0300 |
---|---|---|
committer | Dimitar Dimitrov <dimitar@dinux.eu> | 2022-06-24 23:22:14 +0300 |
commit | b1d0d3520e96802dee37e8fc1c56e19c13d598b1 (patch) | |
tree | e6f19719e1d7cb8cd2efc1cbe28afa98e747b611 | |
parent | 5959cf8217e90b1331170fce96d83dd796a2bd8d (diff) | |
download | gcc-b1d0d3520e96802dee37e8fc1c56e19c13d598b1.zip gcc-b1d0d3520e96802dee37e8fc1c56e19c13d598b1.tar.gz gcc-b1d0d3520e96802dee37e8fc1c56e19c13d598b1.tar.bz2 |
testsuite: Remove reliance on argc in lto/pr101868_0.c
Some embedded targets do not pass any argv arguments. When argc is
zero, this causes spurious failures for lto/pr101868_0.c. Fix by
following the strategy in r0-114701-g2c49569ecea56d. Use a volatile
variable instead of argc to inject a runtime value into the test.
I validated the following:
- No changes in testresults for x86_64-pc-linux-gnu.
- The spurious failures are fixed for PRU target.
- lto/pr101868_0.c still fails on x86_64-pc-linux-gnu, if
the PR/101868 fix (r12-2254-gfedcf3c476aff7) is reverted.
PR tree-optimization/101868
gcc/testsuite/ChangeLog:
* gcc.dg/lto/pr101868_0.c (zero): New volatile variable.
(main): Use it instead of argc.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/pr101868_0.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.dg/lto/pr101868_0.c b/gcc/testsuite/gcc.dg/lto/pr101868_0.c index c84d19b..0312430 100644 --- a/gcc/testsuite/gcc.dg/lto/pr101868_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr101868_0.c @@ -22,12 +22,13 @@ repro(VALUE dummy, VALUE hash) static VALUE (*that)(VALUE dummy, VALUE hash) = repro; +volatile int zero = 0; + int main(int argc, char **argv) { - argc--; - that(0, argc); + that(0, zero); - rb_check_type(argc, argc); + rb_check_type(zero, zero); } |