From 9711ed70ecf0c57e5b75b41b1333f4277ed7df50 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Tue, 1 Dec 2020 11:36:23 +0100 Subject: [PATCH] tests: Add 70-or-argument.c. * lib/tests/scaffold/70-or-argument.c: New file. * build-aux/check-mescc.sh (tcc_tests): Add it. --- build-aux/check-mescc.sh | 1 + lib/tests/scaffold/70-or-argument.c | 37 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/tests/scaffold/70-or-argument.c diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index 1bc165b8..15e92451 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -194,6 +194,7 @@ lib/tests/scaffold/70-struct-post.c lib/tests/scaffold/70-extern.c lib/tests/scaffold/70-ternary-arithmetic-argument.c lib/tests/scaffold/70-function-modulo.c +lib/tests/scaffold/70-or-argument.c lib/tests/setjmp/80-setjmp.c lib/tests/stdio/80-sscanf.c lib/tests/stdlib/80-qsort.c diff --git a/lib/tests/scaffold/70-or-argument.c b/lib/tests/scaffold/70-or-argument.c new file mode 100644 index 00000000..7563130c --- /dev/null +++ b/lib/tests/scaffold/70-or-argument.c @@ -0,0 +1,37 @@ +/* -*-comment-start: "//";comment-end:""-*- + * GNU Mes --- Maxwell Equations of Software + * Copyright © 2020 Jan (janneke) Nieuwenhuizen + * + * 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 . + */ + +int +test (int i, int j, int k) +{ + return i + j + k; +} + +int +main () +{ + int i = 1; + int j = 2; + int k = 4; + int r = test (1, i, j | k); + if (r != 8) + return 1; + return 0; +}