summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr48717.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr48717.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr48717.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr48717.c b/gcc/testsuite/gcc.c-torture/execute/pr48717.c
new file mode 100644
index 000000000..a746374a2
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr48717.c
@@ -0,0 +1,26 @@
+/* PR tree-optimization/48717 */
+
+extern void abort (void);
+
+int v = 1, w;
+
+unsigned short
+foo (unsigned short x, unsigned short y)
+{
+ return x + y;
+}
+
+void
+bar (void)
+{
+ v = foo (~w, w);
+}
+
+int
+main ()
+{
+ bar ();
+ if (v != (unsigned short) -1)
+ abort ();
+ return 0;
+}