summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/pr48197.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/pr48197.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr48197.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr48197.c b/gcc/testsuite/gcc.c-torture/execute/pr48197.c
new file mode 100644
index 000000000..37812c07b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr48197.c
@@ -0,0 +1,25 @@
+/* PR c/48197 */
+
+extern void abort (void);
+static int y = 0x8000;
+
+int
+main ()
+{
+ unsigned int x = (short)y;
+ if (sizeof (0LL) == sizeof (0U))
+ return 0;
+ if (0LL > (0U ^ (short)-0x8000))
+ abort ();
+ if (0LL > (0U ^ x))
+ abort ();
+ if (0LL > (0U ^ (short)y))
+ abort ();
+ if ((0U ^ (short)-0x8000) < 0LL)
+ abort ();
+ if ((0U ^ x) < 0LL)
+ abort ();
+ if ((0U ^ (short)y) < 0LL)
+ abort ();
+ return 0;
+}