From c9db0a305dd5263ff94bd1254b359a3357c1cd0f Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Tue, 5 Nov 2024 13:10:31 -0800 Subject: [PATCH] Nested loop test case Signed-off-by: Alan Jowett --- test-data/loop.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test-data/loop.yaml b/test-data/loop.yaml index dd6e76005..d6af4f4d8 100644 --- a/test-data/loop.yaml +++ b/test-data/loop.yaml @@ -440,3 +440,27 @@ post: - pc[2]=1 messages: [] + +--- +# Nested loops with inner infinite loop +test-case: nested loops with inner infinite loop +options: ["termination"] + +pre: + - "r0.type=number" + - "r0.svalue=0" + - "r0.uvalue=0" +code: + : | + r0 += 1 + if r0 > 10 goto + : | + if r0 > 0 goto + : | + exit + +post: [] +messages: + - "1:3: Code is unreachable after 1:3" + - "2: Loop counter is too large (pc[2] < 100000)" + - "2:3: Code is unreachable after 2:3" \ No newline at end of file