aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/bitint-124.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/bitint-124.c')
-rw-r--r--gcc/testsuite/gcc.dg/bitint-124.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/bitint-124.c b/gcc/testsuite/gcc.dg/bitint-124.c
new file mode 100644
index 0000000..160a1e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitint-124.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/121131 */
+/* { dg-do run { target bitint } } */
+/* { dg-options "-O2" } */
+
+#if __BITINT_MAXWIDTH__ >= 156
+struct A { _BitInt(156) b : 135; };
+
+static inline _BitInt(156)
+foo (struct A *x)
+{
+ return x[1].b;
+}
+
+__attribute__((noipa)) _BitInt(156)
+bar (void)
+{
+ struct A a[] = { 1, 1, -13055525270329736316393717310914023773847wb,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+ return foo (&a[1]);
+}
+#endif
+
+int
+main ()
+{
+#if __BITINT_MAXWIDTH__ >= 156
+ if (bar () != -13055525270329736316393717310914023773847wb)
+ __builtin_abort ();
+#endif
+}