aboutsummaryrefslogtreecommitdiff
path: root/SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c
diff options
context:
space:
mode:
Diffstat (limited to 'SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c')
-rw-r--r--SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c b/SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c
new file mode 100644
index 00000000..e36879d7
--- /dev/null
+++ b/SingleSource/Regression/C/gcc-c-torture/execute/pr38422.c
@@ -0,0 +1,24 @@
+/* PR middle-end/38422 */
+
+extern void abort (void);
+
+struct S
+{
+ int s : (sizeof (int) * __CHAR_BIT__ - 2);
+} s;
+
+void
+foo (void)
+{
+ s.s *= 2;
+}
+
+int
+main ()
+{
+ s.s = 24;
+ foo ();
+ if (s.s != 48)
+ abort ();
+ return 0;
+}