aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-03 17:57:17 +0900
committernsfisis <nsfisis@gmail.com>2025-05-03 17:57:17 +0900
commit5e630e9d34f082c5737cf61aa103b1db3c1ed6e8 (patch)
tree1db8b06c0a9a70e442268abe9f3bc533144bd5f7 /tests
parent79e00de77709e1a8a9a12939c59606e38b27e52f (diff)
downloadP4Dcc-5e630e9d34f082c5737cf61aa103b1db3c1ed6e8.tar.gz
P4Dcc-5e630e9d34f082c5737cf61aa103b1db3c1ed6e8.tar.zst
P4Dcc-5e630e9d34f082c5737cf61aa103b1db3c1ed6e8.zip
for stmt
Diffstat (limited to 'tests')
-rw-r--r--tests/012.sh17
-rw-r--r--tests/013.sh17
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/012.sh b/tests/012.sh
new file mode 100644
index 0000000..279e3c2
--- /dev/null
+++ b/tests/012.sh
@@ -0,0 +1,17 @@
+set -e
+
+bash ../../test_exit_code.sh 25 <<'EOF'
+int main() {
+ int i;
+ int ret;
+ i = 0;
+ ret = 0;
+ for (i = 0; i < 10; i = i + 1) {
+ if (i % 2 == 0) {
+ continue;
+ }
+ ret = ret + i;
+ }
+ return ret;
+}
+EOF
diff --git a/tests/013.sh b/tests/013.sh
new file mode 100644
index 0000000..8381d0e
--- /dev/null
+++ b/tests/013.sh
@@ -0,0 +1,17 @@
+set -e
+
+bash ../../test_exit_code.sh 66 <<'EOF'
+int main() {
+ int i;
+ int ret;
+ i = 0;
+ ret = 0;
+ for (i = 0; i < 100; i = i + 1) {
+ if (i == 12) {
+ break;
+ }
+ ret = ret + i;
+ }
+ return ret;
+}
+EOF