diff options
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pass.out | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr20276a.c | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr20276b.c | 1 |
4 files changed, 23 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 7a13abb..7743719 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -183,6 +183,12 @@ set lto_link_tests [list \ [list "PR ld/19317 (1)" \ "$plug_opt" "-flto $lto_no_fat" \ {pr19317.c} {} "libpr19317.a"] \ + [list "Build pr20276a.o" \ + "" "-fno-lto" \ + {pr20276a.c}] \ + [list "Build pr20276b.o" \ + "$plug_opt" "-flto $lto_no_fat" \ + {pr20276b.c}] \ ] if { [at_least_gcc_version 4 7] } { @@ -332,6 +338,9 @@ set lto_run_tests [list \ [list "PR ld/19317 (3)" \ "-O2 -flto tmpdir/pr19317-r.o" "" \ {dummy.c} "pr19317.exe" "pr19317.out" "-flto -O2" "c"] \ + [list "Run pr20276" \ + "-O2 -flto tmpdir/pr20276a.o tmpdir/pr20276b.o" "" \ + {dummy.c} "pr20276" "pass.out" "-flto -O2" "c"] \ ] if { [at_least_gcc_version 4 7] } { diff --git a/ld/testsuite/ld-plugin/pass.out b/ld/testsuite/ld-plugin/pass.out new file mode 100644 index 0000000..7ef22e9 --- /dev/null +++ b/ld/testsuite/ld-plugin/pass.out @@ -0,0 +1 @@ +PASS diff --git a/ld/testsuite/ld-plugin/pr20276a.c b/ld/testsuite/ld-plugin/pr20276a.c new file mode 100644 index 0000000..0b37bc7 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr20276a.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +int global_var; +extern void abort (); + +int main(void) +{ + if (global_var != 20) + abort (); + printf ("PASS\n"); + return 0; +} diff --git a/ld/testsuite/ld-plugin/pr20276b.c b/ld/testsuite/ld-plugin/pr20276b.c new file mode 100644 index 0000000..2ecbc2c --- /dev/null +++ b/ld/testsuite/ld-plugin/pr20276b.c @@ -0,0 +1 @@ +int global_var = 20; |