aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/010.sh
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-03 17:37:27 +0900
committernsfisis <nsfisis@gmail.com>2025-05-03 17:37:27 +0900
commit7ed42654c3205657a86fa5e914c75a0eeb673f8e (patch)
tree6e0c75c742b2eb9566df3052e3a1ea47c707902b /tests/010.sh
parent374076ce1e9edce0469847c1615be21d100275cd (diff)
downloadP4Dcc-7ed42654c3205657a86fa5e914c75a0eeb673f8e.tar.gz
P4Dcc-7ed42654c3205657a86fa5e914c75a0eeb673f8e.tar.zst
P4Dcc-7ed42654c3205657a86fa5e914c75a0eeb673f8e.zip
if stmt
Diffstat (limited to 'tests/010.sh')
-rw-r--r--tests/010.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/010.sh b/tests/010.sh
new file mode 100644
index 0000000..df6601c
--- /dev/null
+++ b/tests/010.sh
@@ -0,0 +1,21 @@
+set -e
+
+bash ../../test_exit_code.sh 12 <<'EOF'
+int main() {
+ if (1) {
+ return 12;
+ } else {
+ return 34;
+ }
+}
+EOF
+
+bash ../../test_exit_code.sh 34 <<'EOF'
+int main() {
+ if (1 + 1 != 2) {
+ return 12;
+ } else {
+ return 34;
+ }
+}
+EOF