aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r--ld/testsuite/ld-plugin/lto.exp9
-rw-r--r--ld/testsuite/ld-plugin/pr22751.c17
2 files changed, 26 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 896f453..7300f48 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -29,6 +29,8 @@ if { ![check_plugin_api_available]
return
}
+global INT128_CFLAGS
+
global CFLAGS
global CXXFLAGS
set saved_CFLAGS "$CFLAGS"
@@ -214,6 +216,9 @@ set lto_link_tests [list \
[list "Build pr22502b.o" \
"$plug_opt" "-flto $lto_no_fat" \
{pr22502b.c}] \
+ [list "Build pr22751.a" \
+ "$plug_opt" "-flto $lto_no_fat $INT128_CFLAGS" \
+ {pr22751.c} {} "pr22751.a"] \
]
if { [at_least_gcc_version 4 7] } {
@@ -400,6 +405,10 @@ set lto_run_tests [list \
[list "Run pr22502" \
"-O2 -flto tmpdir/pr22502a.o tmpdir/pr22502b.o" "" \
{dummy.c} "pr20267" "pass.out" "-flto -O2" "c"] \
+ [list "Run pr22751" \
+ "-O2 -flto" "" \
+ {dummy.c} "pr22751" "pass.out" "-flto -O2" "c" "" \
+ "-Wl,--whole-archive tmpdir/pr22751.a -Wl,--no-whole-archive"] \
]
if { [at_least_gcc_version 4 7] } {
diff --git a/ld/testsuite/ld-plugin/pr22751.c b/ld/testsuite/ld-plugin/pr22751.c
new file mode 100644
index 0000000..33c1bf3
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22751.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+#ifdef HAS_INT128
+volatile __int128 a = 42;
+volatile __int128 b = 1;
+#else
+volatile long long a = 42;
+volatile long long b = 1;
+#endif
+
+int
+main (void)
+{
+ if (((int) (a / b)) == 42)
+ printf ("PASS\n");
+ return 0;
+}