From 15acce32193bb710ca2fa4f70c0b481d92669cac Mon Sep 17 00:00:00 2001 From: Christian Gram Kalhauge <chrg@dtu.dk> Date: Sun, 10 Mar 2024 00:24:23 +0100 Subject: [PATCH] Work work! --- rtree-c/src/ReduceC.hs | 102 ++++++++++-------- .../for/reduction/{r000000.c => r0000000.c} | 1 + .../reduction/{r000000.c.hs => r0000000.c.hs} | 0 .../for/reduction/{r000001.c => r0000001.c} | 1 + .../reduction/{r000001.c.hs => r0000001.c.hs} | 0 .../test/expected/for/reduction/r00000100.c | 16 +++ .../{r000010.c.hs => r00000100.c.hs} | 0 .../test/expected/for/reduction/r000001010.c | 16 +++ .../{r000011.c.hs => r000001010.c.hs} | 0 .../test/expected/for/reduction/r0000010110.c | 15 +++ .../{r00010.c.hs => r0000010110.c.hs} | 0 .../test/expected/for/reduction/r0000010111.c | 15 +++ .../{r00011.c.hs => r0000010111.c.hs} | 0 .../test/expected/for/reduction/r00000110.c | 16 +++ .../reduction/{r0010.c.hs => r00000110.c.hs} | 0 .../test/expected/for/reduction/r000001110.c | 16 +++ .../reduction/{r0011.c.hs => r000001110.c.hs} | 0 .../test/expected/for/reduction/r0000011110.c | 15 +++ .../{r010000.c.hs => r0000011110.c.hs} | 0 .../test/expected/for/reduction/r0000011111.c | 15 +++ .../{r010001.c.hs => r0000011111.c.hs} | 0 .../for/reduction/{r000010.c => r0000100.c} | 1 + .../reduction/{r010010.c.hs => r0000100.c.hs} | 0 .../for/reduction/{r000011.c => r0000101.c} | 1 + .../reduction/{r010011.c.hs => r0000101.c.hs} | 0 .../test/expected/for/reduction/r00001100.c | 16 +++ .../reduction/{r01010.c.hs => r00001100.c.hs} | 0 .../test/expected/for/reduction/r000011010.c | 16 +++ .../{r01011.c.hs => r000011010.c.hs} | 0 .../test/expected/for/reduction/r0000110110.c | 15 +++ .../{r0110.c.hs => r0000110110.c.hs} | 0 .../test/expected/for/reduction/r0000110111.c | 15 +++ .../{r0111.c.hs => r0000110111.c.hs} | 0 .../test/expected/for/reduction/r00001110.c | 16 +++ .../reduction/{r10.c.hs => r00001110.c.hs} | 0 .../test/expected/for/reduction/r000011110.c | 16 +++ .../reduction/{r11.c.hs => r000011110.c.hs} | 0 .../test/expected/for/reduction/r0000111110.c | 15 +++ .../expected/for/reduction/r0000111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0000111111.c | 15 +++ .../expected/for/reduction/r0000111111.c.hs | 57 ++++++++++ .../for/reduction/{r00010.c => r000100.c} | 1 + .../test/expected/for/reduction/r000100.c.hs | 57 ++++++++++ .../for/reduction/{r00011.c => r000101.c} | 1 + .../test/expected/for/reduction/r000101.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0001100.c | 15 +++ .../test/expected/for/reduction/r0001100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00011010.c | 15 +++ .../expected/for/reduction/r00011010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r000110110.c | 14 +++ .../expected/for/reduction/r000110110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r000110111.c | 14 +++ .../expected/for/reduction/r000110111.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0001110.c | 15 +++ .../test/expected/for/reduction/r0001110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00011110.c | 15 +++ .../expected/for/reduction/r00011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r000111110.c | 14 +++ .../expected/for/reduction/r000111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r000111111.c | 14 +++ .../expected/for/reduction/r000111111.c.hs | 57 ++++++++++ .../for/reduction/{r0010.c => r00100.c} | 1 + .../test/expected/for/reduction/r00100.c.hs | 57 ++++++++++ .../for/reduction/{r0011.c => r00101.c} | 1 + .../test/expected/for/reduction/r00101.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r001100.c | 14 +++ .../test/expected/for/reduction/r001100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0011010.c | 14 +++ .../test/expected/for/reduction/r0011010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00110110.c | 13 +++ .../expected/for/reduction/r00110110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00110111.c | 13 +++ .../expected/for/reduction/r00110111.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r001110.c | 14 +++ .../test/expected/for/reduction/r001110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0011110.c | 14 +++ .../test/expected/for/reduction/r0011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00111110.c | 13 +++ .../expected/for/reduction/r00111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r00111111.c | 13 +++ .../expected/for/reduction/r00111111.c.hs | 57 ++++++++++ .../for/reduction/{r010000.c => r0100000.c} | 1 + .../test/expected/for/reduction/r0100000.c.hs | 57 ++++++++++ .../for/reduction/{r010001.c => r0100001.c} | 1 + .../test/expected/for/reduction/r0100001.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01000100.c | 16 +++ .../expected/for/reduction/r01000100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010001010.c | 16 +++ .../expected/for/reduction/r010001010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100010110.c | 15 +++ .../expected/for/reduction/r0100010110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100010111.c | 15 +++ .../expected/for/reduction/r0100010111.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01000110.c | 16 +++ .../expected/for/reduction/r01000110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010001110.c | 16 +++ .../expected/for/reduction/r010001110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100011110.c | 15 +++ .../expected/for/reduction/r0100011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100011111.c | 15 +++ .../expected/for/reduction/r0100011111.c.hs | 57 ++++++++++ .../for/reduction/{r010010.c => r0100100.c} | 1 + .../test/expected/for/reduction/r0100100.c.hs | 57 ++++++++++ .../for/reduction/{r010011.c => r0100101.c} | 1 + .../test/expected/for/reduction/r0100101.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01001100.c | 16 +++ .../expected/for/reduction/r01001100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010011010.c | 16 +++ .../expected/for/reduction/r010011010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100110110.c | 15 +++ .../expected/for/reduction/r0100110110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100110111.c | 15 +++ .../expected/for/reduction/r0100110111.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01001110.c | 16 +++ .../expected/for/reduction/r01001110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010011110.c | 16 +++ .../expected/for/reduction/r010011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100111110.c | 15 +++ .../expected/for/reduction/r0100111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0100111111.c | 15 +++ .../expected/for/reduction/r0100111111.c.hs | 57 ++++++++++ .../for/reduction/{r01010.c => r010100.c} | 1 + .../test/expected/for/reduction/r010100.c.hs | 57 ++++++++++ .../for/reduction/{r01011.c => r010101.c} | 1 + .../test/expected/for/reduction/r010101.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0101100.c | 15 +++ .../test/expected/for/reduction/r0101100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01011010.c | 15 +++ .../expected/for/reduction/r01011010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010110110.c | 14 +++ .../expected/for/reduction/r010110110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010110111.c | 14 +++ .../expected/for/reduction/r010110111.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0101110.c | 15 +++ .../test/expected/for/reduction/r0101110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01011110.c | 15 +++ .../expected/for/reduction/r01011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010111110.c | 14 +++ .../expected/for/reduction/r010111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r010111111.c | 14 +++ .../expected/for/reduction/r010111111.c.hs | 57 ++++++++++ .../for/reduction/{r0110.c => r01100.c} | 1 + .../test/expected/for/reduction/r01100.c.hs | 57 ++++++++++ .../for/reduction/{r0111.c => r01101.c} | 1 + .../test/expected/for/reduction/r01101.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r011100.c | 14 +++ .../test/expected/for/reduction/r011100.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0111010.c | 14 +++ .../test/expected/for/reduction/r0111010.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01110110.c | 13 +++ .../expected/for/reduction/r01110110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01110111.c | 13 +++ .../expected/for/reduction/r01110111.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r011110.c | 14 +++ .../test/expected/for/reduction/r011110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r0111110.c | 14 +++ .../test/expected/for/reduction/r0111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01111110.c | 13 +++ .../expected/for/reduction/r01111110.c.hs | 57 ++++++++++ .../test/expected/for/reduction/r01111111.c | 13 +++ .../expected/for/reduction/r01111111.c.hs | 57 ++++++++++ .../expected/for/reduction/{r10.c => r100.c} | 1 + rtree-c/test/expected/for/reduction/r100.c.hs | 57 ++++++++++ .../expected/for/reduction/{r11.c => r101.c} | 1 + rtree-c/test/expected/for/reduction/r101.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r1100.c | 11 ++ .../test/expected/for/reduction/r1100.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r11010.c | 11 ++ .../test/expected/for/reduction/r11010.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r110110.c | 10 ++ .../test/expected/for/reduction/r110110.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r110111.c | 10 ++ .../test/expected/for/reduction/r110111.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r1110.c | 11 ++ .../test/expected/for/reduction/r1110.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r11110.c | 11 ++ .../test/expected/for/reduction/r11110.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r111110.c | 10 ++ .../test/expected/for/reduction/r111110.c.hs | 57 ++++++++++ rtree-c/test/expected/for/reduction/r111111.c | 10 ++ .../test/expected/for/reduction/r111111.c.hs | 57 ++++++++++ 181 files changed, 5209 insertions(+), 43 deletions(-) rename rtree-c/test/expected/for/reduction/{r000000.c => r0000000.c} (86%) rename rtree-c/test/expected/for/reduction/{r000000.c.hs => r0000000.c.hs} (100%) rename rtree-c/test/expected/for/reduction/{r000001.c => r0000001.c} (86%) rename rtree-c/test/expected/for/reduction/{r000001.c.hs => r0000001.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r00000100.c rename rtree-c/test/expected/for/reduction/{r000010.c.hs => r00000100.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r000001010.c rename rtree-c/test/expected/for/reduction/{r000011.c.hs => r000001010.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000010110.c rename rtree-c/test/expected/for/reduction/{r00010.c.hs => r0000010110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000010111.c rename rtree-c/test/expected/for/reduction/{r00011.c.hs => r0000010111.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r00000110.c rename rtree-c/test/expected/for/reduction/{r0010.c.hs => r00000110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r000001110.c rename rtree-c/test/expected/for/reduction/{r0011.c.hs => r000001110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000011110.c rename rtree-c/test/expected/for/reduction/{r010000.c.hs => r0000011110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000011111.c rename rtree-c/test/expected/for/reduction/{r010001.c.hs => r0000011111.c.hs} (100%) rename rtree-c/test/expected/for/reduction/{r000010.c => r0000100.c} (86%) rename rtree-c/test/expected/for/reduction/{r010010.c.hs => r0000100.c.hs} (100%) rename rtree-c/test/expected/for/reduction/{r000011.c => r0000101.c} (86%) rename rtree-c/test/expected/for/reduction/{r010011.c.hs => r0000101.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r00001100.c rename rtree-c/test/expected/for/reduction/{r01010.c.hs => r00001100.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r000011010.c rename rtree-c/test/expected/for/reduction/{r01011.c.hs => r000011010.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000110110.c rename rtree-c/test/expected/for/reduction/{r0110.c.hs => r0000110110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000110111.c rename rtree-c/test/expected/for/reduction/{r0111.c.hs => r0000110111.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r00001110.c rename rtree-c/test/expected/for/reduction/{r10.c.hs => r00001110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r000011110.c rename rtree-c/test/expected/for/reduction/{r11.c.hs => r000011110.c.hs} (100%) create mode 100644 rtree-c/test/expected/for/reduction/r0000111110.c create mode 100644 rtree-c/test/expected/for/reduction/r0000111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0000111111.c create mode 100644 rtree-c/test/expected/for/reduction/r0000111111.c.hs rename rtree-c/test/expected/for/reduction/{r00010.c => r000100.c} (84%) create mode 100644 rtree-c/test/expected/for/reduction/r000100.c.hs rename rtree-c/test/expected/for/reduction/{r00011.c => r000101.c} (84%) create mode 100644 rtree-c/test/expected/for/reduction/r000101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0001100.c create mode 100644 rtree-c/test/expected/for/reduction/r0001100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00011010.c create mode 100644 rtree-c/test/expected/for/reduction/r00011010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r000110110.c create mode 100644 rtree-c/test/expected/for/reduction/r000110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r000110111.c create mode 100644 rtree-c/test/expected/for/reduction/r000110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0001110.c create mode 100644 rtree-c/test/expected/for/reduction/r0001110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00011110.c create mode 100644 rtree-c/test/expected/for/reduction/r00011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r000111110.c create mode 100644 rtree-c/test/expected/for/reduction/r000111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r000111111.c create mode 100644 rtree-c/test/expected/for/reduction/r000111111.c.hs rename rtree-c/test/expected/for/reduction/{r0010.c => r00100.c} (81%) create mode 100644 rtree-c/test/expected/for/reduction/r00100.c.hs rename rtree-c/test/expected/for/reduction/{r0011.c => r00101.c} (81%) create mode 100644 rtree-c/test/expected/for/reduction/r00101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r001100.c create mode 100644 rtree-c/test/expected/for/reduction/r001100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0011010.c create mode 100644 rtree-c/test/expected/for/reduction/r0011010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00110110.c create mode 100644 rtree-c/test/expected/for/reduction/r00110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00110111.c create mode 100644 rtree-c/test/expected/for/reduction/r00110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r001110.c create mode 100644 rtree-c/test/expected/for/reduction/r001110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0011110.c create mode 100644 rtree-c/test/expected/for/reduction/r0011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00111110.c create mode 100644 rtree-c/test/expected/for/reduction/r00111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r00111111.c create mode 100644 rtree-c/test/expected/for/reduction/r00111111.c.hs rename rtree-c/test/expected/for/reduction/{r010000.c => r0100000.c} (86%) create mode 100644 rtree-c/test/expected/for/reduction/r0100000.c.hs rename rtree-c/test/expected/for/reduction/{r010001.c => r0100001.c} (86%) create mode 100644 rtree-c/test/expected/for/reduction/r0100001.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01000100.c create mode 100644 rtree-c/test/expected/for/reduction/r01000100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010001010.c create mode 100644 rtree-c/test/expected/for/reduction/r010001010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100010110.c create mode 100644 rtree-c/test/expected/for/reduction/r0100010110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100010111.c create mode 100644 rtree-c/test/expected/for/reduction/r0100010111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01000110.c create mode 100644 rtree-c/test/expected/for/reduction/r01000110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010001110.c create mode 100644 rtree-c/test/expected/for/reduction/r010001110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100011110.c create mode 100644 rtree-c/test/expected/for/reduction/r0100011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100011111.c create mode 100644 rtree-c/test/expected/for/reduction/r0100011111.c.hs rename rtree-c/test/expected/for/reduction/{r010010.c => r0100100.c} (85%) create mode 100644 rtree-c/test/expected/for/reduction/r0100100.c.hs rename rtree-c/test/expected/for/reduction/{r010011.c => r0100101.c} (85%) create mode 100644 rtree-c/test/expected/for/reduction/r0100101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01001100.c create mode 100644 rtree-c/test/expected/for/reduction/r01001100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010011010.c create mode 100644 rtree-c/test/expected/for/reduction/r010011010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100110110.c create mode 100644 rtree-c/test/expected/for/reduction/r0100110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100110111.c create mode 100644 rtree-c/test/expected/for/reduction/r0100110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01001110.c create mode 100644 rtree-c/test/expected/for/reduction/r01001110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010011110.c create mode 100644 rtree-c/test/expected/for/reduction/r010011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100111110.c create mode 100644 rtree-c/test/expected/for/reduction/r0100111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0100111111.c create mode 100644 rtree-c/test/expected/for/reduction/r0100111111.c.hs rename rtree-c/test/expected/for/reduction/{r01010.c => r010100.c} (83%) create mode 100644 rtree-c/test/expected/for/reduction/r010100.c.hs rename rtree-c/test/expected/for/reduction/{r01011.c => r010101.c} (83%) create mode 100644 rtree-c/test/expected/for/reduction/r010101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0101100.c create mode 100644 rtree-c/test/expected/for/reduction/r0101100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01011010.c create mode 100644 rtree-c/test/expected/for/reduction/r01011010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010110110.c create mode 100644 rtree-c/test/expected/for/reduction/r010110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010110111.c create mode 100644 rtree-c/test/expected/for/reduction/r010110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0101110.c create mode 100644 rtree-c/test/expected/for/reduction/r0101110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01011110.c create mode 100644 rtree-c/test/expected/for/reduction/r01011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010111110.c create mode 100644 rtree-c/test/expected/for/reduction/r010111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r010111111.c create mode 100644 rtree-c/test/expected/for/reduction/r010111111.c.hs rename rtree-c/test/expected/for/reduction/{r0110.c => r01100.c} (81%) create mode 100644 rtree-c/test/expected/for/reduction/r01100.c.hs rename rtree-c/test/expected/for/reduction/{r0111.c => r01101.c} (81%) create mode 100644 rtree-c/test/expected/for/reduction/r01101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r011100.c create mode 100644 rtree-c/test/expected/for/reduction/r011100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0111010.c create mode 100644 rtree-c/test/expected/for/reduction/r0111010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01110110.c create mode 100644 rtree-c/test/expected/for/reduction/r01110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01110111.c create mode 100644 rtree-c/test/expected/for/reduction/r01110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r011110.c create mode 100644 rtree-c/test/expected/for/reduction/r011110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r0111110.c create mode 100644 rtree-c/test/expected/for/reduction/r0111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01111110.c create mode 100644 rtree-c/test/expected/for/reduction/r01111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r01111111.c create mode 100644 rtree-c/test/expected/for/reduction/r01111111.c.hs rename rtree-c/test/expected/for/reduction/{r10.c => r100.c} (71%) create mode 100644 rtree-c/test/expected/for/reduction/r100.c.hs rename rtree-c/test/expected/for/reduction/{r11.c => r101.c} (71%) create mode 100644 rtree-c/test/expected/for/reduction/r101.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r1100.c create mode 100644 rtree-c/test/expected/for/reduction/r1100.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r11010.c create mode 100644 rtree-c/test/expected/for/reduction/r11010.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r110110.c create mode 100644 rtree-c/test/expected/for/reduction/r110110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r110111.c create mode 100644 rtree-c/test/expected/for/reduction/r110111.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r1110.c create mode 100644 rtree-c/test/expected/for/reduction/r1110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r11110.c create mode 100644 rtree-c/test/expected/for/reduction/r11110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r111110.c create mode 100644 rtree-c/test/expected/for/reduction/r111110.c.hs create mode 100644 rtree-c/test/expected/for/reduction/r111111.c create mode 100644 rtree-c/test/expected/for/reduction/r111111.c.hs diff --git a/rtree-c/src/ReduceC.hs b/rtree-c/src/ReduceC.hs index 59c9919..a94ca0b 100644 --- a/rtree-c/src/ReduceC.hs +++ b/rtree-c/src/ReduceC.hs @@ -165,35 +165,41 @@ reduceCExternalDeclaration r ctx = case r of pure (Just $ C.CFDefExt <$> reduceCFunDef fun ctx, ctx) | otherwise -> case functionName fun of - Just fid -> do - let nctx = - ctx & foldr \case - (Just t, Just i) -> addInlineExpr i (IEKeep t) - (Nothing, Just i) -> addInlineExpr i IEDelete - (_, Nothing) -> id - let red fun' ps = reduceCFunDef fun' (nctx ps) - case Map.lookup fid . inlineExprs $ ctx of - Just (IEKeep (CTFun args)) -> do - (fun', ps) <- reduceParamsTo args fun - pure - ( Just (C.CFDefExt <$> red fun' ps) - , addInlineExpr fid (IEKeep (CTFun (map fst ps))) ctx - ) - _ow -> do - split - ("remove function " <> C.identToString fid, C.posOf r) - (pure (Nothing, addInlineExpr fid IEDelete ctx)) - do - (fun', ps) <- reduceParams ctx fun + Just fid + | shouldDeleteFunction ctx fun -> do + pure (Nothing, addInlineExpr fid IEDelete ctx) + | otherwise -> do + let nctx = + ctx & foldr \case + (Just t, Just i) -> addInlineExpr i (IEKeep t) + (Nothing, Just i) -> addInlineExpr i IEDelete + (_, Nothing) -> id + let red fun' ps = reduceCFunDef fun' (nctx ps) + case Map.lookup fid . inlineExprs $ ctx of + Just (IEKeep (CTFun args)) -> do + (fun', ps) <- reduceParamsTo args fun pure ( Just (C.CFDefExt <$> red fun' ps) , addInlineExpr fid (IEKeep (CTFun (map fst ps))) ctx ) - Nothing -> - split - ("remove function", C.posOf r) - (pure (Nothing, ctx)) - (pure (Just (C.CFDefExt <$> reduceCFunDef fun ctx), ctx)) + _ow -> do + split + ("remove function " <> C.identToString fid, C.posOf r) + (pure (Nothing, addInlineExpr fid IEDelete ctx)) + do + (fun', ps) <- reduceParams ctx fun + pure + ( Just (C.CFDefExt <$> red fun' ps) + , addInlineExpr fid (IEKeep (CTFun (map fst ps))) ctx + ) + Nothing + | shouldDeleteFunction ctx fun -> do + pure (Nothing, ctx) + | otherwise -> do + split + ("remove function", C.posOf r) + (pure (Nothing, ctx)) + (pure (Just (C.CFDefExt <$> reduceCFunDef fun ctx), ctx)) C.CDeclExt decl -> do (decl', ctx') <- handleDecl decl ctx case decl' of @@ -600,21 +606,26 @@ reduceCStatement smt labs ctx = case smt of C.CFor e1 e2 e3 s ni -> do (me1', ctx') <- case e1 of C.CForDecl d@(C.CDecl rec decl ni') -> do - (decl', ctx') <- foldr (reduceCDeclarationItem (shouldDeleteDeclaration ctx d) (ctype ctx rec)) (pure ([], ctx)) decl + (decl', ctx') <- + foldr + (reduceCDeclarationItem (shouldDeleteDeclaration ctx d) (ctype ctx rec)) + (pure ([], ctx)) + decl res <- if null decl' then - whenSplit - (AllowEmptyDeclarations `isIn` ctx') - ("remove empty declaration", C.posOf ni') - (pure Nothing) - (pure $ Just $ C.CForDecl (C.CDecl rec decl' ni')) + if AllowEmptyDeclarations `isIn` ctx' + then + split + ("remove empty declaration", C.posOf ni') + (pure Nothing) + (pure $ Just $ C.CForDecl (C.CDecl rec decl' ni')) + else pure Nothing else pure $ Just $ C.CForDecl (C.CDecl rec decl' ni') pure (res, ctx') C.CForInitializing e -> do e' <- maybeSplit ("remove initializer", C.posOf ni) (e >>= \e' -> reduceCExpr e' ctx) - whenSplit - (AllowEmptyDeclarations `isIn` ctx) + split ("remove empty declaration", C.posOf ni) (pure (Nothing, ctx)) (pure (Just $ C.CForInitializing e', ctx)) @@ -867,10 +878,14 @@ inlineTypeDefsCDeclaration decl ctx = C.CDecl (inlineTypeDefsSpecs items ctx) (map (`inlineTypeDefsCDI` ctx) decli) ni a -> don'tHandle a +shouldDeleteFunction :: Context -> C.CFunctionDef C.NodeInfo -> Bool +shouldDeleteFunction ctx (C.CFunDef spec _ _ _ _) = + any (shouldDeleteDeclSpec ctx) spec + shouldDeleteDeclaration :: Context -> C.CDeclaration C.NodeInfo -> Bool shouldDeleteDeclaration ctx decl = case decl of - C.CDecl items decli _ -> any shouldDeleteDeclSpec items || any shouldDeleteDeclItem decli + C.CDecl items decli _ -> any (shouldDeleteDeclSpec ctx) items || any shouldDeleteDeclItem decli a -> don'tHandle a where shouldDeleteDeclItem = \case @@ -887,15 +902,16 @@ shouldDeleteDeclaration ctx decl = C.CPtrDeclr _ _ -> False a -> don'tHandle a - shouldDeleteDeclSpec = \case - C.CTypeSpec (C.CSUType (C.CStruct _ (Just idx) Nothing _ _) _) -> - case Map.lookup idx . structs $ ctx of - Just ISDelete -> True - Just ISKeep -> False - Nothing -> error ("could not find struct:" <> show idx) - C.CTypeSpec (C.CSUType (C.CStruct _ _ (Just c) _ _) _) -> - any (shouldDeleteDeclaration ctx) c - _ow -> False +shouldDeleteDeclSpec :: Context -> C.CDeclarationSpecifier C.NodeInfo -> Bool +shouldDeleteDeclSpec ctx = \case + C.CTypeSpec (C.CSUType (C.CStruct _ (Just idx) Nothing _ _) _) -> + case Map.lookup idx . structs $ ctx of + Just ISDelete -> True + Just ISKeep -> False + Nothing -> error ("could not find struct:" <> show idx) + C.CTypeSpec (C.CSUType (C.CStruct _ _ (Just c) _ _) _) -> + any (shouldDeleteDeclaration ctx) c + _ow -> False inlineTypeDefsSpecs :: [C.CDeclarationSpecifier C.NodeInfo] -> Context -> [C.CDeclarationSpecifier C.NodeInfo] inlineTypeDefsSpecs r ctx = diff --git a/rtree-c/test/expected/for/reduction/r000000.c b/rtree-c/test/expected/for/reduction/r0000000.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r000000.c rename to rtree-c/test/expected/for/reduction/r0000000.c index cb0ad0b..16e5ccb 100644 --- a/rtree-c/test/expected/for/reduction/r000000.c +++ b/rtree-c/test/expected/for/reduction/r0000000.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 0 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r000000.c.hs b/rtree-c/test/expected/for/reduction/r0000000.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r000000.c.hs rename to rtree-c/test/expected/for/reduction/r0000000.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000001.c b/rtree-c/test/expected/for/reduction/r0000001.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r000001.c rename to rtree-c/test/expected/for/reduction/r0000001.c index 8300117..e605132 100644 --- a/rtree-c/test/expected/for/reduction/r000001.c +++ b/rtree-c/test/expected/for/reduction/r0000001.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 0 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r000001.c.hs b/rtree-c/test/expected/for/reduction/r0000001.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r000001.c.hs rename to rtree-c/test/expected/for/reduction/r0000001.c.hs diff --git a/rtree-c/test/expected/for/reduction/r00000100.c b/rtree-c/test/expected/for/reduction/r00000100.c new file mode 100644 index 0000000..d4ade4e --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00000100.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r000010.c.hs b/rtree-c/test/expected/for/reduction/r00000100.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r000010.c.hs rename to rtree-c/test/expected/for/reduction/r00000100.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000001010.c b/rtree-c/test/expected/for/reduction/r000001010.c new file mode 100644 index 0000000..0f15f2a --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000001010.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r000011.c.hs b/rtree-c/test/expected/for/reduction/r000001010.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r000011.c.hs rename to rtree-c/test/expected/for/reduction/r000001010.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000010110.c b/rtree-c/test/expected/for/reduction/r0000010110.c new file mode 100644 index 0000000..b55bf5a --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000010110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00010.c.hs b/rtree-c/test/expected/for/reduction/r0000010110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r00010.c.hs rename to rtree-c/test/expected/for/reduction/r0000010110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000010111.c b/rtree-c/test/expected/for/reduction/r0000010111.c new file mode 100644 index 0000000..3cc0f2b --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000010111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00011.c.hs b/rtree-c/test/expected/for/reduction/r0000010111.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r00011.c.hs rename to rtree-c/test/expected/for/reduction/r0000010111.c.hs diff --git a/rtree-c/test/expected/for/reduction/r00000110.c b/rtree-c/test/expected/for/reduction/r00000110.c new file mode 100644 index 0000000..f2bde6b --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00000110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0010.c.hs b/rtree-c/test/expected/for/reduction/r00000110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r0010.c.hs rename to rtree-c/test/expected/for/reduction/r00000110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000001110.c b/rtree-c/test/expected/for/reduction/r000001110.c new file mode 100644 index 0000000..e159471 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000001110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0011.c.hs b/rtree-c/test/expected/for/reduction/r000001110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r0011.c.hs rename to rtree-c/test/expected/for/reduction/r000001110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000011110.c b/rtree-c/test/expected/for/reduction/r0000011110.c new file mode 100644 index 0000000..93de9e9 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000011110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010000.c.hs b/rtree-c/test/expected/for/reduction/r0000011110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r010000.c.hs rename to rtree-c/test/expected/for/reduction/r0000011110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000011111.c b/rtree-c/test/expected/for/reduction/r0000011111.c new file mode 100644 index 0000000..7900a96 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000011111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010001.c.hs b/rtree-c/test/expected/for/reduction/r0000011111.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r010001.c.hs rename to rtree-c/test/expected/for/reduction/r0000011111.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000010.c b/rtree-c/test/expected/for/reduction/r0000100.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r000010.c rename to rtree-c/test/expected/for/reduction/r0000100.c index 958c7b6..a16d8f3 100644 --- a/rtree-c/test/expected/for/reduction/r000010.c +++ b/rtree-c/test/expected/for/reduction/r0000100.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 1 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r010010.c.hs b/rtree-c/test/expected/for/reduction/r0000100.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r010010.c.hs rename to rtree-c/test/expected/for/reduction/r0000100.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000011.c b/rtree-c/test/expected/for/reduction/r0000101.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r000011.c rename to rtree-c/test/expected/for/reduction/r0000101.c index 3e1f08b..0d6c9fc 100644 --- a/rtree-c/test/expected/for/reduction/r000011.c +++ b/rtree-c/test/expected/for/reduction/r0000101.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 1 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r010011.c.hs b/rtree-c/test/expected/for/reduction/r0000101.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r010011.c.hs rename to rtree-c/test/expected/for/reduction/r0000101.c.hs diff --git a/rtree-c/test/expected/for/reduction/r00001100.c b/rtree-c/test/expected/for/reduction/r00001100.c new file mode 100644 index 0000000..4ee8e20 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00001100.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01010.c.hs b/rtree-c/test/expected/for/reduction/r00001100.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r01010.c.hs rename to rtree-c/test/expected/for/reduction/r00001100.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000011010.c b/rtree-c/test/expected/for/reduction/r000011010.c new file mode 100644 index 0000000..452a5b2 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000011010.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01011.c.hs b/rtree-c/test/expected/for/reduction/r000011010.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r01011.c.hs rename to rtree-c/test/expected/for/reduction/r000011010.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000110110.c b/rtree-c/test/expected/for/reduction/r0000110110.c new file mode 100644 index 0000000..5cb8f9b --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000110110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0110.c.hs b/rtree-c/test/expected/for/reduction/r0000110110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r0110.c.hs rename to rtree-c/test/expected/for/reduction/r0000110110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000110111.c b/rtree-c/test/expected/for/reduction/r0000110111.c new file mode 100644 index 0000000..8bf9c69 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000110111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0111.c.hs b/rtree-c/test/expected/for/reduction/r0000110111.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r0111.c.hs rename to rtree-c/test/expected/for/reduction/r0000110111.c.hs diff --git a/rtree-c/test/expected/for/reduction/r00001110.c b/rtree-c/test/expected/for/reduction/r00001110.c new file mode 100644 index 0000000..6a8dad7 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00001110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r10.c.hs b/rtree-c/test/expected/for/reduction/r00001110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r10.c.hs rename to rtree-c/test/expected/for/reduction/r00001110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r000011110.c b/rtree-c/test/expected/for/reduction/r000011110.c new file mode 100644 index 0000000..fc9cbc4 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000011110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r11.c.hs b/rtree-c/test/expected/for/reduction/r000011110.c.hs similarity index 100% rename from rtree-c/test/expected/for/reduction/r11.c.hs rename to rtree-c/test/expected/for/reduction/r000011110.c.hs diff --git a/rtree-c/test/expected/for/reduction/r0000111110.c b/rtree-c/test/expected/for/reduction/r0000111110.c new file mode 100644 index 0000000..a1971e2 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000111110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0000111110.c.hs b/rtree-c/test/expected/for/reduction/r0000111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0000111111.c b/rtree-c/test/expected/for/reduction/r0000111111.c new file mode 100644 index 0000000..fc9547d --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000111111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0000111111.c.hs b/rtree-c/test/expected/for/reduction/r0000111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0000111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00010.c b/rtree-c/test/expected/for/reduction/r000100.c similarity index 84% rename from rtree-c/test/expected/for/reduction/r00010.c rename to rtree-c/test/expected/for/reduction/r000100.c index a58f913..7223f91 100644 --- a/rtree-c/test/expected/for/reduction/r00010.c +++ b/rtree-c/test/expected/for/reduction/r000100.c @@ -2,6 +2,7 @@ // 0 remove static at ("test/cases/small/for.c": line 1) // 0 remove initializer at ("test/cases/small/for.c": line 4) // 1 reduce to left at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r000100.c.hs b/rtree-c/test/expected/for/reduction/r000100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00011.c b/rtree-c/test/expected/for/reduction/r000101.c similarity index 84% rename from rtree-c/test/expected/for/reduction/r00011.c rename to rtree-c/test/expected/for/reduction/r000101.c index b988cd7..43936b0 100644 --- a/rtree-c/test/expected/for/reduction/r00011.c +++ b/rtree-c/test/expected/for/reduction/r000101.c @@ -2,6 +2,7 @@ // 0 remove static at ("test/cases/small/for.c": line 1) // 0 remove initializer at ("test/cases/small/for.c": line 4) // 1 reduce to left at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r000101.c.hs b/rtree-c/test/expected/for/reduction/r000101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0001100.c b/rtree-c/test/expected/for/reduction/r0001100.c new file mode 100644 index 0000000..b560a1f --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0001100.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0001100.c.hs b/rtree-c/test/expected/for/reduction/r0001100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0001100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00011010.c b/rtree-c/test/expected/for/reduction/r00011010.c new file mode 100644 index 0000000..d027c29 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00011010.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r00011010.c.hs b/rtree-c/test/expected/for/reduction/r00011010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00011010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r000110110.c b/rtree-c/test/expected/for/reduction/r000110110.c new file mode 100644 index 0000000..6fb6880 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000110110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r000110110.c.hs b/rtree-c/test/expected/for/reduction/r000110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r000110111.c b/rtree-c/test/expected/for/reduction/r000110111.c new file mode 100644 index 0000000..5f1d72a --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000110111.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r000110111.c.hs b/rtree-c/test/expected/for/reduction/r000110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0001110.c b/rtree-c/test/expected/for/reduction/r0001110.c new file mode 100644 index 0000000..bdd972c --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0001110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0001110.c.hs b/rtree-c/test/expected/for/reduction/r0001110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0001110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00011110.c b/rtree-c/test/expected/for/reduction/r00011110.c new file mode 100644 index 0000000..e061c6b --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00011110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r00011110.c.hs b/rtree-c/test/expected/for/reduction/r00011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r000111110.c b/rtree-c/test/expected/for/reduction/r000111110.c new file mode 100644 index 0000000..c7f2f8e --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000111110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r000111110.c.hs b/rtree-c/test/expected/for/reduction/r000111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r000111111.c b/rtree-c/test/expected/for/reduction/r000111111.c new file mode 100644 index 0000000..94ef7d8 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000111111.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r000111111.c.hs b/rtree-c/test/expected/for/reduction/r000111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r000111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0010.c b/rtree-c/test/expected/for/reduction/r00100.c similarity index 81% rename from rtree-c/test/expected/for/reduction/r0010.c rename to rtree-c/test/expected/for/reduction/r00100.c index d8181bf..451267d 100644 --- a/rtree-c/test/expected/for/reduction/r0010.c +++ b/rtree-c/test/expected/for/reduction/r00100.c @@ -1,6 +1,7 @@ // 0 inline variable a at ("test/cases/small/for.c": line 1) // 0 remove static at ("test/cases/small/for.c": line 1) // 1 remove initializer at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r00100.c.hs b/rtree-c/test/expected/for/reduction/r00100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0011.c b/rtree-c/test/expected/for/reduction/r00101.c similarity index 81% rename from rtree-c/test/expected/for/reduction/r0011.c rename to rtree-c/test/expected/for/reduction/r00101.c index b96bfe1..fe25665 100644 --- a/rtree-c/test/expected/for/reduction/r0011.c +++ b/rtree-c/test/expected/for/reduction/r00101.c @@ -1,6 +1,7 @@ // 0 inline variable a at ("test/cases/small/for.c": line 1) // 0 remove static at ("test/cases/small/for.c": line 1) // 1 remove initializer at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) static int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r00101.c.hs b/rtree-c/test/expected/for/reduction/r00101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r001100.c b/rtree-c/test/expected/for/reduction/r001100.c new file mode 100644 index 0000000..cdb1956 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r001100.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r001100.c.hs b/rtree-c/test/expected/for/reduction/r001100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r001100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0011010.c b/rtree-c/test/expected/for/reduction/r0011010.c new file mode 100644 index 0000000..a8482e2 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0011010.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0011010.c.hs b/rtree-c/test/expected/for/reduction/r0011010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0011010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00110110.c b/rtree-c/test/expected/for/reduction/r00110110.c new file mode 100644 index 0000000..6f7f02a --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00110110.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00110110.c.hs b/rtree-c/test/expected/for/reduction/r00110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00110111.c b/rtree-c/test/expected/for/reduction/r00110111.c new file mode 100644 index 0000000..4168cc5 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00110111.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00110111.c.hs b/rtree-c/test/expected/for/reduction/r00110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r001110.c b/rtree-c/test/expected/for/reduction/r001110.c new file mode 100644 index 0000000..42779b3 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r001110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r001110.c.hs b/rtree-c/test/expected/for/reduction/r001110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r001110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0011110.c b/rtree-c/test/expected/for/reduction/r0011110.c new file mode 100644 index 0000000..427376d --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0011110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +static int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0011110.c.hs b/rtree-c/test/expected/for/reduction/r0011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00111110.c b/rtree-c/test/expected/for/reduction/r00111110.c new file mode 100644 index 0000000..a65f5a8 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00111110.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00111110.c.hs b/rtree-c/test/expected/for/reduction/r00111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r00111111.c b/rtree-c/test/expected/for/reduction/r00111111.c new file mode 100644 index 0000000..2918b44 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00111111.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +static int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r00111111.c.hs b/rtree-c/test/expected/for/reduction/r00111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r00111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010000.c b/rtree-c/test/expected/for/reduction/r0100000.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r010000.c rename to rtree-c/test/expected/for/reduction/r0100000.c index 5fe1c0b..551a5c3 100644 --- a/rtree-c/test/expected/for/reduction/r010000.c +++ b/rtree-c/test/expected/for/reduction/r0100000.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 0 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r0100000.c.hs b/rtree-c/test/expected/for/reduction/r0100000.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100000.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010001.c b/rtree-c/test/expected/for/reduction/r0100001.c similarity index 86% rename from rtree-c/test/expected/for/reduction/r010001.c rename to rtree-c/test/expected/for/reduction/r0100001.c index 4236d05..935910a 100644 --- a/rtree-c/test/expected/for/reduction/r010001.c +++ b/rtree-c/test/expected/for/reduction/r0100001.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 0 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r0100001.c.hs b/rtree-c/test/expected/for/reduction/r0100001.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100001.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01000100.c b/rtree-c/test/expected/for/reduction/r01000100.c new file mode 100644 index 0000000..727cfb5 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01000100.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01000100.c.hs b/rtree-c/test/expected/for/reduction/r01000100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01000100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010001010.c b/rtree-c/test/expected/for/reduction/r010001010.c new file mode 100644 index 0000000..00a3e83 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010001010.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r010001010.c.hs b/rtree-c/test/expected/for/reduction/r010001010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010001010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100010110.c b/rtree-c/test/expected/for/reduction/r0100010110.c new file mode 100644 index 0000000..33b57ca --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100010110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100010110.c.hs b/rtree-c/test/expected/for/reduction/r0100010110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100010110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100010111.c b/rtree-c/test/expected/for/reduction/r0100010111.c new file mode 100644 index 0000000..628e0a3 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100010111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100010111.c.hs b/rtree-c/test/expected/for/reduction/r0100010111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100010111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01000110.c b/rtree-c/test/expected/for/reduction/r01000110.c new file mode 100644 index 0000000..e8c9673 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01000110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01000110.c.hs b/rtree-c/test/expected/for/reduction/r01000110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01000110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010001110.c b/rtree-c/test/expected/for/reduction/r010001110.c new file mode 100644 index 0000000..52ee14f --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010001110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r010001110.c.hs b/rtree-c/test/expected/for/reduction/r010001110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010001110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100011110.c b/rtree-c/test/expected/for/reduction/r0100011110.c new file mode 100644 index 0000000..f7303ef --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100011110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100011110.c.hs b/rtree-c/test/expected/for/reduction/r0100011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100011111.c b/rtree-c/test/expected/for/reduction/r0100011111.c new file mode 100644 index 0000000..7aa9cb0 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100011111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 0 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100011111.c.hs b/rtree-c/test/expected/for/reduction/r0100011111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100011111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010010.c b/rtree-c/test/expected/for/reduction/r0100100.c similarity index 85% rename from rtree-c/test/expected/for/reduction/r010010.c rename to rtree-c/test/expected/for/reduction/r0100100.c index 811a7a6..cd289b0 100644 --- a/rtree-c/test/expected/for/reduction/r010010.c +++ b/rtree-c/test/expected/for/reduction/r0100100.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 1 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r0100100.c.hs b/rtree-c/test/expected/for/reduction/r0100100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010011.c b/rtree-c/test/expected/for/reduction/r0100101.c similarity index 85% rename from rtree-c/test/expected/for/reduction/r010011.c rename to rtree-c/test/expected/for/reduction/r0100101.c index de101b4..0d2dac9 100644 --- a/rtree-c/test/expected/for/reduction/r010011.c +++ b/rtree-c/test/expected/for/reduction/r0100101.c @@ -3,6 +3,7 @@ // 0 remove initializer at ("test/cases/small/for.c": line 4) // 0 reduce to left at ("test/cases/small/for.c": line 4) // 1 reduce to right at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r0100101.c.hs b/rtree-c/test/expected/for/reduction/r0100101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01001100.c b/rtree-c/test/expected/for/reduction/r01001100.c new file mode 100644 index 0000000..41bf838 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01001100.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01001100.c.hs b/rtree-c/test/expected/for/reduction/r01001100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01001100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010011010.c b/rtree-c/test/expected/for/reduction/r010011010.c new file mode 100644 index 0000000..681bcbe --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010011010.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r010011010.c.hs b/rtree-c/test/expected/for/reduction/r010011010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010011010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100110110.c b/rtree-c/test/expected/for/reduction/r0100110110.c new file mode 100644 index 0000000..b618c55 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100110110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100110110.c.hs b/rtree-c/test/expected/for/reduction/r0100110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100110111.c b/rtree-c/test/expected/for/reduction/r0100110111.c new file mode 100644 index 0000000..dee0ec6 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100110111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100110111.c.hs b/rtree-c/test/expected/for/reduction/r0100110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01001110.c b/rtree-c/test/expected/for/reduction/r01001110.c new file mode 100644 index 0000000..d99057c --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01001110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01001110.c.hs b/rtree-c/test/expected/for/reduction/r01001110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01001110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010011110.c b/rtree-c/test/expected/for/reduction/r010011110.c new file mode 100644 index 0000000..ce65e14 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010011110.c @@ -0,0 +1,16 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r010011110.c.hs b/rtree-c/test/expected/for/reduction/r010011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100111110.c b/rtree-c/test/expected/for/reduction/r0100111110.c new file mode 100644 index 0000000..c8f01a0 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100111110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100111110.c.hs b/rtree-c/test/expected/for/reduction/r0100111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0100111111.c b/rtree-c/test/expected/for/reduction/r0100111111.c new file mode 100644 index 0000000..b487967 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100111111.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 0 reduce to left at ("test/cases/small/for.c": line 4) +// 1 reduce to right at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r0100111111.c.hs b/rtree-c/test/expected/for/reduction/r0100111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0100111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01010.c b/rtree-c/test/expected/for/reduction/r010100.c similarity index 83% rename from rtree-c/test/expected/for/reduction/r01010.c rename to rtree-c/test/expected/for/reduction/r010100.c index d0e4bbf..ac032d7 100644 --- a/rtree-c/test/expected/for/reduction/r01010.c +++ b/rtree-c/test/expected/for/reduction/r010100.c @@ -2,6 +2,7 @@ // 1 remove static at ("test/cases/small/for.c": line 1) // 0 remove initializer at ("test/cases/small/for.c": line 4) // 1 reduce to left at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r010100.c.hs b/rtree-c/test/expected/for/reduction/r010100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01011.c b/rtree-c/test/expected/for/reduction/r010101.c similarity index 83% rename from rtree-c/test/expected/for/reduction/r01011.c rename to rtree-c/test/expected/for/reduction/r010101.c index af38507..c2b38ac 100644 --- a/rtree-c/test/expected/for/reduction/r01011.c +++ b/rtree-c/test/expected/for/reduction/r010101.c @@ -2,6 +2,7 @@ // 1 remove static at ("test/cases/small/for.c": line 1) // 0 remove initializer at ("test/cases/small/for.c": line 4) // 1 reduce to left at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r010101.c.hs b/rtree-c/test/expected/for/reduction/r010101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0101100.c b/rtree-c/test/expected/for/reduction/r0101100.c new file mode 100644 index 0000000..d2c4508 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0101100.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0101100.c.hs b/rtree-c/test/expected/for/reduction/r0101100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0101100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01011010.c b/rtree-c/test/expected/for/reduction/r01011010.c new file mode 100644 index 0000000..9484835 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01011010.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01011010.c.hs b/rtree-c/test/expected/for/reduction/r01011010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01011010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010110110.c b/rtree-c/test/expected/for/reduction/r010110110.c new file mode 100644 index 0000000..a93abcc --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010110110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010110110.c.hs b/rtree-c/test/expected/for/reduction/r010110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010110111.c b/rtree-c/test/expected/for/reduction/r010110111.c new file mode 100644 index 0000000..295d6db --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010110111.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010110111.c.hs b/rtree-c/test/expected/for/reduction/r010110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0101110.c b/rtree-c/test/expected/for/reduction/r0101110.c new file mode 100644 index 0000000..95d4584 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0101110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0101110.c.hs b/rtree-c/test/expected/for/reduction/r0101110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0101110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01011110.c b/rtree-c/test/expected/for/reduction/r01011110.c new file mode 100644 index 0000000..55c6663 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01011110.c @@ -0,0 +1,15 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r01011110.c.hs b/rtree-c/test/expected/for/reduction/r01011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010111110.c b/rtree-c/test/expected/for/reduction/r010111110.c new file mode 100644 index 0000000..009a6a5 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010111110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010111110.c.hs b/rtree-c/test/expected/for/reduction/r010111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r010111111.c b/rtree-c/test/expected/for/reduction/r010111111.c new file mode 100644 index 0000000..a54ac82 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010111111.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 0 remove initializer at ("test/cases/small/for.c": line 4) +// 1 reduce to left at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r010111111.c.hs b/rtree-c/test/expected/for/reduction/r010111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r010111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0110.c b/rtree-c/test/expected/for/reduction/r01100.c similarity index 81% rename from rtree-c/test/expected/for/reduction/r0110.c rename to rtree-c/test/expected/for/reduction/r01100.c index a89475b..43f6e00 100644 --- a/rtree-c/test/expected/for/reduction/r0110.c +++ b/rtree-c/test/expected/for/reduction/r01100.c @@ -1,6 +1,7 @@ // 0 inline variable a at ("test/cases/small/for.c": line 1) // 1 remove static at ("test/cases/small/for.c": line 1) // 1 remove initializer at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r01100.c.hs b/rtree-c/test/expected/for/reduction/r01100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0111.c b/rtree-c/test/expected/for/reduction/r01101.c similarity index 81% rename from rtree-c/test/expected/for/reduction/r0111.c rename to rtree-c/test/expected/for/reduction/r01101.c index d936ce0..dac4ee8 100644 --- a/rtree-c/test/expected/for/reduction/r0111.c +++ b/rtree-c/test/expected/for/reduction/r01101.c @@ -1,6 +1,7 @@ // 0 inline variable a at ("test/cases/small/for.c": line 1) // 1 remove static at ("test/cases/small/for.c": line 1) // 1 remove initializer at ("test/cases/small/for.c": line 4) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) int a = 0; diff --git a/rtree-c/test/expected/for/reduction/r01101.c.hs b/rtree-c/test/expected/for/reduction/r01101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r011100.c b/rtree-c/test/expected/for/reduction/r011100.c new file mode 100644 index 0000000..c9e3199 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r011100.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r011100.c.hs b/rtree-c/test/expected/for/reduction/r011100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r011100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0111010.c b/rtree-c/test/expected/for/reduction/r0111010.c new file mode 100644 index 0000000..ccf782e --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0111010.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0111010.c.hs b/rtree-c/test/expected/for/reduction/r0111010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0111010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01110110.c b/rtree-c/test/expected/for/reduction/r01110110.c new file mode 100644 index 0000000..13d0667 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01110110.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r01110110.c.hs b/rtree-c/test/expected/for/reduction/r01110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01110111.c b/rtree-c/test/expected/for/reduction/r01110111.c new file mode 100644 index 0000000..e8d3e2d --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01110111.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r01110111.c.hs b/rtree-c/test/expected/for/reduction/r01110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r011110.c b/rtree-c/test/expected/for/reduction/r011110.c new file mode 100644 index 0000000..dc0e91a --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r011110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r011110.c.hs b/rtree-c/test/expected/for/reduction/r011110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r011110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r0111110.c b/rtree-c/test/expected/for/reduction/r0111110.c new file mode 100644 index 0000000..a9f1a5f --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0111110.c @@ -0,0 +1,14 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int a = 0; +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r0111110.c.hs b/rtree-c/test/expected/for/reduction/r0111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r0111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01111110.c b/rtree-c/test/expected/for/reduction/r01111110.c new file mode 100644 index 0000000..363f670 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01111110.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r01111110.c.hs b/rtree-c/test/expected/for/reduction/r01111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r01111111.c b/rtree-c/test/expected/for/reduction/r01111111.c new file mode 100644 index 0000000..181bd26 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01111111.c @@ -0,0 +1,13 @@ +// 0 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove static at ("test/cases/small/for.c": line 1) +// 1 remove initializer at ("test/cases/small/for.c": line 4) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int a = 0; +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r01111111.c.hs b/rtree-c/test/expected/for/reduction/r01111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r01111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r10.c b/rtree-c/test/expected/for/reduction/r100.c similarity index 71% rename from rtree-c/test/expected/for/reduction/r10.c rename to rtree-c/test/expected/for/reduction/r100.c index 8c7a31c..50e1a8b 100644 --- a/rtree-c/test/expected/for/reduction/r10.c +++ b/rtree-c/test/expected/for/reduction/r100.c @@ -1,4 +1,5 @@ // 1 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 0 remove empty compound at ("test/cases/small/for.c": line 4) int main() diff --git a/rtree-c/test/expected/for/reduction/r100.c.hs b/rtree-c/test/expected/for/reduction/r100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r11.c b/rtree-c/test/expected/for/reduction/r101.c similarity index 71% rename from rtree-c/test/expected/for/reduction/r11.c rename to rtree-c/test/expected/for/reduction/r101.c index c3507ba..13efffc 100644 --- a/rtree-c/test/expected/for/reduction/r11.c +++ b/rtree-c/test/expected/for/reduction/r101.c @@ -1,4 +1,5 @@ // 1 inline variable a at ("test/cases/small/for.c": line 1) +// 0 remove empty declaration at ("test/cases/small/for.c": line 4) // 1 remove empty compound at ("test/cases/small/for.c": line 4) int main() diff --git a/rtree-c/test/expected/for/reduction/r101.c.hs b/rtree-c/test/expected/for/reduction/r101.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r101.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r1100.c b/rtree-c/test/expected/for/reduction/r1100.c new file mode 100644 index 0000000..a28e65f --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r1100.c @@ -0,0 +1,11 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r1100.c.hs b/rtree-c/test/expected/for/reduction/r1100.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r1100.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r11010.c b/rtree-c/test/expected/for/reduction/r11010.c new file mode 100644 index 0000000..8f376c8 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r11010.c @@ -0,0 +1,11 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r11010.c.hs b/rtree-c/test/expected/for/reduction/r11010.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r11010.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r110110.c b/rtree-c/test/expected/for/reduction/r110110.c new file mode 100644 index 0000000..532cc58 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r110110.c @@ -0,0 +1,10 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r110110.c.hs b/rtree-c/test/expected/for/reduction/r110110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r110110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r110111.c b/rtree-c/test/expected/for/reduction/r110111.c new file mode 100644 index 0000000..9398be6 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r110111.c @@ -0,0 +1,10 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r110111.c.hs b/rtree-c/test/expected/for/reduction/r110111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r110111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r1110.c b/rtree-c/test/expected/for/reduction/r1110.c new file mode 100644 index 0000000..0178bd1 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r1110.c @@ -0,0 +1,11 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 0 remove the for loop at ("test/cases/small/for.c": line 4) + +int main() +{ + for (;;) + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r1110.c.hs b/rtree-c/test/expected/for/reduction/r1110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r1110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r11110.c b/rtree-c/test/expected/for/reduction/r11110.c new file mode 100644 index 0000000..58075d0 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r11110.c @@ -0,0 +1,11 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 0 expand compound statment at ("test/cases/small/for.c": line 4) + +int main() +{ + { + } +} diff --git a/rtree-c/test/expected/for/reduction/r11110.c.hs b/rtree-c/test/expected/for/reduction/r11110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r11110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r111110.c b/rtree-c/test/expected/for/reduction/r111110.c new file mode 100644 index 0000000..6cb7def --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r111110.c @@ -0,0 +1,10 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 0 remove empty compound at ("test/cases/small/for.c": line 3) + +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r111110.c.hs b/rtree-c/test/expected/for/reduction/r111110.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r111110.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () diff --git a/rtree-c/test/expected/for/reduction/r111111.c b/rtree-c/test/expected/for/reduction/r111111.c new file mode 100644 index 0000000..e01c6cc --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r111111.c @@ -0,0 +1,10 @@ +// 1 inline variable a at ("test/cases/small/for.c": line 1) +// 1 remove empty declaration at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 4) +// 1 remove the for loop at ("test/cases/small/for.c": line 4) +// 1 expand compound statment at ("test/cases/small/for.c": line 4) +// 1 remove empty compound at ("test/cases/small/for.c": line 3) + +int main() +{ +} diff --git a/rtree-c/test/expected/for/reduction/r111111.c.hs b/rtree-c/test/expected/for/reduction/r111111.c.hs new file mode 100644 index 0000000..844af64 --- /dev/null +++ b/rtree-c/test/expected/for/reduction/r111111.c.hs @@ -0,0 +1,57 @@ +CTranslUnit + [ CDeclExt + ( CDecl + [ CStorageSpec + ( CStatic () ) + , CTypeSpec + ( CIntType () ) + ] + [ CDeclarationItem + ( CDeclr + ( Just + ( Ident "a" 97 () ) + ) [] Nothing [] () + ) + ( Just + ( CInitExpr + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) Nothing + ] () + ) + , CFDefExt + ( CFunDef + [ CTypeSpec + ( CIntType () ) + ] + ( CDeclr + ( Just + ( Ident "main" 232419565 () ) + ) + [ CFunDeclr + ( CFunParamsNew [] False ) [] () + ] Nothing [] () + ) [] + ( CCompound [] + [ CBlockStmt + ( CFor + ( CForInitializing + ( Just + ( CAssign CAssignOp + ( CVar + ( Ident "a" 97 () ) () + ) + ( CConst + ( CIntConst 0 () ) + ) () + ) + ) + ) Nothing Nothing + ( CCompound [] [] () ) () + ) + ] () + ) () + ) + ] () -- GitLab