aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c
new file mode 100644
index 00000000..7611c986
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr70222-2.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/70222 */
+
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+__attribute__((noinline, noclone)) unsigned int
+foo (int x)
+{
+ unsigned long long y = -1ULL >> x;
+ return (unsigned int) y >> 31;
+}
+#endif
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ if (foo (15) != 1 || foo (32) != 1 || foo (33) != 0)
+ __builtin_abort ();
+#endif
+ return 0;
+}