[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: add test for comma operator
From: |
Ekaitz Zarraga |
Subject: |
[PATCH] tests: add test for comma operator |
Date: |
Tue, 27 Feb 2024 23:26:14 +0100 |
The comma operator works when comparing values but not when it needs to
deduce the type of the result. This test checks that.
* lib/tests/scaffold/86-comma-operator-types.c: Add test
* build-aux/check-mescc.sh: Add test to XFAIL
---
build-aux/check-mescc.sh | 1 +
lib/tests/scaffold/86-comma-operator-types.c | 24 ++++++++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 lib/tests/scaffold/86-comma-operator-types.c
diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh
index af979024..d9c018b4 100755
--- a/build-aux/check-mescc.sh
+++ b/build-aux/check-mescc.sh
@@ -247,6 +247,7 @@ lib/tests/scaffold/a1-global-no-clobber.c
"
xfail_tests="
+lib/tests/scaffold/86-comma-operator-types.c
lib/tests/stdio/90-sprintf.c
"
diff --git a/lib/tests/scaffold/86-comma-operator-types.c
b/lib/tests/scaffold/86-comma-operator-types.c
new file mode 100644
index 00000000..d5f79d7f
--- /dev/null
+++ b/lib/tests/scaffold/86-comma-operator-types.c
@@ -0,0 +1,24 @@
+/* -*-comment-start: "//";comment-end:""-*-
+ * GNU Mes --- Maxwell Equations of Software
+ * Copyright © 2024 Ekaitz Zarraga <ekaitz@elenq.tech>
+ *
+ * This file is part of GNU Mes.
+ *
+ * GNU Mes is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * GNU Mes is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+int
+main() {
+ return 0 + (0, 0);
+}
--
2.41.0
- [PATCH] tests: add test for comma operator,
Ekaitz Zarraga <=