From beef9cb82b0df5db844c9e315dfdbc5cae3f6035 Mon Sep 17 00:00:00 2001 From: Christian Gram Kalhauge <chrg@dtu.dk> Date: Tue, 19 Mar 2024 12:00:23 +0100 Subject: [PATCH] Now we can remove individual fields --- rtree-c/src/ReduceC.hs | 38 ++++++++++++------- .../expected/clang-22382/reduction/p0.path | 4 ++ .../expected/clang-22382/reduction/p1.path | 4 ++ .../expected/clang-22382/reduction/p2.path | 4 ++ .../expected/clang-22382/reduction/p3.path | 4 ++ .../expected/clang-22382/reduction/p4.path | 4 ++ .../expected/clang-22382/reduction/p5.path | 4 ++ .../expected/clang-22382/reduction/p6.path | 4 ++ .../expected/clang-23353/reduction/p0.path | 10 +++++ .../expected/clang-23353/reduction/p1.path | 10 +++++ .../expected/clang-23353/reduction/p2.path | 10 +++++ .../expected/clang-23353/reduction/p3.path | 10 +++++ .../expected/clang-23353/reduction/p4.path | 10 +++++ .../expected/clang-23353/reduction/p5.path | 10 +++++ .../expected/clang-23353/reduction/p6.path | 10 +++++ .../struct/reduction/{r0000.c => r000000.c} | 2 + .../struct/reduction/{r0001.c => r000001.c} | 2 + .../struct/reduction/{r0010.c => r000010.c} | 2 + .../struct/reduction/{r0011.c => r000011.c} | 2 + .../struct/reduction/{r010.c => r00010.c} | 2 + .../struct/reduction/{r011.c => r00011.c} | 2 + .../test/expected/struct/reduction/r001000.c | 16 ++++++++ .../test/expected/struct/reduction/r001001.c | 15 ++++++++ .../test/expected/struct/reduction/r001010.c | 15 ++++++++ .../test/expected/struct/reduction/r001011.c | 14 +++++++ .../test/expected/struct/reduction/r00110.c | 13 +++++++ .../test/expected/struct/reduction/r00111.c | 12 ++++++ .../test/expected/struct/reduction/r01000.c | 12 ++++++ .../test/expected/struct/reduction/r01001.c | 11 ++++++ .../test/expected/struct/reduction/r01010.c | 11 ++++++ .../test/expected/struct/reduction/r01011.c | 10 +++++ .../test/expected/struct/reduction/r01100.c | 12 ++++++ .../test/expected/struct/reduction/r01101.c | 11 ++++++ .../test/expected/struct/reduction/r01110.c | 11 ++++++ .../test/expected/struct/reduction/r01111.c | 10 +++++ .../reduction/{r000.c => r00000.c} | 2 + .../reduction/{r001.c => r00001.c} | 2 + .../reduction/{r01.c => r0001.c} | 2 + .../expected/typedefstruct/reduction/r00100.c | 14 +++++++ .../expected/typedefstruct/reduction/r00101.c | 13 +++++++ .../expected/typedefstruct/reduction/r0011.c | 11 ++++++ .../expected/typedefstruct/reduction/r0100.c | 10 +++++ .../expected/typedefstruct/reduction/r0101.c | 9 +++++ .../expected/typedefstruct/reduction/r0110.c | 10 +++++ .../expected/typedefstruct/reduction/r0111.c | 9 +++++ 45 files changed, 390 insertions(+), 13 deletions(-) rename rtree-c/test/expected/struct/reduction/{r0000.c => r000000.c} (74%) rename rtree-c/test/expected/struct/reduction/{r0001.c => r000001.c} (73%) rename rtree-c/test/expected/struct/reduction/{r0010.c => r000010.c} (73%) rename rtree-c/test/expected/struct/reduction/{r0011.c => r000011.c} (72%) rename rtree-c/test/expected/struct/reduction/{r010.c => r00010.c} (66%) rename rtree-c/test/expected/struct/reduction/{r011.c => r00011.c} (65%) create mode 100644 rtree-c/test/expected/struct/reduction/r001000.c create mode 100644 rtree-c/test/expected/struct/reduction/r001001.c create mode 100644 rtree-c/test/expected/struct/reduction/r001010.c create mode 100644 rtree-c/test/expected/struct/reduction/r001011.c create mode 100644 rtree-c/test/expected/struct/reduction/r00110.c create mode 100644 rtree-c/test/expected/struct/reduction/r00111.c create mode 100644 rtree-c/test/expected/struct/reduction/r01000.c create mode 100644 rtree-c/test/expected/struct/reduction/r01001.c create mode 100644 rtree-c/test/expected/struct/reduction/r01010.c create mode 100644 rtree-c/test/expected/struct/reduction/r01011.c create mode 100644 rtree-c/test/expected/struct/reduction/r01100.c create mode 100644 rtree-c/test/expected/struct/reduction/r01101.c create mode 100644 rtree-c/test/expected/struct/reduction/r01110.c create mode 100644 rtree-c/test/expected/struct/reduction/r01111.c rename rtree-c/test/expected/typedefstruct/reduction/{r000.c => r00000.c} (69%) rename rtree-c/test/expected/typedefstruct/reduction/{r001.c => r00001.c} (68%) rename rtree-c/test/expected/typedefstruct/reduction/{r01.c => r0001.c} (60%) create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r00100.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r00101.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r0011.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r0100.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r0101.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r0110.c create mode 100644 rtree-c/test/expected/typedefstruct/reduction/r0111.c diff --git a/rtree-c/src/ReduceC.hs b/rtree-c/src/ReduceC.hs index ea6f00e..7f26a84 100644 --- a/rtree-c/src/ReduceC.hs +++ b/rtree-c/src/ReduceC.hs @@ -217,8 +217,7 @@ updateCDeclarationSpecifiers sf spec = do fmap concat . forM declrs $ \case decl@(C.CDecl def items l) -> do items' <- fmap catMaybes . forM items $ \item -> do - -- TODO this should be an error. - t' <- state (\case ((_, t) : tps) -> (t, tps); [] -> (Nothing, [])) + t' <- state (\((_, t) : tps) -> (t, tps)) case t' of Just _ -> do -- TODO check for bad struct name here declaration @@ -251,7 +250,6 @@ updateCDerivedDeclarators bt ff dd = do C.CArrDeclr{} -> pure (NonVoid . TPointer $ t, d : dd') C.CFunDeclr params arr ni -> do - -- TODO FIX THIS case params of C.CFunParamsNew params' varadic -> do (tp, params'') <- state (runState (findParams varadic params')) @@ -481,13 +479,13 @@ reduceStructDeclaration = pure (False, x) -- Not declared do somthing Nothing -> do - (ft, fields') <- mapAndUnzipM structField fields split ("remove struct " <> C.identToString sid, C.posOf ni) do modify' (addStruct sid Nothing) mzero do + (ft, catMaybes -> fields') <- mapAndUnzipM (structField sid) fields modify' ( addStruct sid @@ -503,17 +501,31 @@ reduceStructDeclaration = Nothing -> pure (False, x) x -> pure (False, x) where - structField = \case + structField sid = \case C.CDecl spec items ni -> do -- TODO: Currently deletes all struct fields if one of them are deleted. - (bt, spec') <- updateCDeclarationSpecifiers keepAll spec - (fields, items') <- flip mapAndUnzipM items \case - (C.CDeclarationItem (C.CDeclr mid dd Nothing [] ni3) ini ni2) -> do - (nonVoid -> t, dd') <- updateCDerivedDeclarators bt (repeat True) dd - let ft = (fromMaybe (error "all struct fields should be named") mid, Just t) - pure (ft, C.CDeclarationItem (C.CDeclr mid dd' Nothing [] ni3) ini ni2) - a -> notSupportedYet a ni - pure (fields, C.CDecl spec' items' ni) + res <- runMaybeT $ updateCDeclarationSpecifiers keepAll spec + case res of + Just (bt, spec') -> do + (fields, items') <- flip mapAndUnzipM items \case + (C.CDeclarationItem (C.CDeclr mid dd Nothing [] ni3) ini ni2) -> do + let fid = fromMaybe (error "all struct fields should be named") mid + res' <- runMaybeT $ do + (nonVoid -> t, dd') <- updateCDerivedDeclarators bt (repeat True) dd + exceptIf ("remove field " <> C.identToString sid <> "." <> C.identToString fid, C.posOf ni) + pure (t, dd') + case res' of + Nothing -> pure ((fid, Nothing), Nothing) + Just (t, dd') -> pure ((fid, Just t), Just $ C.CDeclarationItem (C.CDeclr mid dd' Nothing [] ni3) ini ni2) + a -> notSupportedYet a ni + case catMaybes items' of + [] -> pure (fields, Nothing) + items'' -> pure (fields, Just (C.CDecl spec' items'' ni)) + Nothing -> + pure + ( map (\i -> (fromMaybe (error "all struct fields should be named") (name i), Nothing)) items + , Nothing + ) a@(C.CStaticAssert{}) -> notSupportedYet' a reduceCDeclarationItem diff --git a/rtree-c/test/expected/clang-22382/reduction/p0.path b/rtree-c/test/expected/clang-22382/reduction/p0.path index 75d2966..bc8db87 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p0.path +++ b/rtree-c/test/expected/clang-22382/reduction/p0.path @@ -1895,6 +1895,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p1.path b/rtree-c/test/expected/clang-22382/reduction/p1.path index e9baf59..eab4cae 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p1.path +++ b/rtree-c/test/expected/clang-22382/reduction/p1.path @@ -1889,6 +1889,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p2.path b/rtree-c/test/expected/clang-22382/reduction/p2.path index e32a789..0f64282 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p2.path +++ b/rtree-c/test/expected/clang-22382/reduction/p2.path @@ -1880,6 +1880,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p3.path b/rtree-c/test/expected/clang-22382/reduction/p3.path index f0a491e..a415b64 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p3.path +++ b/rtree-c/test/expected/clang-22382/reduction/p3.path @@ -1867,6 +1867,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p4.path b/rtree-c/test/expected/clang-22382/reduction/p4.path index 4b64c2a..50bc0a8 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p4.path +++ b/rtree-c/test/expected/clang-22382/reduction/p4.path @@ -1516,6 +1516,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1128) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p5.path b/rtree-c/test/expected/clang-22382/reduction/p5.path index e8a6058..0aae8f9 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p5.path +++ b/rtree-c/test/expected/clang-22382/reduction/p5.path @@ -1100,6 +1100,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1128) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-22382/reduction/p6.path b/rtree-c/test/expected/clang-22382/reduction/p6.path index 5d8cdc4..b199d49 100644 --- a/rtree-c/test/expected/clang-22382/reduction/p6.path +++ b/rtree-c/test/expected/clang-22382/reduction/p6.path @@ -470,6 +470,10 @@ * reduce to right at ("test/cases/large/clang-22382.c": line 1108) * delete uninitilized variable at ("test/cases/large/clang-22382.c": line 1145) * remove struct S0 at ("test/cases/large/clang-22382.c": line 1147) +* remove field S0.f0 at ("test/cases/large/clang-22382.c": line 1148) +* remove field S0.f1 at ("test/cases/large/clang-22382.c": line 1149) +* remove field S0.f2 at ("test/cases/large/clang-22382.c": line 1150) +* remove field S0.f3 at ("test/cases/large/clang-22382.c": line 1151) * inline variable g_2 at ("test/cases/large/clang-22382.c": line 1154) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) * reduce to operant at ("test/cases/large/clang-22382.c": line 1155) diff --git a/rtree-c/test/expected/clang-23353/reduction/p0.path b/rtree-c/test/expected/clang-23353/reduction/p0.path index 938dce3..454b768 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p0.path +++ b/rtree-c/test/expected/clang-23353/reduction/p0.path @@ -1889,7 +1889,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p1.path b/rtree-c/test/expected/clang-23353/reduction/p1.path index fc130e8..6b59fa4 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p1.path +++ b/rtree-c/test/expected/clang-23353/reduction/p1.path @@ -1887,7 +1887,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p2.path b/rtree-c/test/expected/clang-23353/reduction/p2.path index 3d60edb..9332fee 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p2.path +++ b/rtree-c/test/expected/clang-23353/reduction/p2.path @@ -1882,7 +1882,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p3.path b/rtree-c/test/expected/clang-23353/reduction/p3.path index d144901..eb0e103 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p3.path +++ b/rtree-c/test/expected/clang-23353/reduction/p3.path @@ -1864,7 +1864,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1142) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p4.path b/rtree-c/test/expected/clang-23353/reduction/p4.path index 2e529dc..ebc5ddc 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p4.path +++ b/rtree-c/test/expected/clang-23353/reduction/p4.path @@ -1563,7 +1563,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1128) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p5.path b/rtree-c/test/expected/clang-23353/reduction/p5.path index 3de9c8f..5cdc20c 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p5.path +++ b/rtree-c/test/expected/clang-23353/reduction/p5.path @@ -1139,7 +1139,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1128) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/clang-23353/reduction/p6.path b/rtree-c/test/expected/clang-23353/reduction/p6.path index 4a42766..c86ae7f 100644 --- a/rtree-c/test/expected/clang-23353/reduction/p6.path +++ b/rtree-c/test/expected/clang-23353/reduction/p6.path @@ -505,7 +505,17 @@ * reduce to right at ("test/cases/large/clang-23353.c": line 1108) * delete uninitilized variable at ("test/cases/large/clang-23353.c": line 1147) * remove struct S0 at ("test/cases/large/clang-23353.c": line 1150) +* remove field S0.f0 at ("test/cases/large/clang-23353.c": line 1151) +* remove field S0.f1 at ("test/cases/large/clang-23353.c": line 1152) +* remove field S0.f2 at ("test/cases/large/clang-23353.c": line 1153) +* remove field S0.f3 at ("test/cases/large/clang-23353.c": line 1154) +* remove field S0.f4 at ("test/cases/large/clang-23353.c": line 1155) +* remove field S0.f5 at ("test/cases/large/clang-23353.c": line 1156) * remove struct S1 at ("test/cases/large/clang-23353.c": line 1159) +* remove field S1.f0 at ("test/cases/large/clang-23353.c": line 1160) +* remove field S1.f1 at ("test/cases/large/clang-23353.c": line 1161) +* remove field S1.f2 at ("test/cases/large/clang-23353.c": line 1162) +* remove field S1.f3 at ("test/cases/large/clang-23353.c": line 1163) * inline variable g_16 at ("test/cases/large/clang-23353.c": line 1167) * inline variable g_25 at ("test/cases/large/clang-23353.c": line 1168) * reduce to operant at ("test/cases/large/clang-23353.c": line 1169) diff --git a/rtree-c/test/expected/struct/reduction/r0000.c b/rtree-c/test/expected/struct/reduction/r000000.c similarity index 74% rename from rtree-c/test/expected/struct/reduction/r0000.c rename to rtree-c/test/expected/struct/reduction/r000000.c index fcacfb9..364ec18 100644 --- a/rtree-c/test/expected/struct/reduction/r0000.c +++ b/rtree-c/test/expected/struct/reduction/r000000.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 0 delete variable at ("test/cases/small/struct.c": line 3) // 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) // 0 remove return statement at ("test/cases/small/struct.c": line 7) diff --git a/rtree-c/test/expected/struct/reduction/r0001.c b/rtree-c/test/expected/struct/reduction/r000001.c similarity index 73% rename from rtree-c/test/expected/struct/reduction/r0001.c rename to rtree-c/test/expected/struct/reduction/r000001.c index 19acb2d..041c8d7 100644 --- a/rtree-c/test/expected/struct/reduction/r0001.c +++ b/rtree-c/test/expected/struct/reduction/r000001.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 0 delete variable at ("test/cases/small/struct.c": line 3) // 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) // 1 remove return statement at ("test/cases/small/struct.c": line 7) diff --git a/rtree-c/test/expected/struct/reduction/r0010.c b/rtree-c/test/expected/struct/reduction/r000010.c similarity index 73% rename from rtree-c/test/expected/struct/reduction/r0010.c rename to rtree-c/test/expected/struct/reduction/r000010.c index 7888c10..156dda6 100644 --- a/rtree-c/test/expected/struct/reduction/r0010.c +++ b/rtree-c/test/expected/struct/reduction/r000010.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 0 delete variable at ("test/cases/small/struct.c": line 3) // 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) // 0 remove return statement at ("test/cases/small/struct.c": line 7) diff --git a/rtree-c/test/expected/struct/reduction/r0011.c b/rtree-c/test/expected/struct/reduction/r000011.c similarity index 72% rename from rtree-c/test/expected/struct/reduction/r0011.c rename to rtree-c/test/expected/struct/reduction/r000011.c index 1cb7622..b01e356 100644 --- a/rtree-c/test/expected/struct/reduction/r0011.c +++ b/rtree-c/test/expected/struct/reduction/r000011.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 0 delete variable at ("test/cases/small/struct.c": line 3) // 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) // 1 remove return statement at ("test/cases/small/struct.c": line 7) diff --git a/rtree-c/test/expected/struct/reduction/r010.c b/rtree-c/test/expected/struct/reduction/r00010.c similarity index 66% rename from rtree-c/test/expected/struct/reduction/r010.c rename to rtree-c/test/expected/struct/reduction/r00010.c index d1df549..32cff84 100644 --- a/rtree-c/test/expected/struct/reduction/r010.c +++ b/rtree-c/test/expected/struct/reduction/r00010.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 1 delete variable at ("test/cases/small/struct.c": line 3) // 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) diff --git a/rtree-c/test/expected/struct/reduction/r011.c b/rtree-c/test/expected/struct/reduction/r00011.c similarity index 65% rename from rtree-c/test/expected/struct/reduction/r011.c rename to rtree-c/test/expected/struct/reduction/r00011.c index 39ad06b..c945a45 100644 --- a/rtree-c/test/expected/struct/reduction/r011.c +++ b/rtree-c/test/expected/struct/reduction/r00011.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) // 1 delete variable at ("test/cases/small/struct.c": line 3) // 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) diff --git a/rtree-c/test/expected/struct/reduction/r001000.c b/rtree-c/test/expected/struct/reduction/r001000.c new file mode 100644 index 0000000..738b08e --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r001000.c @@ -0,0 +1,16 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) +// 0 remove return statement at ("test/cases/small/struct.c": line 7) + +struct point { + int x; +}; +struct point p1 = { 0 }; +int main() +{ + struct point p2; + return p1.x; +} diff --git a/rtree-c/test/expected/struct/reduction/r001001.c b/rtree-c/test/expected/struct/reduction/r001001.c new file mode 100644 index 0000000..a7d99d5 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r001001.c @@ -0,0 +1,15 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) +// 1 remove return statement at ("test/cases/small/struct.c": line 7) + +struct point { + int x; +}; +struct point p1 = { 0 }; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r001010.c b/rtree-c/test/expected/struct/reduction/r001010.c new file mode 100644 index 0000000..869679d --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r001010.c @@ -0,0 +1,15 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) +// 0 remove return statement at ("test/cases/small/struct.c": line 7) + +struct point { + int x; +}; +struct point p1 = { 0 }; +int main() +{ + return p1.x; +} diff --git a/rtree-c/test/expected/struct/reduction/r001011.c b/rtree-c/test/expected/struct/reduction/r001011.c new file mode 100644 index 0000000..84bf34e --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r001011.c @@ -0,0 +1,14 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) +// 1 remove return statement at ("test/cases/small/struct.c": line 7) + +struct point { + int x; +}; +struct point p1 = { 0 }; +int main() +{ +} diff --git a/rtree-c/test/expected/struct/reduction/r00110.c b/rtree-c/test/expected/struct/reduction/r00110.c new file mode 100644 index 0000000..4f0896d --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r00110.c @@ -0,0 +1,13 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { + int x; +}; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r00111.c b/rtree-c/test/expected/struct/reduction/r00111.c new file mode 100644 index 0000000..e2a14c4 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r00111.c @@ -0,0 +1,12 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 0 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { + int x; +}; +int main() +{ +} diff --git a/rtree-c/test/expected/struct/reduction/r01000.c b/rtree-c/test/expected/struct/reduction/r01000.c new file mode 100644 index 0000000..ffb073c --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01000.c @@ -0,0 +1,12 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +struct point p1 = { 0 }; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r01001.c b/rtree-c/test/expected/struct/reduction/r01001.c new file mode 100644 index 0000000..1d528f0 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01001.c @@ -0,0 +1,11 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +struct point p1 = { 0 }; +int main() +{ +} diff --git a/rtree-c/test/expected/struct/reduction/r01010.c b/rtree-c/test/expected/struct/reduction/r01010.c new file mode 100644 index 0000000..d374378 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01010.c @@ -0,0 +1,11 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r01011.c b/rtree-c/test/expected/struct/reduction/r01011.c new file mode 100644 index 0000000..dcdcff0 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01011.c @@ -0,0 +1,10 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 0 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +int main() +{ +} diff --git a/rtree-c/test/expected/struct/reduction/r01100.c b/rtree-c/test/expected/struct/reduction/r01100.c new file mode 100644 index 0000000..3260901 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01100.c @@ -0,0 +1,12 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +struct point p1 = { }; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r01101.c b/rtree-c/test/expected/struct/reduction/r01101.c new file mode 100644 index 0000000..0099d98 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01101.c @@ -0,0 +1,11 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 0 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +struct point p1 = { }; +int main() +{ +} diff --git a/rtree-c/test/expected/struct/reduction/r01110.c b/rtree-c/test/expected/struct/reduction/r01110.c new file mode 100644 index 0000000..90e1373 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01110.c @@ -0,0 +1,11 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 0 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +int main() +{ + struct point p2; +} diff --git a/rtree-c/test/expected/struct/reduction/r01111.c b/rtree-c/test/expected/struct/reduction/r01111.c new file mode 100644 index 0000000..cab20b8 --- /dev/null +++ b/rtree-c/test/expected/struct/reduction/r01111.c @@ -0,0 +1,10 @@ +// 0 remove struct point at ("test/cases/small/struct.c": line 1) +// 1 remove field point.x at ("test/cases/small/struct.c": line 1) +// 1 remove field point.y at ("test/cases/small/struct.c": line 1) +// 1 delete variable at ("test/cases/small/struct.c": line 3) +// 1 delete uninitilized variable at ("test/cases/small/struct.c": line 6) + +struct point { }; +int main() +{ +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r000.c b/rtree-c/test/expected/typedefstruct/reduction/r00000.c similarity index 69% rename from rtree-c/test/expected/typedefstruct/reduction/r000.c rename to rtree-c/test/expected/typedefstruct/reduction/r00000.c index 24f99c3..41951b9 100644 --- a/rtree-c/test/expected/typedefstruct/reduction/r000.c +++ b/rtree-c/test/expected/typedefstruct/reduction/r00000.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 0 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) // 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) // 0 remove return statement at ("test/cases/small/typedefstruct.c": line 8) diff --git a/rtree-c/test/expected/typedefstruct/reduction/r001.c b/rtree-c/test/expected/typedefstruct/reduction/r00001.c similarity index 68% rename from rtree-c/test/expected/typedefstruct/reduction/r001.c rename to rtree-c/test/expected/typedefstruct/reduction/r00001.c index b48882b..3de3382 100644 --- a/rtree-c/test/expected/typedefstruct/reduction/r001.c +++ b/rtree-c/test/expected/typedefstruct/reduction/r00001.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 0 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) // 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) // 1 remove return statement at ("test/cases/small/typedefstruct.c": line 8) diff --git a/rtree-c/test/expected/typedefstruct/reduction/r01.c b/rtree-c/test/expected/typedefstruct/reduction/r0001.c similarity index 60% rename from rtree-c/test/expected/typedefstruct/reduction/r01.c rename to rtree-c/test/expected/typedefstruct/reduction/r0001.c index 91afd1f..9fd284f 100644 --- a/rtree-c/test/expected/typedefstruct/reduction/r01.c +++ b/rtree-c/test/expected/typedefstruct/reduction/r0001.c @@ -1,4 +1,6 @@ // 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 0 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) // 1 delete variable at ("test/cases/small/typedefstruct.c": line 7) typedef struct point { diff --git a/rtree-c/test/expected/typedefstruct/reduction/r00100.c b/rtree-c/test/expected/typedefstruct/reduction/r00100.c new file mode 100644 index 0000000..90f8f1b --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r00100.c @@ -0,0 +1,14 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 1 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) +// 0 remove return statement at ("test/cases/small/typedefstruct.c": line 8) + +typedef struct point { + int x; + } point; +int main(void) +{ + point p = { 0 }; + return p.x; +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r00101.c b/rtree-c/test/expected/typedefstruct/reduction/r00101.c new file mode 100644 index 0000000..644a8b5 --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r00101.c @@ -0,0 +1,13 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 1 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) +// 1 remove return statement at ("test/cases/small/typedefstruct.c": line 8) + +typedef struct point { + int x; + } point; +int main(void) +{ + point p = { 0 }; +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r0011.c b/rtree-c/test/expected/typedefstruct/reduction/r0011.c new file mode 100644 index 0000000..5d5594b --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r0011.c @@ -0,0 +1,11 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 0 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 1 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 1 delete variable at ("test/cases/small/typedefstruct.c": line 7) + +typedef struct point { + int x; + } point; +int main(void) +{ +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r0100.c b/rtree-c/test/expected/typedefstruct/reduction/r0100.c new file mode 100644 index 0000000..dcb66c0 --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r0100.c @@ -0,0 +1,10 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 1 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 0 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) + +typedef struct point { } point; +int main(void) +{ + point p = { 0 }; +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r0101.c b/rtree-c/test/expected/typedefstruct/reduction/r0101.c new file mode 100644 index 0000000..669fb2e --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r0101.c @@ -0,0 +1,9 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 1 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 0 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 1 delete variable at ("test/cases/small/typedefstruct.c": line 7) + +typedef struct point { } point; +int main(void) +{ +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r0110.c b/rtree-c/test/expected/typedefstruct/reduction/r0110.c new file mode 100644 index 0000000..b6db6c8 --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r0110.c @@ -0,0 +1,10 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 1 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 1 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 0 delete variable at ("test/cases/small/typedefstruct.c": line 7) + +typedef struct point { } point; +int main(void) +{ + point p = { }; +} diff --git a/rtree-c/test/expected/typedefstruct/reduction/r0111.c b/rtree-c/test/expected/typedefstruct/reduction/r0111.c new file mode 100644 index 0000000..89d4f1d --- /dev/null +++ b/rtree-c/test/expected/typedefstruct/reduction/r0111.c @@ -0,0 +1,9 @@ +// 0 remove struct point at ("test/cases/small/typedefstruct.c": line 1) +// 1 remove field point.x at ("test/cases/small/typedefstruct.c": line 2) +// 1 remove field point.y at ("test/cases/small/typedefstruct.c": line 3) +// 1 delete variable at ("test/cases/small/typedefstruct.c": line 7) + +typedef struct point { } point; +int main(void) +{ +} -- GitLab