From a86644eff1b0102a95eada977b7fb23b5d2e56fb Mon Sep 17 00:00:00 2001 From: mrdudz Date: Thu, 24 Sep 2020 00:08:36 +0200 Subject: [PATCH] test related to issue #1221 --- test/val/bug1221.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/val/bug1221.c diff --git a/test/val/bug1221.c b/test/val/bug1221.c new file mode 100644 index 000000000..360a71162 --- /dev/null +++ b/test/val/bug1221.c @@ -0,0 +1,12 @@ +/* bug #1221 - Structs/unions as ternary operands */ + +int a; +struct S { int a; } s1, s2; +struct U { int a; } u1, u2; + +int main() +{ + a ? s1 : s2; /* BUG: should be OK */ + a ? u1 : u2; /* BUG: should be OK */ + return 0; +}