aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c
new file mode 100644
index 000000000..3f93445cd
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr38405.c
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+
+extern void abort ();
+extern int printf (char *__format, ...);
+
+struct vpiBinaryConst {
+ int signed_flag :1;
+ int sized_flag :1;
+};
+
+int binary_get(int code, struct vpiBinaryConst *rfp)
+{
+ switch (code) {
+ case 1:
+ return rfp->signed_flag ? 1 : 0;
+ default:
+ printf("error: %d not supported\n", code);
+ return code;
+ }
+}
+
+int main(void)
+{
+ struct vpiBinaryConst x={1,0};
+ int y=binary_get(1, &x);
+ if (y!=1)
+ abort ();
+ return 0;
+}