From ae741215fdcf078763609428cca5a896022c35e2 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Fri, 22 Aug 2025 17:00:07 +0200 Subject: [PATCH 01/25] Add modified version of CaGe Co-authored-by: Tim Heldmann # Conflicts: # tools/CMakeLists.txt --- cmake/metavirt.cmake | 10 ++ tools/CMakeLists.txt | 2 +- tools/cage/CMakeLists.txt | 13 ++ tools/cage/include/cage/Plugin.h | 22 +++ .../cage/generator/CallGraphConsumer.h | 22 +++ .../cage/generator/CallgraphGenerator.h | 27 ++++ .../include/cage/generator/FileExporter.h | 19 +++ tools/cage/src/CMakeLists.txt | 6 + tools/cage/src/Plugin.cpp | 69 ++++++++ tools/cage/src/generator/CMakeLists.txt | 12 ++ .../cage/src/generator/CallGraphGenerator.cpp | 153 ++++++++++++++++++ tools/cage/src/generator/FileExporter.cpp | 25 +++ 12 files changed, 379 insertions(+), 1 deletion(-) create mode 100644 cmake/metavirt.cmake create mode 100644 tools/cage/CMakeLists.txt create mode 100644 tools/cage/include/cage/Plugin.h create mode 100644 tools/cage/include/cage/generator/CallGraphConsumer.h create mode 100644 tools/cage/include/cage/generator/CallgraphGenerator.h create mode 100644 tools/cage/include/cage/generator/FileExporter.h create mode 100644 tools/cage/src/CMakeLists.txt create mode 100644 tools/cage/src/Plugin.cpp create mode 100644 tools/cage/src/generator/CMakeLists.txt create mode 100644 tools/cage/src/generator/CallGraphGenerator.cpp create mode 100644 tools/cage/src/generator/FileExporter.cpp diff --git a/cmake/metavirt.cmake b/cmake/metavirt.cmake new file mode 100644 index 00000000..49f3a468 --- /dev/null +++ b/cmake/metavirt.cmake @@ -0,0 +1,10 @@ +add_compile_definitions(VIRTCALL_LOG_LEVEL) +FetchContent_Declare( + metavirt + GIT_REPOSITORY https://github.com/ahueck/llvm-metavirt.git + GIT_TAG devel + GIT_SHALLOW 1 + FIND_PACKAGE_ARGS +) + +FetchContent_MakeAvailable(metavirt) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 811b801d..8ca2dc9e 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,5 +1,5 @@ -add_subdirectory(cgcollector2) add_subdirectory(cgmerge2) add_subdirectory(cgconvert) add_subdirectory(cgformat) add_subdirectory(cgdiff) +add_subdirectory(cage) diff --git a/tools/cage/CMakeLists.txt b/tools/cage/CMakeLists.txt new file mode 100644 index 00000000..40c6807e --- /dev/null +++ b/tools/cage/CMakeLists.txt @@ -0,0 +1,13 @@ +option( + CAGE_USE_METAVIRT + ON + "Rely on metavirt for virtual call handling" +) + +if(${CAGE_USE_METAVIRT}) + include(metavirt) +endif() + +add_subdirectory(src) + +install(TARGETS cage cage-plugin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/tools/cage/include/cage/Plugin.h b/tools/cage/include/cage/Plugin.h new file mode 100644 index 00000000..1635793b --- /dev/null +++ b/tools/cage/include/cage/Plugin.h @@ -0,0 +1,22 @@ +/** + * File: Plugin.h + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#ifndef METACG_CAGE_PLUGIN_H +#define METACG_CAGE_PLUGIN_H + +#include "llvm/Pass.h" +#include "llvm/Passes/PassBuilder.h" +#include "llvm/Passes/PassPlugin.h" + +namespace cage { + +struct CaGe : llvm::PassInfoMixin { + llvm::PreservedAnalyses run(llvm::Module& M, llvm::ModuleAnalysisManager& MA); + + static llvm::StringRef name() { return "CaGe"; } +}; +} // namespace cage + +#endif // METACG_CAGE_PLUGIN_H diff --git a/tools/cage/include/cage/generator/CallGraphConsumer.h b/tools/cage/include/cage/generator/CallGraphConsumer.h new file mode 100644 index 00000000..accddb91 --- /dev/null +++ b/tools/cage/include/cage/generator/CallGraphConsumer.h @@ -0,0 +1,22 @@ +/** + * File: CallGraphConsumer.h + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#ifndef METACG_CALLGRAPHCONSUMER_H +#define METACG_CALLGRAPHCONSUMER_H + +namespace metacg{ +class Callgraph; +} + +namespace cage { + +struct CallGraphConsumer { + virtual ~CallGraphConsumer() = default; + virtual void consumeCallGraph(metacg::Callgraph&) = 0; +}; + +} // namespace cage + +#endif // METACG_CALLGRAPHCONSUMER_H diff --git a/tools/cage/include/cage/generator/CallgraphGenerator.h b/tools/cage/include/cage/generator/CallgraphGenerator.h new file mode 100644 index 00000000..b1dd01c3 --- /dev/null +++ b/tools/cage/include/cage/generator/CallgraphGenerator.h @@ -0,0 +1,27 @@ +/** + * File: CallGraphGenerator.h + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#include "cage/generator/CallGraphConsumer.h" + +#include "io/MCGWriter.h" + +#include "llvm/IR/Module.h" +#include "llvm/IR/PassManager.h" + +namespace cage { + +class Generator { + public: + Generator() = default; + + void addConsumer(std::unique_ptr consumer) { consumers.push_back(std::move(consumer)); } + + bool run(llvm::Module& M, llvm::ModuleAnalysisManager* MA); + + private: + std::vector> consumers; +}; + +} // namespace cage diff --git a/tools/cage/include/cage/generator/FileExporter.h b/tools/cage/include/cage/generator/FileExporter.h new file mode 100644 index 00000000..2eadf28c --- /dev/null +++ b/tools/cage/include/cage/generator/FileExporter.h @@ -0,0 +1,19 @@ +/** + * File: FileExporter.h + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#ifndef METACG_FILEEXPORTER_H +#define METACG_FILEEXPORTER_H + +#include "cage/generator/CallGraphConsumer.h" + +namespace cage { + +class FileExporter : public CallGraphConsumer { + void consumeCallGraph(metacg::Callgraph&) override; +}; + +} // namespace cage + +#endif // METACG_FILEEXPORTER_H diff --git a/tools/cage/src/CMakeLists.txt b/tools/cage/src/CMakeLists.txt new file mode 100644 index 00000000..60812f16 --- /dev/null +++ b/tools/cage/src/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(cage-plugin MODULE Plugin.cpp) +target_include_directories(cage-plugin PRIVATE $) +target_include_directories(cage-plugin PRIVATE $) +target_link_libraries(cage-plugin PRIVATE cage) + +add_subdirectory(generator) diff --git a/tools/cage/src/Plugin.cpp b/tools/cage/src/Plugin.cpp new file mode 100644 index 00000000..1cfd032a --- /dev/null +++ b/tools/cage/src/Plugin.cpp @@ -0,0 +1,69 @@ +/** + * File: Plugin.cpp + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#include "cage/Plugin.h" + +#include "llvm/IR/LegacyPassManager.h" +#include "llvm/Passes/PassBuilder.h" +#include "llvm/Passes/PassPlugin.h" + +#include "cage/generator/CallgraphGenerator.h" +#include "cage/generator/FileExporter.h" + +using namespace llvm; + +namespace cage { +PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { + Generator gen; + gen.addConsumer(std::make_unique()); + + if (!gen.run(M, &MA)) + return PreservedAnalyses::all(); + + return PreservedAnalyses::none(); +} +} // namespace cage + +llvm::PassPluginLibraryInfo getPluginInfo() { + return {LLVM_PLUGIN_API_VERSION, "CaGe", "0.2", [](PassBuilder& PB) { + // allow registration via optlevel (non-lto) +#if LLVM_VERSION_MAJOR >= 20 + PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel, ThinOrFullLTOPhase) { +#else + PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel) { +#endif + outs() << "Registering CaGe to run during opt\n"; + PM.addPass(cage::CaGe()); + }); + + // registering via optlevel during lto appears to still be broken + PB.registerFullLinkTimeOptimizationLastEPCallback([](ModulePassManager& PM, OptimizationLevel o) { + outs() << "Registering CaGe to run during full LTO\n"; + PM.addPass(cage::CaGe()); + }); + + // allow registration via pipeline parser + PB.registerPipelineParsingCallback( + [](StringRef Name, ModulePassManager& MPM, ArrayRef) { + if (Name == "CaGe") { + outs() << "Registering CaGe to run as pipeline described\n"; + MPM.addPass(cage::CaGe()); + return true; + } else { + outs() << "Did not register CaGe\n"; + } + return false; + }); + }}; +} + +extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo llvmGetPassPluginInfo() { +#ifndef NDEBUG + outs() << "Loading debug version of CaGe-Plugin\n"; +#else + outs() << "Loading release version of CaGe-Plugin\n"; +#endif + return getPluginInfo(); +} \ No newline at end of file diff --git a/tools/cage/src/generator/CMakeLists.txt b/tools/cage/src/generator/CMakeLists.txt new file mode 100644 index 00000000..72fdae68 --- /dev/null +++ b/tools/cage/src/generator/CMakeLists.txt @@ -0,0 +1,12 @@ +add_library(cage STATIC CallGraphGenerator.cpp FileExporter.cpp) +set_target_properties(cage PROPERTIES POSITION_INDEPENDENT_CODE ON) +target_include_directories(cage PRIVATE $) +target_include_directories(cage PUBLIC $) + +if(${CAGE_USE_METAVIRT}) + target_link_libraries(cage PRIVATE metavirt::Types) + target_compile_definitions(cage PRIVATE "HAVE_METAVIRT") +endif() + +target_link_libraries(cage PUBLIC metacg::metacg) +add_config_include(cage) diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp new file mode 100644 index 00000000..16ded915 --- /dev/null +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -0,0 +1,153 @@ +/** + * File: CallGraphGenerator.cpp + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#include "cage/generator/CallgraphGenerator.h" + +#include "Callgraph.h" + +#ifdef HAVE_METAVIRT +#include "metavirt/VirtCall.h" +#endif + +#include "llvm/Analysis/CallGraph.h" +#include "llvm/Demangle/Demangle.h" +#include "llvm/IR/Function.h" +#include "llvm/Passes/PassBuilder.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/IPO/WholeProgramDevirt.h" +#include "llvm/Transforms/Utils/ModuleUtils.h" + +#include "llvm/IR/DebugInfo.h" +#include "llvm/IR/InstVisitor.h" + +#include + +using namespace llvm; + +namespace cage { + +struct CallBaseVisitor : public llvm::InstVisitor { + CallBaseVisitor(llvm::CallGraph* lcg) : lcg(lcg), mcg(std::make_unique()) { + const Module& m = lcg->getModule(); + llvm::DebugInfoFinder dbg_finder{}; + dbg_finder.processModule(m); + metaDataAvail = dbg_finder.subprogram_count() != 0; + + for (const auto& i : dbg_finder.subprograms()) { + if (auto f = m.getFunction(i->getName())) { + // We found the function with its normal name (C-Style function) + functionInfoMap[f] = i; + } else if (auto f = m.getFunction(i->getLinkageName())) { + // We found the function via the linkage name (mangled name / C++ function) + functionInfoMap[f] = i; + } else { + // assert(false); + } + } + + for (const auto& func : m.getFunctionList()) { + signatureFunctionMap[func.getFunctionType()].push_back(&func.getFunction()); + } + } + + void visitCallBase(llvm::CallBase& I) { + if (I.getCalledFunction() != nullptr && I.getCalledFunction()->isIntrinsic()) + return; + auto* currentFunction = I.getParent()->getParent(); + auto& currentNode = mcg->getSingleNode(currentFunction->getName().str()); + if (metaDataAvail) { + size_t numAddedCalls = addVirtualCalltargets(I, currentNode); + // This function pointer was a virtual call base, so we do not need to run the overapproximation + if (numAddedCalls != 0) + return; + } + + if (I.getCalledFunction() == nullptr) { + // Was function pointer, where we can not get the called function + const auto& possibleFuncs = signatureFunctionMap[I.getFunctionType()]; + for (const auto& func : possibleFuncs) { + metacg::CgNode& childNode = (metaDataAvail && functionInfoMap[func] != nullptr + ? mcg->getOrInsertNode(functionInfoMap[func]->getLinkageName().str(), + functionInfoMap[func]->getFilename().str()) + : mcg->getOrInsertNode(func->getName().str())); + mcg->addEdge(currentNode, childNode); + } + } + } + + void visitFunction(llvm::Function& F) { + if (F.isIntrinsic()) + return; + const std::string& funcName = F.getName().str(); + metacg::CgNode& currentNode = (metaDataAvail && functionInfoMap[&F] != nullptr + ? mcg->getOrInsertNode(funcName, functionInfoMap[&F]->getFilename().str()) + : mcg->getOrInsertNode(funcName)); + + auto* lcgNode = lcg->operator[](&F); + for (auto [key, elem] : *lcgNode) { + if (!key.has_value()) + continue; + if (elem->getFunction() == nullptr) + continue; + if (elem->getFunction()->isIntrinsic()) + continue; + const Function* childFunc = elem->getFunction(); + assert(childFunc->hasName()); + metacg::CgNode& childNode = + (metaDataAvail && functionInfoMap[childFunc] != nullptr + ? mcg->getOrInsertNode(childFunc->getName().str(), functionInfoMap[childFunc]->getFilename().str()) + : mcg->getOrInsertNode(childFunc->getName().str())); + mcg->addEdge(currentNode, childNode); + } + } + + std::unique_ptr takeResult() { return std::move(mcg); } + + private: + size_t addVirtualCalltargets(CallBase& I, const metacg::CgNode& currentNode) const { + // TODO: Improve this design if we want to support multiple virtual call resolution mechanisms, e.g. with + // template policy parameter. +#ifdef HAVE_METAVIRT + auto vcallData = metavirt::vcall_data_for(&I); + if (!vcallData.has_value()) + return 0; + if (vcallData.value().call_targets.empty()) + return 0; + + outs() << metavirt::fn_names_and_origins(vcallData.value()).size() << "\n"; + for (const auto& dataPoints : metavirt::fn_names_and_origins(vcallData.value())) { + auto& childNode = mcg->getOrInsertNode(dataPoints.name.str(), dataPoints.origin.str()); + mcg->addEdge(currentNode, childNode); + assert(childNode.getOrigin() == dataPoints.origin); + } + return metavirt::fn_names_and_origins(vcallData.value()).size(); +#else + return 0; +#endif + } + + std::unique_ptr mcg; + llvm::CallGraph* lcg; + bool metaDataAvail = false; + std::unordered_map functionInfoMap; + std::unordered_map> signatureFunctionMap; +}; + +bool Generator::run(Module& M, ModuleAnalysisManager* MA) { + auto& cgResult = MA->getResult(M); + auto cbv = CallBaseVisitor(&cgResult); + cbv.visit(M); + + // Take resulting metacg call graph + auto mcg = cbv.takeResult(); + + // Run registered consumers + for (auto& consumer : consumers) { + consumer->consumeCallGraph(*mcg); + } + + return false; +} +} // namespace cage diff --git a/tools/cage/src/generator/FileExporter.cpp b/tools/cage/src/generator/FileExporter.cpp new file mode 100644 index 00000000..4e254744 --- /dev/null +++ b/tools/cage/src/generator/FileExporter.cpp @@ -0,0 +1,25 @@ +/** + * File: FileExporter.cpp + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#include "cage/generator/FileExporter.h" + +#include "config.h" +#include "io/MCGWriter.h" +#include "io/VersionFourMCGWriter.h" + +namespace cage { + +void FileExporter::consumeCallGraph(metacg::Callgraph& graph) { + metacg::io::JsonSink jsSink; + metacg::io::VersionFourMCGWriter mcgw({{4, 0}, {"CaGe", 0, 1, MetaCG_GIT_SHA}}, true, true); + mcgw.write(&graph, jsSink); + const auto* cgName = std::getenv("CAGE_CG_NAME"); + std::ofstream out(cgName ? cgName : "cage_callgraph.mcg"); + out << jsSink.getJson().dump(4); + out.flush(); + out.close(); +} + +} // namespace cage From 9468222a8c419f6415a9788fe856468d3118624b Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 4 Sep 2025 12:41:51 +0200 Subject: [PATCH 02/25] [WIP] CaGe tests --- tools/cage/test/01_simple/Makefile.in | 0 tools/cage/test/01_simple/bar.cpp | 3 +++ tools/cage/test/01_simple/main.cpp | 3 +++ tools/cage/test/CMakeLists.txt | 0 tools/cage/test/runCageTests.sh | 0 5 files changed, 6 insertions(+) create mode 100644 tools/cage/test/01_simple/Makefile.in create mode 100644 tools/cage/test/01_simple/bar.cpp create mode 100644 tools/cage/test/01_simple/main.cpp create mode 100644 tools/cage/test/CMakeLists.txt create mode 100644 tools/cage/test/runCageTests.sh diff --git a/tools/cage/test/01_simple/Makefile.in b/tools/cage/test/01_simple/Makefile.in new file mode 100644 index 00000000..e69de29b diff --git a/tools/cage/test/01_simple/bar.cpp b/tools/cage/test/01_simple/bar.cpp new file mode 100644 index 00000000..5a2d77cd --- /dev/null +++ b/tools/cage/test/01_simple/bar.cpp @@ -0,0 +1,3 @@ +// +// Created by sebastian on 25.08.25. +// diff --git a/tools/cage/test/01_simple/main.cpp b/tools/cage/test/01_simple/main.cpp new file mode 100644 index 00000000..5a2d77cd --- /dev/null +++ b/tools/cage/test/01_simple/main.cpp @@ -0,0 +1,3 @@ +// +// Created by sebastian on 25.08.25. +// diff --git a/tools/cage/test/CMakeLists.txt b/tools/cage/test/CMakeLists.txt new file mode 100644 index 00000000..e69de29b diff --git a/tools/cage/test/runCageTests.sh b/tools/cage/test/runCageTests.sh new file mode 100644 index 00000000..e69de29b From 24a72336668ee306fe6e7d5dc55236a835e93b6d Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 4 Sep 2025 12:42:09 +0200 Subject: [PATCH 03/25] [WIP] CaGe tests --- tools/cage/CMakeLists.txt | 1 + tools/cage/src/CMakeLists.txt | 6 +++-- tools/cage/test/01_simple/Makefile.in | 23 +++++++++++++++++ tools/cage/test/01_simple/bar.cpp | 6 ++--- tools/cage/test/01_simple/main.cpp | 14 ++++++++--- tools/cage/test/CMakeLists.txt | 5 ++++ tools/cage/test/runCageTests.sh | 5 ++++ utils/config/CMakeLists.txt | 9 ++++++- utils/config/MCGConfig.cpp | 36 +++++++++++++++++++++++++-- 9 files changed, 94 insertions(+), 11 deletions(-) diff --git a/tools/cage/CMakeLists.txt b/tools/cage/CMakeLists.txt index 40c6807e..1529d3e2 100644 --- a/tools/cage/CMakeLists.txt +++ b/tools/cage/CMakeLists.txt @@ -9,5 +9,6 @@ if(${CAGE_USE_METAVIRT}) endif() add_subdirectory(src) +add_subdirectory(test) install(TARGETS cage cage-plugin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/tools/cage/src/CMakeLists.txt b/tools/cage/src/CMakeLists.txt index 60812f16..39f30ba2 100644 --- a/tools/cage/src/CMakeLists.txt +++ b/tools/cage/src/CMakeLists.txt @@ -1,6 +1,8 @@ -add_library(cage-plugin MODULE Plugin.cpp) +include(AddLLVM) +#add_library(cage-plugin MODULE Plugin.cpp) +add_llvm_pass_plugin(cage-plugin Plugin.cpp) target_include_directories(cage-plugin PRIVATE $) -target_include_directories(cage-plugin PRIVATE $) +#target_include_directories(cage-plugin PRIVATE $) target_link_libraries(cage-plugin PRIVATE cage) add_subdirectory(generator) diff --git a/tools/cage/test/01_simple/Makefile.in b/tools/cage/test/01_simple/Makefile.in index e69de29b..7657ba07 100644 --- a/tools/cage/test/01_simple/Makefile.in +++ b/tools/cage/test/01_simple/Makefile.in @@ -0,0 +1,23 @@ +# Compiler and flags +CXX := clang++ +CXXFLAGS := -Wall -Wextra -O2 -std=c++17 +METACG_CONFIG := @METACG_CONFIG@ + +# Sources and target +SRCS := @TEST_SRC_DIR@/main.cpp @TEST_SRC_DIR@/bar.cpp +OBJS := $(SRCS:.cpp=.o) +TARGET := 01_simple + +# Link step +$(TARGET): $(OBJS) + $(CXX) `$(METACG_CONFIG) --cage --ldflags` $(OBJS) -o $@ + +# Compile step +%.o: %.cpp + $(CXX) $(CXXFLAGS) `$(METACG_CONFIG) --cage --cxxflags` -c $< -o $@ + +# Clean up build artifacts +clean: + rm -f $(OBJS) $(TARGET) + +.PHONY: all clean \ No newline at end of file diff --git a/tools/cage/test/01_simple/bar.cpp b/tools/cage/test/01_simple/bar.cpp index 5a2d77cd..68511679 100644 --- a/tools/cage/test/01_simple/bar.cpp +++ b/tools/cage/test/01_simple/bar.cpp @@ -1,3 +1,3 @@ -// -// Created by sebastian on 25.08.25. -// +void bar() { + +} \ No newline at end of file diff --git a/tools/cage/test/01_simple/main.cpp b/tools/cage/test/01_simple/main.cpp index 5a2d77cd..7b01de01 100644 --- a/tools/cage/test/01_simple/main.cpp +++ b/tools/cage/test/01_simple/main.cpp @@ -1,3 +1,11 @@ -// -// Created by sebastian on 25.08.25. -// + +void bar(); + +void foo() { + bar(); +} + +int main() { + foo(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/CMakeLists.txt b/tools/cage/test/CMakeLists.txt index e69de29b..9c2a13a4 100644 --- a/tools/cage/test/CMakeLists.txt +++ b/tools/cage/test/CMakeLists.txt @@ -0,0 +1,5 @@ +set(METACG_CONFIG "${CMAKE_BINARY_DIR}/utils/config/metacg-config") +set(TEST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/01_simple") +configure_file(01_simple/Makefile.in + ${CMAKE_CURRENT_BINARY_DIR}/01_simple/Makefile + @ONLY) \ No newline at end of file diff --git a/tools/cage/test/runCageTests.sh b/tools/cage/test/runCageTests.sh index e69de29b..e24aec88 100644 --- a/tools/cage/test/runCageTests.sh +++ b/tools/cage/test/runCageTests.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +for testdir in ./*; do + +done \ No newline at end of file diff --git a/utils/config/CMakeLists.txt b/utils/config/CMakeLists.txt index ccf3f1b6..aa61f96c 100644 --- a/utils/config/CMakeLists.txt +++ b/utils/config/CMakeLists.txt @@ -1,6 +1,13 @@ add_executable(metacg-config MCGConfig.cpp) add_config_include(metacg-config) -target_compile_definitions(metacg-config PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") add_cxxopts(metacg-config) + +target_compile_definitions(metacg-config PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") +if (${METACG_BUILD_GRAPH_TOOLS}) + # TODO: Currently only uses build variables + target_compile_definitions(metacg-config PRIVATE HAVE_GRAPH_TOOLS CAGE_PLUGIN="$") +endif() + + install(TARGETS metacg-config DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index fddb16d1..8042a6cd 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -13,7 +13,12 @@ int main(int argc, char** argv) { cxxopts::Options options("metacg-config", "MetaCG configuration tool"); options.add_options("commands")("v,version", "Prints the version of this MetaCG installation")( "revision", "Prints the revision hash of this MetaCG installation")( - "prefix", "Prints the installation prefix of this MetaCG installation.")("h,help", "Print help"); + "prefix", "Prints the installation prefix of this MetaCG installation.")( + "ldflags", "Prints the necessary ld flags.")( + "cflags", "Prints the necessary C compile flags.")( + "cxxflags", "Prints the necessary C++ compile flags.")( + "cage", "Enables the CaGe LTO plugin (requires graph tools)")( + "h,help", "Print help"); const cxxopts::ParseResult result = options.parse(argc, argv); @@ -23,7 +28,7 @@ int main(int argc, char** argv) { } // Exactly one of these is allowed at the same time - int optCount = result.count("version") + result.count("revision") + result.count("prefix"); + int optCount = result.count("version") + result.count("revision") + result.count("prefix") + result.count("ldflags") +result.count("cflags") + result.count("cxxflags"); if (optCount == 0) { std::cerr << "Error: No command specified.\n"; return EXIT_FAILURE; @@ -31,6 +36,15 @@ int main(int argc, char** argv) { std::cerr << "Warning: Multiple mutually exclusive commands specified. Only one of them will be processed.\n"; } + // Checking for consistency + bool useCaGe = result.contains("cage"); +#ifndef HAVE_GRAPH_TOOLS + if (useCaGe) { + std::cerr << "CaGe is currently not available. Configure with -DMETACG_BUILD_GRAPH_TOOLS to enable it.\n"; + return EXIT_FAILURE; + } +#endif + if (result.contains("version")) { std::cout << MetaCG_VERSION_MAJOR << "." << MetaCG_VERSION_MINOR; return EXIT_SUCCESS; @@ -46,5 +60,23 @@ int main(int argc, char** argv) { return EXIT_SUCCESS; } + if (result.contains("cflags")) { + if (useCaGe) { + std::cout << " -flto -fuse-ld=lld "; + } + } + + if (result.contains("cxxflags")) { + if (useCaGe) { + std::cout << " -flto -fuse-ld=lld "; + } + } + + if (result.contains("ldflags")) { + if (useCaGe) { + std::cout << " -flto -fuse-ld=lld -Wl,--load-pass-plugin=" << CAGE_PLUGIN << " "; + } + } + return EXIT_SUCCESS; } From 729754d6800e034a140012b446c25db8edb47c8c Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Fri, 14 Nov 2025 15:03:15 +0100 Subject: [PATCH 04/25] Add testing infrastructure for CaGe (WIP) --- tools/CMakeLists.txt | 1 + tools/cage/test/CMakeLists.txt | 8 +- tools/cage/test/input/0200/m1.cpp | 7 + tools/cage/test/input/0200/m2.cpp | 3 + tools/cage/test/input/0200/m2.h | 6 + tools/cage/test/input/0201/m1.cpp | 9 + tools/cage/test/input/0201/m2.cpp | 3 + tools/cage/test/input/0201/m2.h | 6 + tools/cage/test/input/0201/m3.cpp | 5 + tools/cage/test/input/0201/m3.h | 6 + tools/cage/test/input/allCtorDtor/0001.cpp | 13 + tools/cage/test/input/allCtorDtor/0001.gtmcg | 208 +++ .../test/input/allCtorDtor/0001.noinfer.gtmcg | 199 +++ tools/cage/test/input/allCtorDtor/0002.cpp | 7 + tools/cage/test/input/allCtorDtor/0002.gtmcg | 175 +++ .../test/input/allCtorDtor/0002.noinfer.gtmcg | 175 +++ tools/cage/test/input/allCtorDtor/0003.cpp | 15 + tools/cage/test/input/allCtorDtor/0003.gtmcg | 249 +++ .../test/input/allCtorDtor/0003.noinfer.gtmcg | 249 +++ tools/cage/test/input/allCtorDtor/0004.cpp | 14 + tools/cage/test/input/allCtorDtor/0004.gtmcg | 317 ++++ .../test/input/allCtorDtor/0004.noinfer.gtmcg | 305 ++++ tools/cage/test/input/allCtorDtor/0005.cpp | 11 + tools/cage/test/input/allCtorDtor/0005.gtmcg | 317 ++++ .../test/input/allCtorDtor/0005.noinfer.gtmcg | 299 ++++ tools/cage/test/input/allCtorDtor/0006.cpp | 13 + tools/cage/test/input/allCtorDtor/0006.gtmcg | 374 +++++ .../test/input/allCtorDtor/0006.noinfer.gtmcg | 362 +++++ tools/cage/test/input/allCtorDtor/0007.cpp | 15 + tools/cage/test/input/allCtorDtor/0007.gtmcg | 315 ++++ .../test/input/allCtorDtor/0007.noinfer.gtmcg | 304 ++++ tools/cage/test/input/allCtorDtor/0008.cpp | 16 + tools/cage/test/input/allCtorDtor/0008.gtmcg | 317 ++++ .../test/input/allCtorDtor/0008.noinfer.gtmcg | 305 ++++ .../cage/test/input/functionPointers/0041.cpp | 17 + .../test/input/functionPointers/0041.gtaacg | 252 +++ .../test/input/functionPointers/0041.gtipcg | 40 + .../test/input/functionPointers/0041.gtmcg | 68 + .../cage/test/input/functionPointers/0045.cpp | 27 + .../test/input/functionPointers/0045.gtaacg | 349 +++++ .../test/input/functionPointers/0045.gtipcg | 78 + .../test/input/functionPointers/0045.gtmcg | 124 ++ .../cage/test/input/functionPointers/0046.cpp | 21 + .../test/input/functionPointers/0046.gtaacg | 314 ++++ .../test/input/functionPointers/0046.gtipcg | 66 + .../test/input/functionPointers/0046.gtmcg | 106 ++ .../cage/test/input/functionPointers/0047.cpp | 21 + .../test/input/functionPointers/0047.gtaacg | 313 ++++ .../test/input/functionPointers/0047.gtipcg | 66 + .../test/input/functionPointers/0047.gtmcg | 106 ++ .../cage/test/input/functionPointers/0048.cpp | 19 + .../test/input/functionPointers/0048.gtaacg | 311 ++++ .../test/input/functionPointers/0048.gtipcg | 66 + .../test/input/functionPointers/0048.gtmcg | 106 ++ .../cage/test/input/functionPointers/0049.cpp | 16 + .../test/input/functionPointers/0049.gtaacg | 265 ++++ .../test/input/functionPointers/0049.gtipcg | 53 + .../test/input/functionPointers/0049.gtmcg | 87 ++ .../cage/test/input/functionPointers/0051.cpp | 20 + .../test/input/functionPointers/0051.gtaacg | 312 ++++ .../test/input/functionPointers/0051.gtipcg | 66 + .../test/input/functionPointers/0051.gtmcg | 106 ++ .../cage/test/input/functionPointers/0052.cpp | 22 + .../test/input/functionPointers/0052.gtaacg | 312 ++++ .../test/input/functionPointers/0052.gtipcg | 66 + .../test/input/functionPointers/0052.gtmcg | 106 ++ .../cage/test/input/functionPointers/0053.cpp | 13 + .../test/input/functionPointers/0053.gtaacg | 1 + .../test/input/functionPointers/0053.gtipcg | 26 + .../test/input/functionPointers/0053.gtmcg | 78 + .../cage/test/input/functionPointers/0100.cpp | 11 + .../test/input/functionPointers/0100.gtaacg | 172 +++ .../test/input/functionPointers/0100.gtipcg | 22 + .../test/input/functionPointers/0100.gtmcg | 44 + .../cage/test/input/functionPointers/0101.cpp | 13 + .../test/input/functionPointers/0101.gtaacg | 225 +++ .../test/input/functionPointers/0101.gtipcg | 32 + .../test/input/functionPointers/0101.gtmcg | 60 + .../cage/test/input/functionPointers/0102.cpp | 15 + .../test/input/functionPointers/0102.gtaacg | 278 ++++ .../test/input/functionPointers/0102.gtipcg | 42 + .../test/input/functionPointers/0102.gtmcg | 76 + .../cage/test/input/functionPointers/0103.cpp | 14 + .../test/input/functionPointers/0103.gtaacg | 276 ++++ .../test/input/functionPointers/0103.gtipcg | 49 + .../test/input/functionPointers/0103.gtmcg | 83 + .../cage/test/input/functionPointers/0115.cpp | 18 + .../test/input/functionPointers/0115.gtaacg | 453 ++++++ .../test/input/functionPointers/0115.gtipcg | 26 + .../test/input/functionPointers/0115.gtmcg | 78 + .../cage/test/input/functionPointers/0201.cpp | 11 + .../test/input/functionPointers/0201.gtaacg | 202 +++ .../test/input/functionPointers/0201.gtipcg | 39 + .../test/input/functionPointers/0201.gtmcg | 67 + .../cage/test/input/functionPointers/0202.cpp | 10 + .../test/input/functionPointers/0202.gtaacg | 145 ++ .../test/input/functionPointers/0202.gtipcg | 26 + .../test/input/functionPointers/0202.gtmcg | 48 + .../cage/test/input/functionPointers/0203.cpp | 17 + .../test/input/functionPointers/0203.gtaacg | 291 ++++ .../test/input/functionPointers/0203.gtipcg | 56 + .../test/input/functionPointers/0203.gtmcg | 90 ++ .../cage/test/input/functionPointers/0204.cpp | 16 + .../test/input/functionPointers/0204.gtaacg | 271 ++++ .../test/input/functionPointers/0204.gtipcg | 54 + .../test/input/functionPointers/0204.gtmcg | 88 ++ .../cage/test/input/functionPointers/0205.cpp | 11 + .../test/input/functionPointers/0205.gtaacg | 206 +++ .../test/input/functionPointers/0205.gtipcg | 36 + .../test/input/functionPointers/0205.gtmcg | 64 + .../cage/test/input/functionPointers/0206.cpp | 19 + .../test/input/functionPointers/0206.gtaacg | 273 ++++ .../test/input/functionPointers/0206.gtipcg | 50 + .../test/input/functionPointers/0206.gtmcg | 84 + .../cage/test/input/functionPointers/0207.cpp | 20 + .../test/input/functionPointers/0207.gtaacg | 733 +++++++++ .../test/input/functionPointers/0207.gtipcg | 165 ++ .../test/input/functionPointers/0207.gtmcg | 247 +++ .../cage/test/input/functionPointers/0208.cpp | 9 + .../test/input/functionPointers/0208.gtaacg | 415 +++++ .../test/input/functionPointers/0208.gtipcg | 40 + .../test/input/functionPointers/0208.gtmcg | 68 + .../cage/test/input/functionPointers/0209.cpp | 20 + .../test/input/functionPointers/0209.gtaacg | 530 +++++++ .../test/input/functionPointers/0209.gtipcg | 62 + .../test/input/functionPointers/0209.gtmcg | 102 ++ .../cage/test/input/functionPointers/0210.cpp | 10 + .../test/input/functionPointers/0210.gtaacg | 324 ++++ .../test/input/functionPointers/0210.gtipcg | 26 + .../test/input/functionPointers/0210.gtmcg | 78 + .../cage/test/input/functionPointers/0211.cpp | 14 + .../test/input/functionPointers/0211.gtaacg | 330 ++++ .../test/input/functionPointers/0211.gtipcg | 26 + .../test/input/functionPointers/0211.gtmcg | 48 + .../cage/test/input/functionPointers/0212.cpp | 15 + .../test/input/functionPointers/0212.gtaacg | 392 +++++ .../test/input/functionPointers/0212.gtipcg | 40 + .../test/input/functionPointers/0212.gtmcg | 68 + .../cage/test/input/functionPointers/0213.cpp | 16 + .../test/input/functionPointers/0213.gtaacg | 389 +++++ .../test/input/functionPointers/0213.gtipcg | 39 + .../test/input/functionPointers/0213.gtmcg | 67 + .../cage/test/input/functionPointers/0214.cpp | 11 + .../test/input/functionPointers/0214.gtaacg | 207 +++ .../test/input/functionPointers/0214.gtipcg | 36 + .../test/input/functionPointers/0214.gtmcg | 64 + .../cage/test/input/functionPointers/0216.cpp | 9 + .../test/input/functionPointers/0216.gtaacg | 316 ++++ .../test/input/functionPointers/0216.gtipcg | 26 + .../test/input/functionPointers/0216.gtmcg | 78 + .../cage/test/input/functionPointers/0217.cpp | 12 + .../test/input/functionPointers/0217.gtaacg | 331 ++++ .../test/input/functionPointers/0217.gtipcg | 26 + .../test/input/functionPointers/0217.gtmcg | 78 + .../metaCollectors/numStatements/0023.cpp | 10 + .../metaCollectors/numStatements/0023.gtaacg | 102 ++ .../metaCollectors/numStatements/0023.gtipcg | 12 + .../metaCollectors/numStatements/0023.gtmcg | 28 + .../metaCollectors/numStatements/0024.cpp | 11 + .../metaCollectors/numStatements/0024.gtaacg | 102 ++ .../metaCollectors/numStatements/0024.gtipcg | 12 + .../metaCollectors/numStatements/0024.gtmcg | 28 + .../metaCollectors/numStatements/0025.cpp | 12 + .../metaCollectors/numStatements/0025.gtaacg | 102 ++ .../metaCollectors/numStatements/0025.gtipcg | 12 + .../metaCollectors/numStatements/0025.gtmcg | 28 + .../metaCollectors/numStatements/0026.cpp | 15 + .../metaCollectors/numStatements/0026.gtaacg | 102 ++ .../metaCollectors/numStatements/0026.gtipcg | 12 + .../metaCollectors/numStatements/0026.gtmcg | 28 + .../metaCollectors/numStatements/0027.cpp | 16 + .../metaCollectors/numStatements/0027.gtaacg | 102 ++ .../metaCollectors/numStatements/0027.gtipcg | 12 + .../metaCollectors/numStatements/0027.gtmcg | 28 + .../metaCollectors/numStatements/0028.cpp | 16 + .../metaCollectors/numStatements/0028.gtaacg | 102 ++ .../metaCollectors/numStatements/0028.gtipcg | 12 + .../metaCollectors/numStatements/0028.gtmcg | 28 + .../metaCollectors/numStatements/0029.cpp | 18 + .../metaCollectors/numStatements/0029.gtaacg | 102 ++ .../metaCollectors/numStatements/0029.gtipcg | 12 + .../metaCollectors/numStatements/0029.gtmcg | 28 + .../metaCollectors/numStatements/0030.cpp | 19 + .../metaCollectors/numStatements/0030.gtaacg | 157 ++ .../metaCollectors/numStatements/0030.gtipcg | 26 + .../metaCollectors/numStatements/0030.gtmcg | 48 + .../metaCollectors/numStatements/0031.cpp | 22 + .../metaCollectors/numStatements/0031.gtaacg | 160 ++ .../metaCollectors/numStatements/0031.gtipcg | 26 + .../metaCollectors/numStatements/0031.gtmcg | 48 + .../metaCollectors/numStatements/0032.cpp | 34 + .../metaCollectors/numStatements/0032.gtaacg | 225 +++ .../metaCollectors/numStatements/0032.gtipcg | 39 + .../metaCollectors/numStatements/0032.gtmcg | 67 + .../metaCollectors/numStatements/0033.cpp | 36 + .../metaCollectors/numStatements/0033.gtaacg | 286 ++++ .../metaCollectors/numStatements/0033.gtipcg | 56 + .../metaCollectors/numStatements/0033.gtmcg | 90 ++ .../metaCollectors/numStatements/0034.cpp | 18 + .../metaCollectors/numStatements/0034.gtaacg | 160 ++ .../metaCollectors/numStatements/0034.gtipcg | 26 + .../metaCollectors/numStatements/0034.gtmcg | 48 + .../metaCollectors/numStatements/0035.cpp | 20 + .../metaCollectors/numStatements/0035.gtaacg | 160 ++ .../metaCollectors/numStatements/0035.gtipcg | 26 + .../metaCollectors/numStatements/0035.gtmcg | 48 + .../metaCollectors/numStatements/0036.cpp | 25 + .../metaCollectors/numStatements/0036.gtaacg | 160 ++ .../metaCollectors/numStatements/0036.gtipcg | 26 + .../metaCollectors/numStatements/0036.gtmcg | 48 + .../metaCollectors/numStatements/0037.cpp | 17 + .../metaCollectors/numStatements/0037.gtaacg | 155 ++ .../metaCollectors/numStatements/0037.gtipcg | 26 + .../metaCollectors/numStatements/0037.gtmcg | 48 + .../metaCollectors/numStatements/0038.cpp | 17 + .../metaCollectors/numStatements/0038.gtaacg | 166 ++ .../metaCollectors/numStatements/0038.gtipcg | 26 + .../metaCollectors/numStatements/0038.gtmcg | 48 + .../metaCollectors/numStatements/0039.cpp | 18 + .../metaCollectors/numStatements/0039.gtaacg | 166 ++ .../metaCollectors/numStatements/0039.gtipcg | 26 + .../metaCollectors/numStatements/0039.gtmcg | 48 + .../metaCollectors/numStatements/0040.cpp | 26 + .../metaCollectors/numStatements/0040.gtaacg | 160 ++ .../metaCollectors/numStatements/0040.gtipcg | 26 + .../metaCollectors/numStatements/0040.gtmcg | 48 + .../metaCollectors/numStatements/0041.cpp | 6 + .../metaCollectors/numStatements/0041.gtaacg | 522 +++++++ .../metaCollectors/numStatements/0041.gtipcg | 26 + .../metaCollectors/numStatements/0041.gtmcg | 78 + .../metaCollectors/numStatements/0042.cpp | 12 + .../metaCollectors/numStatements/0042.gtaacg | 548 +++++++ .../metaCollectors/numStatements/0042.gtipcg | 26 + .../metaCollectors/numStatements/0042.gtmcg | 78 + tools/cage/test/input/multiTU/0042_a.cpp | 3 + tools/cage/test/input/multiTU/0042_b.cpp | 7 + .../test/input/multiTU/0042_combined.gtmcg | 84 + tools/cage/test/input/multiTU/0043_a.cpp | 3 + tools/cage/test/input/multiTU/0043_b.cpp | 5 + .../test/input/multiTU/0043_combined.gtmcg | 96 ++ tools/cage/test/input/multiTU/0044_a.cpp | 5 + tools/cage/test/input/multiTU/0044_b.cpp | 3 + .../test/input/multiTU/0044_combined.gtmcg | 103 ++ tools/cage/test/input/multiTU/0050.h | 8 + tools/cage/test/input/multiTU/0050_a.cpp | 5 + tools/cage/test/input/multiTU/0050_b.cpp | 5 + .../test/input/multiTU/0050_combined.gtmcg | 103 ++ tools/cage/test/input/multiTU/0053.h | 10 + tools/cage/test/input/multiTU/0053_a.cpp | 3 + tools/cage/test/input/multiTU/0053_b.cpp | 15 + .../test/input/multiTU/0053_combined.gtmcg | 104 ++ tools/cage/test/input/multiTU/0060_a.cpp | 50 + tools/cage/test/input/multiTU/0060_b.cpp | 8 + .../test/input/multiTU/0060_combined.gtmcg | 174 +++ tools/cage/test/input/multiTU/0070_a.cpp | 7 + tools/cage/test/input/multiTU/0070_a.gtaacg | 150 ++ tools/cage/test/input/multiTU/0070_b.cpp | 1 + tools/cage/test/input/multiTU/0070_b.gtaacg | 91 ++ .../test/input/multiTU/0070_combined.gtaacg | 152 ++ tools/cage/test/input/multiTU/0071_a.cpp | 10 + tools/cage/test/input/multiTU/0071_a.gtaacg | 148 ++ tools/cage/test/input/multiTU/0071_b.cpp | 9 + tools/cage/test/input/multiTU/0071_b.gtaacg | 96 ++ .../test/input/multiTU/0071_combined.gtaacg | 215 +++ tools/cage/test/input/multiTU/0072_a.cpp | 22 + tools/cage/test/input/multiTU/0072_a.gtaacg | 252 +++ tools/cage/test/input/multiTU/0072_b.cpp | 22 + tools/cage/test/input/multiTU/0072_b.gtaacg | 198 +++ .../test/input/multiTU/0072_combined.gtaacg | 348 +++++ tools/cage/test/input/multiTU/0214_a.cpp | 11 + tools/cage/test/input/multiTU/0214_a.gtaacg | 189 +++ tools/cage/test/input/multiTU/0214_b.cpp | 5 + tools/cage/test/input/multiTU/0214_b.gtaacg | 96 ++ .../test/input/multiTU/0214_combined.gtaacg | 203 +++ tools/cage/test/input/multiTU/0240_a.cpp | 8 + tools/cage/test/input/multiTU/0240_a.gtaacg | 186 +++ tools/cage/test/input/multiTU/0240_b.cpp | 19 + tools/cage/test/input/multiTU/0240_b.gtaacg | 335 ++++ .../test/input/multiTU/0240_combined.gtaacg | 371 +++++ tools/cage/test/input/multiTU/0241_a.cpp | 42 + tools/cage/test/input/multiTU/0241_a.gtaacg | 1352 ++++++++++++++++ tools/cage/test/input/multiTU/0241_b.cpp | 12 + tools/cage/test/input/multiTU/0241_b.gtaacg | 289 ++++ .../test/input/multiTU/0241_combined.gtaacg | 1359 +++++++++++++++++ tools/cage/test/input/singleTU/0001.cpp | 3 + tools/cage/test/input/singleTU/0001.gtaacg | 90 ++ tools/cage/test/input/singleTU/0001.gtipcg | 12 + tools/cage/test/input/singleTU/0001.gtmcg | 28 + tools/cage/test/input/singleTU/0002.cpp | 8 + tools/cage/test/input/singleTU/0002.gtaacg | 150 ++ tools/cage/test/input/singleTU/0002.gtipcg | 26 + tools/cage/test/input/singleTU/0002.gtmcg | 48 + tools/cage/test/input/singleTU/0003.cpp | 10 + tools/cage/test/input/singleTU/0003.gtaacg | 206 +++ tools/cage/test/input/singleTU/0003.gtipcg | 40 + tools/cage/test/input/singleTU/0003.gtmcg | 68 + tools/cage/test/input/singleTU/0004.cpp | 12 + tools/cage/test/input/singleTU/0004.gtaacg | 156 ++ tools/cage/test/input/singleTU/0004.gtipcg | 22 + tools/cage/test/input/singleTU/0004.gtmcg | 44 + tools/cage/test/input/singleTU/0005.cpp | 11 + tools/cage/test/input/singleTU/0005.gtaacg | 208 +++ tools/cage/test/input/singleTU/0005.gtipcg | 39 + tools/cage/test/input/singleTU/0005.gtmcg | 67 + tools/cage/test/input/singleTU/0013.cpp | 12 + tools/cage/test/input/singleTU/0013.gtaacg | 266 ++++ tools/cage/test/input/singleTU/0013.gtipcg | 53 + tools/cage/test/input/singleTU/0013.gtmcg | 87 ++ tools/cage/test/input/singleTU/0014.cpp | 13 + tools/cage/test/input/singleTU/0014.gtaacg | 266 ++++ tools/cage/test/input/singleTU/0014.gtipcg | 56 + tools/cage/test/input/singleTU/0014.gtmcg | 90 ++ tools/cage/test/input/singleTU/0022.cpp | 10 + tools/cage/test/input/singleTU/0022.gtaacg | 103 ++ tools/cage/test/input/singleTU/0022.gtipcg | 12 + tools/cage/test/input/singleTU/0022.gtmcg | 28 + tools/cage/test/input/singleTU/0063.cpp | 3 + tools/cage/test/input/singleTU/0063.gtaacg | 59 + tools/cage/test/input/singleTU/0063.gtipcg | 1 + tools/cage/test/input/singleTU/0063.gtmcg | 11 + tools/cage/test/input/singleTU/0065.cpp | 27 + tools/cage/test/input/singleTU/0065.gtaacg | 269 ++++ tools/cage/test/input/singleTU/0065.gtipcg | 52 + tools/cage/test/input/singleTU/0065.gtmcg | 145 ++ tools/cage/test/input/singleTU/0066.cpp | 9 + tools/cage/test/input/singleTU/0066.gtaacg | 209 +++ tools/cage/test/input/singleTU/0066.gtipcg | 39 + tools/cage/test/input/singleTU/0066.gtmcg | 112 ++ tools/cage/test/input/singleTU/0215.cpp | 14 + tools/cage/test/input/singleTU/0215.gtaacg | 156 ++ tools/cage/test/input/singleTU/0215.gtipcg | 29 + tools/cage/test/input/singleTU/0215.gtmcg | 59 + tools/cage/test/input/singleTU/0221.cpp | 19 + tools/cage/test/input/singleTU/0221.gtaacg | 93 ++ tools/cage/test/input/singleTU/0221.gtipcg | 12 + tools/cage/test/input/singleTU/0221.gtmcg | 28 + tools/cage/test/input/singleTU/0222.cpp | 11 + tools/cage/test/input/singleTU/0222.gtaacg | 87 ++ tools/cage/test/input/singleTU/0222.gtipcg | 12 + tools/cage/test/input/singleTU/0222.gtmcg | 28 + tools/cage/test/input/singleTU/0223.cpp | 20 + tools/cage/test/input/singleTU/0223.gtaacg | 147 ++ tools/cage/test/input/singleTU/0223.gtipcg | 26 + tools/cage/test/input/singleTU/0223.gtmcg | 48 + tools/cage/test/input/singleTU/0224.cpp | 21 + tools/cage/test/input/singleTU/0224.gtaacg | 198 +++ tools/cage/test/input/singleTU/0224.gtipcg | 40 + tools/cage/test/input/singleTU/0224.gtmcg | 68 + tools/cage/test/input/singleTU/0225.cpp | 57 + tools/cage/test/input/singleTU/0225.gtaacg | 507 ++++++ tools/cage/test/input/singleTU/0225.gtipcg | 116 ++ tools/cage/test/input/singleTU/0225.gtmcg | 174 +++ tools/cage/test/input/singleTU/0226.cpp | 8 + tools/cage/test/input/singleTU/0226.gtaacg | 181 +++ tools/cage/test/input/singleTU/0226.gtipcg | 22 + tools/cage/test/input/singleTU/0226.gtmcg | 44 + tools/cage/test/input/singleTU/0227.cpp | 11 + tools/cage/test/input/singleTU/0227.gtaacg | 172 +++ tools/cage/test/input/singleTU/0227.gtipcg | 22 + tools/cage/test/input/singleTU/0227.gtmcg | 44 + tools/cage/test/input/singleTU/0228.cpp | 7 + tools/cage/test/input/singleTU/0228.gtaacg | 84 + tools/cage/test/input/singleTU/0228.gtipcg | 12 + tools/cage/test/input/singleTU/0228.gtmcg | 42 + tools/cage/test/input/singleTU/0230.cpp | 20 + tools/cage/test/input/singleTU/0230.gtaacg | 416 +++++ tools/cage/test/input/singleTU/0230.gtipcg | 39 + tools/cage/test/input/singleTU/0230.gtmcg | 111 ++ tools/cage/test/input/singleTU/0232.cpp | 16 + tools/cage/test/input/singleTU/0232.gtaacg | 542 +++++++ tools/cage/test/input/singleTU/0232.gtipcg | 62 + tools/cage/test/input/singleTU/0232.gtmcg | 192 +++ tools/cage/test/input/singleTU/0233.cpp | 6 + tools/cage/test/input/singleTU/0233.gtaacg | 220 +++ tools/cage/test/input/singleTU/0233.gtipcg | 12 + tools/cage/test/input/singleTU/0233.gtmcg | 42 + tools/cage/test/input/singleTU/0234.cpp | 16 + tools/cage/test/input/singleTU/0234.gtaacg | 542 +++++++ tools/cage/test/input/singleTU/0234.gtipcg | 69 + tools/cage/test/input/singleTU/0234.gtmcg | 202 +++ tools/cage/test/input/singleTU/0235.cpp | 18 + tools/cage/test/input/singleTU/0235.gtaacg | 344 +++++ tools/cage/test/input/singleTU/0235.gtipcg | 42 + tools/cage/test/input/singleTU/0235.gtmcg | 132 ++ tools/cage/test/input/singleTU/0237.cpp | 25 + tools/cage/test/input/singleTU/0237.gtaacg | 684 +++++++++ tools/cage/test/input/singleTU/0237.gtipcg | 66 + tools/cage/test/input/singleTU/0237.gtmcg | 198 +++ tools/cage/test/input/virtualCalls/0006.cpp | 13 + tools/cage/test/input/virtualCalls/0006.gtmcg | 48 + tools/cage/test/input/virtualCalls/0007.cpp | 14 + tools/cage/test/input/virtualCalls/0007.gtmcg | 192 +++ tools/cage/test/input/virtualCalls/0008.cpp | 21 + tools/cage/test/input/virtualCalls/0008.gtmcg | 68 + tools/cage/test/input/virtualCalls/0009.cpp | 21 + tools/cage/test/input/virtualCalls/0009.gtmcg | 68 + tools/cage/test/input/virtualCalls/0010.cpp | 29 + tools/cage/test/input/virtualCalls/0010.gtmcg | 130 ++ tools/cage/test/input/virtualCalls/0011.cpp | 20 + tools/cage/test/input/virtualCalls/0011.gtmcg | 64 + tools/cage/test/input/virtualCalls/0012.cpp | 20 + tools/cage/test/input/virtualCalls/0012.gtmcg | 64 + tools/cage/test/input/virtualCalls/0015.cpp | 27 + tools/cage/test/input/virtualCalls/0015.gtmcg | 88 ++ tools/cage/test/input/virtualCalls/0016.cpp | 26 + tools/cage/test/input/virtualCalls/0016.gtmcg | 180 +++ tools/cage/test/input/virtualCalls/0017.cpp | 29 + tools/cage/test/input/virtualCalls/0017.gtmcg | 180 +++ tools/cage/test/input/virtualCalls/0018.cpp | 26 + tools/cage/test/input/virtualCalls/0018.gtmcg | 183 +++ tools/cage/test/input/virtualCalls/0019.cpp | 22 + tools/cage/test/input/virtualCalls/0019.gtmcg | 68 + tools/cage/test/input/virtualCalls/0020.cpp | 22 + tools/cage/test/input/virtualCalls/0020.gtmcg | 68 + tools/cage/test/input/virtualCalls/0021.cpp | 27 + tools/cage/test/input/virtualCalls/0021.gtmcg | 88 ++ tools/cage/test/input/virtualCalls/0022.cpp | 32 + tools/cage/test/input/virtualCalls/0022.gtmcg | 112 ++ tools/cage/test/runCaGeTests.sh.in | 234 +++ tools/cage/test/runCageTests.sh | 5 - 420 files changed, 42796 insertions(+), 8 deletions(-) create mode 100644 tools/cage/test/input/0200/m1.cpp create mode 100644 tools/cage/test/input/0200/m2.cpp create mode 100644 tools/cage/test/input/0200/m2.h create mode 100644 tools/cage/test/input/0201/m1.cpp create mode 100644 tools/cage/test/input/0201/m2.cpp create mode 100644 tools/cage/test/input/0201/m2.h create mode 100644 tools/cage/test/input/0201/m3.cpp create mode 100644 tools/cage/test/input/0201/m3.h create mode 100644 tools/cage/test/input/allCtorDtor/0001.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0001.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0002.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0002.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0003.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0003.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0004.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0004.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0005.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0005.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0006.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0006.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0007.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0007.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0008.cpp create mode 100644 tools/cage/test/input/allCtorDtor/0008.gtmcg create mode 100644 tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0041.cpp create mode 100644 tools/cage/test/input/functionPointers/0041.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0041.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0041.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0045.cpp create mode 100644 tools/cage/test/input/functionPointers/0045.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0045.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0045.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0046.cpp create mode 100644 tools/cage/test/input/functionPointers/0046.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0046.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0046.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0047.cpp create mode 100644 tools/cage/test/input/functionPointers/0047.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0047.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0047.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0048.cpp create mode 100644 tools/cage/test/input/functionPointers/0048.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0048.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0048.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0049.cpp create mode 100644 tools/cage/test/input/functionPointers/0049.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0049.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0049.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0051.cpp create mode 100644 tools/cage/test/input/functionPointers/0051.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0051.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0051.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0052.cpp create mode 100644 tools/cage/test/input/functionPointers/0052.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0052.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0052.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0053.cpp create mode 100644 tools/cage/test/input/functionPointers/0053.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0053.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0053.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0100.cpp create mode 100644 tools/cage/test/input/functionPointers/0100.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0100.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0100.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0101.cpp create mode 100644 tools/cage/test/input/functionPointers/0101.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0101.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0101.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0102.cpp create mode 100644 tools/cage/test/input/functionPointers/0102.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0102.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0102.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0103.cpp create mode 100644 tools/cage/test/input/functionPointers/0103.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0103.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0103.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0115.cpp create mode 100644 tools/cage/test/input/functionPointers/0115.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0115.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0115.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0201.cpp create mode 100644 tools/cage/test/input/functionPointers/0201.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0201.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0201.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0202.cpp create mode 100644 tools/cage/test/input/functionPointers/0202.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0202.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0202.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0203.cpp create mode 100644 tools/cage/test/input/functionPointers/0203.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0203.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0203.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0204.cpp create mode 100644 tools/cage/test/input/functionPointers/0204.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0204.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0204.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0205.cpp create mode 100644 tools/cage/test/input/functionPointers/0205.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0205.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0205.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0206.cpp create mode 100644 tools/cage/test/input/functionPointers/0206.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0206.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0206.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0207.cpp create mode 100644 tools/cage/test/input/functionPointers/0207.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0207.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0207.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0208.cpp create mode 100644 tools/cage/test/input/functionPointers/0208.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0208.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0208.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0209.cpp create mode 100644 tools/cage/test/input/functionPointers/0209.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0209.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0209.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0210.cpp create mode 100644 tools/cage/test/input/functionPointers/0210.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0210.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0210.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0211.cpp create mode 100644 tools/cage/test/input/functionPointers/0211.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0211.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0211.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0212.cpp create mode 100644 tools/cage/test/input/functionPointers/0212.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0212.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0212.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0213.cpp create mode 100644 tools/cage/test/input/functionPointers/0213.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0213.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0213.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0214.cpp create mode 100644 tools/cage/test/input/functionPointers/0214.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0214.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0214.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0216.cpp create mode 100644 tools/cage/test/input/functionPointers/0216.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0216.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0216.gtmcg create mode 100644 tools/cage/test/input/functionPointers/0217.cpp create mode 100644 tools/cage/test/input/functionPointers/0217.gtaacg create mode 100644 tools/cage/test/input/functionPointers/0217.gtipcg create mode 100644 tools/cage/test/input/functionPointers/0217.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.cpp create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg create mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg create mode 100644 tools/cage/test/input/multiTU/0042_a.cpp create mode 100644 tools/cage/test/input/multiTU/0042_b.cpp create mode 100644 tools/cage/test/input/multiTU/0042_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0043_a.cpp create mode 100644 tools/cage/test/input/multiTU/0043_b.cpp create mode 100644 tools/cage/test/input/multiTU/0043_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0044_a.cpp create mode 100644 tools/cage/test/input/multiTU/0044_b.cpp create mode 100644 tools/cage/test/input/multiTU/0044_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0050.h create mode 100644 tools/cage/test/input/multiTU/0050_a.cpp create mode 100644 tools/cage/test/input/multiTU/0050_b.cpp create mode 100644 tools/cage/test/input/multiTU/0050_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0053.h create mode 100644 tools/cage/test/input/multiTU/0053_a.cpp create mode 100644 tools/cage/test/input/multiTU/0053_b.cpp create mode 100644 tools/cage/test/input/multiTU/0053_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0060_a.cpp create mode 100644 tools/cage/test/input/multiTU/0060_b.cpp create mode 100644 tools/cage/test/input/multiTU/0060_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0070_a.cpp create mode 100644 tools/cage/test/input/multiTU/0070_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0070_b.cpp create mode 100644 tools/cage/test/input/multiTU/0070_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0070_combined.gtaacg create mode 100644 tools/cage/test/input/multiTU/0071_a.cpp create mode 100644 tools/cage/test/input/multiTU/0071_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0071_b.cpp create mode 100644 tools/cage/test/input/multiTU/0071_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0071_combined.gtaacg create mode 100644 tools/cage/test/input/multiTU/0072_a.cpp create mode 100644 tools/cage/test/input/multiTU/0072_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0072_b.cpp create mode 100644 tools/cage/test/input/multiTU/0072_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0072_combined.gtaacg create mode 100644 tools/cage/test/input/multiTU/0214_a.cpp create mode 100644 tools/cage/test/input/multiTU/0214_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0214_b.cpp create mode 100644 tools/cage/test/input/multiTU/0214_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0214_combined.gtaacg create mode 100644 tools/cage/test/input/multiTU/0240_a.cpp create mode 100644 tools/cage/test/input/multiTU/0240_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0240_b.cpp create mode 100644 tools/cage/test/input/multiTU/0240_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0240_combined.gtaacg create mode 100644 tools/cage/test/input/multiTU/0241_a.cpp create mode 100644 tools/cage/test/input/multiTU/0241_a.gtaacg create mode 100644 tools/cage/test/input/multiTU/0241_b.cpp create mode 100644 tools/cage/test/input/multiTU/0241_b.gtaacg create mode 100644 tools/cage/test/input/multiTU/0241_combined.gtaacg create mode 100644 tools/cage/test/input/singleTU/0001.cpp create mode 100644 tools/cage/test/input/singleTU/0001.gtaacg create mode 100644 tools/cage/test/input/singleTU/0001.gtipcg create mode 100644 tools/cage/test/input/singleTU/0001.gtmcg create mode 100644 tools/cage/test/input/singleTU/0002.cpp create mode 100644 tools/cage/test/input/singleTU/0002.gtaacg create mode 100644 tools/cage/test/input/singleTU/0002.gtipcg create mode 100644 tools/cage/test/input/singleTU/0002.gtmcg create mode 100644 tools/cage/test/input/singleTU/0003.cpp create mode 100644 tools/cage/test/input/singleTU/0003.gtaacg create mode 100644 tools/cage/test/input/singleTU/0003.gtipcg create mode 100644 tools/cage/test/input/singleTU/0003.gtmcg create mode 100644 tools/cage/test/input/singleTU/0004.cpp create mode 100644 tools/cage/test/input/singleTU/0004.gtaacg create mode 100644 tools/cage/test/input/singleTU/0004.gtipcg create mode 100644 tools/cage/test/input/singleTU/0004.gtmcg create mode 100644 tools/cage/test/input/singleTU/0005.cpp create mode 100644 tools/cage/test/input/singleTU/0005.gtaacg create mode 100644 tools/cage/test/input/singleTU/0005.gtipcg create mode 100644 tools/cage/test/input/singleTU/0005.gtmcg create mode 100644 tools/cage/test/input/singleTU/0013.cpp create mode 100644 tools/cage/test/input/singleTU/0013.gtaacg create mode 100644 tools/cage/test/input/singleTU/0013.gtipcg create mode 100644 tools/cage/test/input/singleTU/0013.gtmcg create mode 100644 tools/cage/test/input/singleTU/0014.cpp create mode 100644 tools/cage/test/input/singleTU/0014.gtaacg create mode 100644 tools/cage/test/input/singleTU/0014.gtipcg create mode 100644 tools/cage/test/input/singleTU/0014.gtmcg create mode 100644 tools/cage/test/input/singleTU/0022.cpp create mode 100644 tools/cage/test/input/singleTU/0022.gtaacg create mode 100644 tools/cage/test/input/singleTU/0022.gtipcg create mode 100644 tools/cage/test/input/singleTU/0022.gtmcg create mode 100644 tools/cage/test/input/singleTU/0063.cpp create mode 100644 tools/cage/test/input/singleTU/0063.gtaacg create mode 100644 tools/cage/test/input/singleTU/0063.gtipcg create mode 100644 tools/cage/test/input/singleTU/0063.gtmcg create mode 100644 tools/cage/test/input/singleTU/0065.cpp create mode 100644 tools/cage/test/input/singleTU/0065.gtaacg create mode 100644 tools/cage/test/input/singleTU/0065.gtipcg create mode 100644 tools/cage/test/input/singleTU/0065.gtmcg create mode 100644 tools/cage/test/input/singleTU/0066.cpp create mode 100644 tools/cage/test/input/singleTU/0066.gtaacg create mode 100644 tools/cage/test/input/singleTU/0066.gtipcg create mode 100644 tools/cage/test/input/singleTU/0066.gtmcg create mode 100644 tools/cage/test/input/singleTU/0215.cpp create mode 100644 tools/cage/test/input/singleTU/0215.gtaacg create mode 100644 tools/cage/test/input/singleTU/0215.gtipcg create mode 100644 tools/cage/test/input/singleTU/0215.gtmcg create mode 100644 tools/cage/test/input/singleTU/0221.cpp create mode 100644 tools/cage/test/input/singleTU/0221.gtaacg create mode 100644 tools/cage/test/input/singleTU/0221.gtipcg create mode 100644 tools/cage/test/input/singleTU/0221.gtmcg create mode 100644 tools/cage/test/input/singleTU/0222.cpp create mode 100644 tools/cage/test/input/singleTU/0222.gtaacg create mode 100644 tools/cage/test/input/singleTU/0222.gtipcg create mode 100644 tools/cage/test/input/singleTU/0222.gtmcg create mode 100644 tools/cage/test/input/singleTU/0223.cpp create mode 100644 tools/cage/test/input/singleTU/0223.gtaacg create mode 100644 tools/cage/test/input/singleTU/0223.gtipcg create mode 100644 tools/cage/test/input/singleTU/0223.gtmcg create mode 100644 tools/cage/test/input/singleTU/0224.cpp create mode 100644 tools/cage/test/input/singleTU/0224.gtaacg create mode 100644 tools/cage/test/input/singleTU/0224.gtipcg create mode 100644 tools/cage/test/input/singleTU/0224.gtmcg create mode 100644 tools/cage/test/input/singleTU/0225.cpp create mode 100644 tools/cage/test/input/singleTU/0225.gtaacg create mode 100644 tools/cage/test/input/singleTU/0225.gtipcg create mode 100644 tools/cage/test/input/singleTU/0225.gtmcg create mode 100644 tools/cage/test/input/singleTU/0226.cpp create mode 100644 tools/cage/test/input/singleTU/0226.gtaacg create mode 100644 tools/cage/test/input/singleTU/0226.gtipcg create mode 100644 tools/cage/test/input/singleTU/0226.gtmcg create mode 100644 tools/cage/test/input/singleTU/0227.cpp create mode 100644 tools/cage/test/input/singleTU/0227.gtaacg create mode 100644 tools/cage/test/input/singleTU/0227.gtipcg create mode 100644 tools/cage/test/input/singleTU/0227.gtmcg create mode 100644 tools/cage/test/input/singleTU/0228.cpp create mode 100644 tools/cage/test/input/singleTU/0228.gtaacg create mode 100644 tools/cage/test/input/singleTU/0228.gtipcg create mode 100644 tools/cage/test/input/singleTU/0228.gtmcg create mode 100644 tools/cage/test/input/singleTU/0230.cpp create mode 100644 tools/cage/test/input/singleTU/0230.gtaacg create mode 100644 tools/cage/test/input/singleTU/0230.gtipcg create mode 100644 tools/cage/test/input/singleTU/0230.gtmcg create mode 100644 tools/cage/test/input/singleTU/0232.cpp create mode 100644 tools/cage/test/input/singleTU/0232.gtaacg create mode 100644 tools/cage/test/input/singleTU/0232.gtipcg create mode 100644 tools/cage/test/input/singleTU/0232.gtmcg create mode 100644 tools/cage/test/input/singleTU/0233.cpp create mode 100644 tools/cage/test/input/singleTU/0233.gtaacg create mode 100644 tools/cage/test/input/singleTU/0233.gtipcg create mode 100644 tools/cage/test/input/singleTU/0233.gtmcg create mode 100644 tools/cage/test/input/singleTU/0234.cpp create mode 100644 tools/cage/test/input/singleTU/0234.gtaacg create mode 100644 tools/cage/test/input/singleTU/0234.gtipcg create mode 100644 tools/cage/test/input/singleTU/0234.gtmcg create mode 100644 tools/cage/test/input/singleTU/0235.cpp create mode 100644 tools/cage/test/input/singleTU/0235.gtaacg create mode 100644 tools/cage/test/input/singleTU/0235.gtipcg create mode 100644 tools/cage/test/input/singleTU/0235.gtmcg create mode 100644 tools/cage/test/input/singleTU/0237.cpp create mode 100644 tools/cage/test/input/singleTU/0237.gtaacg create mode 100644 tools/cage/test/input/singleTU/0237.gtipcg create mode 100644 tools/cage/test/input/singleTU/0237.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0006.cpp create mode 100644 tools/cage/test/input/virtualCalls/0006.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0007.cpp create mode 100644 tools/cage/test/input/virtualCalls/0007.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0008.cpp create mode 100644 tools/cage/test/input/virtualCalls/0008.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0009.cpp create mode 100644 tools/cage/test/input/virtualCalls/0009.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0010.cpp create mode 100644 tools/cage/test/input/virtualCalls/0010.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0011.cpp create mode 100644 tools/cage/test/input/virtualCalls/0011.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0012.cpp create mode 100644 tools/cage/test/input/virtualCalls/0012.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0015.cpp create mode 100644 tools/cage/test/input/virtualCalls/0015.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0016.cpp create mode 100644 tools/cage/test/input/virtualCalls/0016.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0017.cpp create mode 100644 tools/cage/test/input/virtualCalls/0017.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0018.cpp create mode 100644 tools/cage/test/input/virtualCalls/0018.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0019.cpp create mode 100644 tools/cage/test/input/virtualCalls/0019.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0020.cpp create mode 100644 tools/cage/test/input/virtualCalls/0020.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0021.cpp create mode 100644 tools/cage/test/input/virtualCalls/0021.gtmcg create mode 100644 tools/cage/test/input/virtualCalls/0022.cpp create mode 100644 tools/cage/test/input/virtualCalls/0022.gtmcg create mode 100755 tools/cage/test/runCaGeTests.sh.in delete mode 100644 tools/cage/test/runCageTests.sh diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8ca2dc9e..42032916 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(cgcollector2) add_subdirectory(cgmerge2) add_subdirectory(cgconvert) add_subdirectory(cgformat) diff --git a/tools/cage/test/CMakeLists.txt b/tools/cage/test/CMakeLists.txt index 9c2a13a4..2baadeb6 100644 --- a/tools/cage/test/CMakeLists.txt +++ b/tools/cage/test/CMakeLists.txt @@ -1,5 +1,7 @@ set(METACG_CONFIG "${CMAKE_BINARY_DIR}/utils/config/metacg-config") -set(TEST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/01_simple") -configure_file(01_simple/Makefile.in - ${CMAKE_CURRENT_BINARY_DIR}/01_simple/Makefile +set(TEST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + + +configure_file(runCaGeTests.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/runCaGeTests.sh @ONLY) \ No newline at end of file diff --git a/tools/cage/test/input/0200/m1.cpp b/tools/cage/test/input/0200/m1.cpp new file mode 100644 index 00000000..dff5a9f9 --- /dev/null +++ b/tools/cage/test/input/0200/m1.cpp @@ -0,0 +1,7 @@ +#include "m2.h" + +int main() { + foo(); + + return 0; +} diff --git a/tools/cage/test/input/0200/m2.cpp b/tools/cage/test/input/0200/m2.cpp new file mode 100644 index 00000000..51a825ab --- /dev/null +++ b/tools/cage/test/input/0200/m2.cpp @@ -0,0 +1,3 @@ +#include "m2.h" + +int foo() { return 0; } diff --git a/tools/cage/test/input/0200/m2.h b/tools/cage/test/input/0200/m2.h new file mode 100644 index 00000000..c7b08d84 --- /dev/null +++ b/tools/cage/test/input/0200/m2.h @@ -0,0 +1,6 @@ +#ifndef M2_H +#define M2_H + +int foo(); + +#endif diff --git a/tools/cage/test/input/0201/m1.cpp b/tools/cage/test/input/0201/m1.cpp new file mode 100644 index 00000000..9f25e330 --- /dev/null +++ b/tools/cage/test/input/0201/m1.cpp @@ -0,0 +1,9 @@ +#include "m2.h" +#include "m3.h" + +int main() { + foo(); + booq(); + + return 0; +} diff --git a/tools/cage/test/input/0201/m2.cpp b/tools/cage/test/input/0201/m2.cpp new file mode 100644 index 00000000..51a825ab --- /dev/null +++ b/tools/cage/test/input/0201/m2.cpp @@ -0,0 +1,3 @@ +#include "m2.h" + +int foo() { return 0; } diff --git a/tools/cage/test/input/0201/m2.h b/tools/cage/test/input/0201/m2.h new file mode 100644 index 00000000..c7b08d84 --- /dev/null +++ b/tools/cage/test/input/0201/m2.h @@ -0,0 +1,6 @@ +#ifndef M2_H +#define M2_H + +int foo(); + +#endif diff --git a/tools/cage/test/input/0201/m3.cpp b/tools/cage/test/input/0201/m3.cpp new file mode 100644 index 00000000..9cd89226 --- /dev/null +++ b/tools/cage/test/input/0201/m3.cpp @@ -0,0 +1,5 @@ +#include "m3.h" + +#include "m2.h" + +int booq() { return foo(); } diff --git a/tools/cage/test/input/0201/m3.h b/tools/cage/test/input/0201/m3.h new file mode 100644 index 00000000..03e75e26 --- /dev/null +++ b/tools/cage/test/input/0201/m3.h @@ -0,0 +1,6 @@ +#ifndef M3_H +#define M3_H + +int booq(); + +#endif diff --git a/tools/cage/test/input/allCtorDtor/0001.cpp b/tools/cage/test/input/allCtorDtor/0001.cpp new file mode 100644 index 00000000..a3df49ee --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0001.cpp @@ -0,0 +1,13 @@ +// call to constructor and virtual destructor + +class MyClass { + public: + MyClass() {} + virtual ~MyClass() {} +}; + +int main(int argc, char* argv[]) { + MyClass mc; + + return 0; +} diff --git a/tools/cage/test/input/allCtorDtor/0001.gtmcg b/tools/cage/test/input/allCtorDtor/0001.gtmcg new file mode 100644 index 00000000..82bd287a --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0001.gtmcg @@ -0,0 +1,208 @@ +{ + "_CG": { + "_ZN7MyClassC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD0Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClassC1Ev", + "_ZN7MyClassC2Ev", + "_ZN7MyClassD0Ev", + "_ZN7MyClassD1Ev", + "_ZN7MyClassD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg new file mode 100644 index 00000000..c0c257d3 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg @@ -0,0 +1,199 @@ +{ + "_CG": { + "_ZN7MyClassC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD0Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClassC1Ev", + "_ZN7MyClassC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0002.cpp b/tools/cage/test/input/allCtorDtor/0002.cpp new file mode 100644 index 00000000..727ac61c --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0002.cpp @@ -0,0 +1,7 @@ +struct Base {}; + +int main(int argc, char** argv) { + Base* bp = new Base(); + delete bp; + return 0; +} diff --git a/tools/cage/test/input/allCtorDtor/0002.gtmcg b/tools/cage/test/input/allCtorDtor/0002.gtmcg new file mode 100644 index 00000000..21668260 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0002.gtmcg @@ -0,0 +1,175 @@ +{ + "_CG": { + "_ZN4BaseC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseD1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseD2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev", + "_ZN4BaseD1Ev", + "_ZN4BaseD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg new file mode 100644 index 00000000..21668260 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg @@ -0,0 +1,175 @@ +{ + "_CG": { + "_ZN4BaseC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseD1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseD2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev", + "_ZN4BaseD1Ev", + "_ZN4BaseD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0003.cpp b/tools/cage/test/input/allCtorDtor/0003.cpp new file mode 100644 index 00000000..bcda4ddc --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0003.cpp @@ -0,0 +1,15 @@ +// Member b of A is default-initialized, this must be caught by cgcollector. +// This will lead to a callpath existing from A() through B() to hidden() + +void hidden() {} + +struct B { + int* data; + B() { hidden(); } +}; + +struct A { + A() {} + + B b; +}; \ No newline at end of file diff --git a/tools/cage/test/input/allCtorDtor/0003.gtmcg b/tools/cage/test/input/allCtorDtor/0003.gtmcg new file mode 100644 index 00000000..0c4c822d --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0003.gtmcg @@ -0,0 +1,249 @@ +{ + "_CG": { + "_Z6hiddenv": { + "callees": [], + "callers": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [ + "_Z6hiddenv" + ], + "callers": [ + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z6hiddenv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z6hiddenv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [ + "_Z6hiddenv" + ], + "callers": [ + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z6hiddenv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z6hiddenv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg new file mode 100644 index 00000000..5b80796b --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg @@ -0,0 +1,249 @@ +{ + "_CG": { + "_Z6hiddenv": { + "callees": [], + "callers": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [ + "_Z6hiddenv" + ], + "callers": [ + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z6hiddenv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z6hiddenv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [ + "_Z6hiddenv" + ], + "callers": [ + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z6hiddenv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z6hiddenv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "2c7e1376528c362b9223eb220b3b32ae8731dd30", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0004.cpp b/tools/cage/test/input/allCtorDtor/0004.cpp new file mode 100644 index 00000000..0ed36ebc --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0004.cpp @@ -0,0 +1,14 @@ +// The destructor ~A() should appear an (implicit) callee of ~B(). + +struct A { + ~A() {} +}; + +struct B : A { + ~B(){}; +}; + +void foo() { + B* b = new B; + delete b; +} diff --git a/tools/cage/test/input/allCtorDtor/0004.gtmcg b/tools/cage/test/input/allCtorDtor/0004.gtmcg new file mode 100644 index 00000000..bfb027cd --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0004.gtmcg @@ -0,0 +1,317 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg new file mode 100644 index 00000000..5a135ee0 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg @@ -0,0 +1,305 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0005.cpp b/tools/cage/test/input/allCtorDtor/0005.cpp new file mode 100644 index 00000000..d7a23586 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0005.cpp @@ -0,0 +1,11 @@ +// Tests if the destruction of local variables is properly captured. + +struct A { + ~A() {} +}; + +struct B : A { + ~B(){}; +}; + +void foo() { B b; } diff --git a/tools/cage/test/input/allCtorDtor/0005.gtmcg b/tools/cage/test/input/allCtorDtor/0005.gtmcg new file mode 100644 index 00000000..eb7bf277 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0005.gtmcg @@ -0,0 +1,317 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg new file mode 100644 index 00000000..47f2b8f3 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg @@ -0,0 +1,299 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0006.cpp b/tools/cage/test/input/allCtorDtor/0006.cpp new file mode 100644 index 00000000..f19d14f6 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0006.cpp @@ -0,0 +1,13 @@ +// Tests if the destruction of temporary local variables is properly captured. + +struct A { + ~A() {} +}; + +struct B : A { + ~B(){}; +}; + +B makeB() { return B(); } + +void foo() { makeB(); } diff --git a/tools/cage/test/input/allCtorDtor/0006.gtmcg b/tools/cage/test/input/allCtorDtor/0006.gtmcg new file mode 100644 index 00000000..476f9382 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0006.gtmcg @@ -0,0 +1,374 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_Z5makeBv", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z5makeBv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z5makeBv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5makeBv": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov", + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov", + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg new file mode 100644 index 00000000..cd2b0fe6 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg @@ -0,0 +1,362 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_Z5makeBv", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": { + "_Z5makeBv": [ + [ + 1.0, + "" + ] + ] + }, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": { + "_Z5makeBv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5makeBv": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [], + "callers": [ + "_Z3foov", + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [], + "callers": [ + "_Z3foov", + "_Z5makeBv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0007.cpp b/tools/cage/test/input/allCtorDtor/0007.cpp new file mode 100644 index 00000000..07305472 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0007.cpp @@ -0,0 +1,15 @@ +// Tests if non-virtual destructors are handled correctly. + +struct A { + ~A() {} +}; + +struct B : A { + ~B(){}; +}; + +void foo() { + A* b = new B; + // This should only call the destructor of A + delete b; +} diff --git a/tools/cage/test/input/allCtorDtor/0007.gtmcg b/tools/cage/test/input/allCtorDtor/0007.gtmcg new file mode 100644 index 00000000..cba016bf --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0007.gtmcg @@ -0,0 +1,315 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev", + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_Z3foov", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_Z3foov", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg new file mode 100644 index 00000000..8fdf55b6 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg @@ -0,0 +1,304 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev", + "_ZN1BC1Ev", + "_ZN1BC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0008.cpp b/tools/cage/test/input/allCtorDtor/0008.cpp new file mode 100644 index 00000000..55d3e4aa --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0008.cpp @@ -0,0 +1,16 @@ +// Tests if implicit destruction of member variables is properly captured. + +struct A { + ~A() {} +}; + +struct B { + // ~A() should be called here. + ~B(){}; + A a; +}; + +void foo() { + B* b = new B; + delete b; +} diff --git a/tools/cage/test/input/allCtorDtor/0008.gtmcg b/tools/cage/test/input/allCtorDtor/0008.gtmcg new file mode 100644 index 00000000..7d560f0c --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0008.gtmcg @@ -0,0 +1,317 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [ + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [ + "_ZN1AD1Ev", + "_ZN1AD2Ev" + ], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg new file mode 100644 index 00000000..88732fb2 --- /dev/null +++ b/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg @@ -0,0 +1,305 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [ + "_ZN1BC1Ev", + "_ZN1BC2Ev", + "_ZN1BD1Ev", + "_ZN1BD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": false, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": true + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD1Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BD2Ev": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "estimateCallCount": { + "calls": {}, + "codeRegions": {} + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "inlineInfo": { + "isTemplate": false, + "likelyInline": true, + "markedAlwaysInline": false, + "markedInline": false + }, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", + "version": "0.7" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0041.cpp b/tools/cage/test/input/functionPointers/0041.cpp new file mode 100644 index 00000000..8ea6dbbc --- /dev/null +++ b/tools/cage/test/input/functionPointers/0041.cpp @@ -0,0 +1,17 @@ + +typedef void (*target_func_T)(int a, int b, int c); + +void callTarget(int a, int b, int c) { + int d = a + b; + d *= c; +} + +void pointerCaller(target_func_T f, int a, int b, int c) { f(a, b, c); } + +int main(int argc, char** argv) { + int a, b, c; + a = b = c = 42; + pointerCaller(callTarget, a, b, c); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0041.gtaacg b/tools/cage/test/input/functionPointers/0041.gtaacg new file mode 100644 index 00000000..5920c3b2 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0041.gtaacg @@ -0,0 +1,252 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191": "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" + }, + "CallInfoMap": { + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191": { + "Arguments": [ + [ + "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a" + ], + [ + "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b" + ], + [ + "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c" + ] + ], + "CalledObjects": [ + "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@216@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@206@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f", + "c:@F@callTarget#I#I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@266-299", + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191", + "c:@F@callTarget#I#I#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@95@F@callTarget#I#I#I#@d", + "c:0041.cpp@70@F@callTarget#I#I#I#@a", + "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a", + "c:0041.cpp@233@F@main#I#**C#@a", + "c:0041.cpp@84@F@callTarget#I#I#I#@c", + "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c", + "c:0041.cpp@233@F@main#I#**C#@c", + "c:0041.cpp@77@F@callTarget#I#I#I#@b", + "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b", + "c:0041.cpp@233@F@main#I#**C#@b" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@callTarget#I#I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z10callTargetiii" + ], + "Parameters": [ + "c:0041.cpp@70@F@callTarget#I#I#I#@a", + "c:0041.cpp@77@F@callTarget#I#I#I#@b", + "c:0041.cpp@84@F@callTarget#I#I#I#@c" + ], + "ReferencedInReturnStmts": [ + "c:@F@callTarget#I#I#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0041.cpp@206@F@main#I#**C#@argc", + "c:0041.cpp@216@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + }, + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z13pointerCallerPFviiiEiii" + ], + "Parameters": [ + "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f", + "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a", + "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b", + "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c" + ], + "ReferencedInReturnStmts": [ + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@callTarget#I#I#I#": "c:@F@callTarget#I#I#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#", + "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#": "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" + } + }, + "_CG": { + "_Z10callTargetiii": { + "callees": [], + "callers": [ + "_Z13pointerCallerPFviiiEiii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z13pointerCallerPFviiiEiii": { + "callees": [ + "_Z10callTargetiii" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z13pointerCallerPFviiiEiii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z13pointerCallerPFviiiEiii": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0041.gtipcg b/tools/cage/test/input/functionPointers/0041.gtipcg new file mode 100644 index 00000000..07c0dda0 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0041.gtipcg @@ -0,0 +1,40 @@ +{ + "_Z10callTargetiii": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z13pointerCallerPFviiiEiii" + ] + }, + "_Z13pointerCallerPFviiiEiii": { + "callees": [ + "_Z10callTargetiii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z13pointerCallerPFviiiEiii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0041.gtmcg b/tools/cage/test/input/functionPointers/0041.gtmcg new file mode 100644 index 00000000..2d4732af --- /dev/null +++ b/tools/cage/test/input/functionPointers/0041.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_Z10callTargetiii": { + "callees": [], + "callers": [ + "_Z13pointerCallerPFviiiEiii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z13pointerCallerPFviiiEiii": { + "callees": [ + "_Z10callTargetiii" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z13pointerCallerPFviiiEiii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0045.cpp b/tools/cage/test/input/functionPointers/0045.cpp new file mode 100644 index 00000000..b6933910 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0045.cpp @@ -0,0 +1,27 @@ + +int one() { return 1; } + +int two() { return 2; } + +int three() { return 3; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + if (i == 1) + return one; + if (i == 2) + return two; + if (i == 3) + return three; + return dflt; +} + +int main() { + int (*f)() = get(1); + int a = f(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0045.gtaacg b/tools/cage/test/input/functionPointers/0045.gtaacg new file mode 100644 index 00000000..74c8a72a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0045.gtaacg @@ -0,0 +1,349 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@299-301": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@299-301": { + "Arguments": [], + "CalledObjects": [ + "c:0045.cpp@268@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0045.cpp@134@F@get#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0045.cpp@268@F@main#@f", + "c:@F@main#@CALL_EXPR@@281-286", + "c:@F@dflt#", + "c:@F@one#", + "c:@F@three#", + "c:@F@two#", + "c:@F@get#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0045.cpp@291@F@main#@a", + "c:@F@main#@CALL_EXPR@@299-301", + "c:@F@dflt#@SRETURN", + "c:@F@one#@SRETURN", + "c:@F@three#@SRETURN", + "c:@F@two#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0045.cpp@134@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@dflt#", + "c:@F@one#", + "c:@F@three#", + "c:@F@two#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + }, + "c:@F@three#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5threev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@three#@SRETURN" + ] + }, + "c:@F@two#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3twov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@two#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#", + "c:@F@three#": "c:@F@three#", + "c:@F@two#": "c:@F@two#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 3, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 6, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3twov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5threev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3geti", + "_Z3onev", + "_Z3twov", + "_Z4dfltv", + "_Z5threev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0, + "_Z3onev": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0045.gtipcg b/tools/cage/test/input/functionPointers/0045.gtipcg new file mode 100644 index 00000000..44fe6717 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0045.gtipcg @@ -0,0 +1,78 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 7, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3twov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5threev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3geti", + "_Z3onev", + "_Z3twov", + "_Z4dfltv", + "_Z5threev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0045.gtmcg b/tools/cage/test/input/functionPointers/0045.gtmcg new file mode 100644 index 00000000..32644f79 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0045.gtmcg @@ -0,0 +1,124 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3twov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5threev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z5threev", + "_Z4dfltv", + "_Z3twov", + "_Z3onev", + "_Z3geti" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0046.cpp b/tools/cage/test/input/functionPointers/0046.cpp new file mode 100644 index 00000000..e56cba8c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0046.cpp @@ -0,0 +1,21 @@ + +int one() { return 1; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + if (i == 1) + return one; + return dflt; +} + +Fn get2(int i) { return get(i); } + +int main() { + int (*f)() = get2(1); + int a = f(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0046.gtaacg b/tools/cage/test/input/functionPointers/0046.gtaacg new file mode 100644 index 00000000..23255311 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0046.gtaacg @@ -0,0 +1,314 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@221-223": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@221-223": { + "Arguments": [], + "CalledObjects": [ + "c:0046.cpp@189@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0046.cpp@82@F@get#I#@i", + "c:0046.cpp@147@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0046.cpp@189@F@main#@f", + "c:@F@main#@CALL_EXPR@@202-208", + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0046.cpp@213@F@main#@a", + "c:@F@main#@CALL_EXPR@@221-223", + "c:@F@dflt#@SRETURN", + "c:@F@one#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0046.cpp@82@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0046.cpp@147@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3onev": 0, + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0046.gtipcg b/tools/cage/test/input/functionPointers/0046.gtipcg new file mode 100644 index 00000000..a0812c44 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0046.gtipcg @@ -0,0 +1,66 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0046.gtmcg b/tools/cage/test/input/functionPointers/0046.gtmcg new file mode 100644 index 00000000..cea2cdc6 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0046.gtmcg @@ -0,0 +1,106 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4dfltv", + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0047.cpp b/tools/cage/test/input/functionPointers/0047.cpp new file mode 100644 index 00000000..0dda3709 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0047.cpp @@ -0,0 +1,21 @@ + +int one() { return 1; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + if (i == 1) + return one; + return dflt; +} + +Fn get2(int i) { return get(i); } + +int main() { + int (*f)() = get2(1); + f(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0047.gtaacg b/tools/cage/test/input/functionPointers/0047.gtaacg new file mode 100644 index 00000000..315f2cb3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0047.gtaacg @@ -0,0 +1,313 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@213-215": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@213-215": { + "Arguments": [], + "CalledObjects": [ + "c:0047.cpp@189@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0047.cpp@82@F@get#I#@i", + "c:0047.cpp@147@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0047.cpp@189@F@main#@f", + "c:@F@main#@CALL_EXPR@@202-208", + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@213-215", + "c:@F@dflt#@SRETURN", + "c:@F@one#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0047.cpp@82@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0047.cpp@147@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3onev": 0, + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0047.gtipcg b/tools/cage/test/input/functionPointers/0047.gtipcg new file mode 100644 index 00000000..a0812c44 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0047.gtipcg @@ -0,0 +1,66 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0047.gtmcg b/tools/cage/test/input/functionPointers/0047.gtmcg new file mode 100644 index 00000000..10baa04d --- /dev/null +++ b/tools/cage/test/input/functionPointers/0047.gtmcg @@ -0,0 +1,106 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4dfltv", + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0048.cpp b/tools/cage/test/input/functionPointers/0048.cpp new file mode 100644 index 00000000..fd08e109 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0048.cpp @@ -0,0 +1,19 @@ + +int one() { return 1; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + if (i == 1) + return one; + return dflt; +} + +Fn get2(int i) { return get(i); } + +int main() { + get2(1)(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0048.gtaacg b/tools/cage/test/input/functionPointers/0048.gtaacg new file mode 100644 index 00000000..b0f0f6cc --- /dev/null +++ b/tools/cage/test/input/functionPointers/0048.gtaacg @@ -0,0 +1,311 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@189-197": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@189-197": { + "Arguments": [], + "CalledObjects": [ + "c:@F@main#@CALL_EXPR@@189-195" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0048.cpp@82@F@get#I#@i", + "c:0048.cpp@147@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@189-195", + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@189-197", + "c:@F@dflt#@SRETURN", + "c:@F@one#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0048.cpp@82@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@dflt#", + "c:@F@one#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0048.cpp@147@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@163-168", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0048.gtipcg b/tools/cage/test/input/functionPointers/0048.gtipcg new file mode 100644 index 00000000..55cee4ba --- /dev/null +++ b/tools/cage/test/input/functionPointers/0048.gtipcg @@ -0,0 +1,66 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0048.gtmcg b/tools/cage/test/input/functionPointers/0048.gtmcg new file mode 100644 index 00000000..e2900924 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0048.gtmcg @@ -0,0 +1,106 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4dfltv", + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0049.cpp b/tools/cage/test/input/functionPointers/0049.cpp new file mode 100644 index 00000000..de23ed83 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0049.cpp @@ -0,0 +1,16 @@ + +int one() { return 1; } + +typedef int (*Fn)(); + +Fn get(int i) { + Fn f = one; + return f; +} + +Fn get2(int i) { return get(i); } + +int main() { + get2(1)(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0049.gtaacg b/tools/cage/test/input/functionPointers/0049.gtaacg new file mode 100644 index 00000000..9919d897 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0049.gtaacg @@ -0,0 +1,265 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@143-151": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@143-151": { + "Arguments": [], + "CalledObjects": [ + "c:@F@main#@CALL_EXPR@@143-149" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0049.cpp@55@F@get#I#@i", + "c:0049.cpp@101@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@143-149", + "c:@F@get2#I#@CALL_EXPR@@117-122", + "c:0049.cpp@66@F@get#I#@f", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN", + "c:@F@one#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@143-151", + "c:@F@one#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0049.cpp@55@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:0049.cpp@66@F@get#I#@f", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0049.cpp@101@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@117-122", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0049.gtipcg b/tools/cage/test/input/functionPointers/0049.gtipcg new file mode 100644 index 00000000..cb0456e7 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0049.gtipcg @@ -0,0 +1,53 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0049.gtmcg b/tools/cage/test/input/functionPointers/0049.gtmcg new file mode 100644 index 00000000..f5d5c78f --- /dev/null +++ b/tools/cage/test/input/functionPointers/0049.gtmcg @@ -0,0 +1,87 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0051.cpp b/tools/cage/test/input/functionPointers/0051.cpp new file mode 100644 index 00000000..6674ddae --- /dev/null +++ b/tools/cage/test/input/functionPointers/0051.cpp @@ -0,0 +1,20 @@ + +int one() { return 1; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + Fn a = dflt; + if (i == 1) + return one; + return a; +} + +Fn get2(int i) { return get(i); } + +int main() { + get2(1)(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0051.gtaacg b/tools/cage/test/input/functionPointers/0051.gtaacg new file mode 100644 index 00000000..7fbe7851 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0051.gtaacg @@ -0,0 +1,312 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@201-209": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@201-209": { + "Arguments": [], + "CalledObjects": [ + "c:@F@main#@CALL_EXPR@@201-207" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0051.cpp@82@F@get#I#@i", + "c:0051.cpp@159@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@201-207", + "c:@F@get2#I#@CALL_EXPR@@175-180", + "c:0051.cpp@93@F@get#I#@a", + "c:@F@one#", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN", + "c:@F@dflt#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@201-209", + "c:@F@one#@SRETURN", + "c:@F@dflt#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0051.cpp@82@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:0051.cpp@93@F@get#I#@a", + "c:@F@one#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0051.cpp@159@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@175-180", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0051.gtipcg b/tools/cage/test/input/functionPointers/0051.gtipcg new file mode 100644 index 00000000..625b587a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0051.gtipcg @@ -0,0 +1,66 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0051.gtmcg b/tools/cage/test/input/functionPointers/0051.gtmcg new file mode 100644 index 00000000..2657b61b --- /dev/null +++ b/tools/cage/test/input/functionPointers/0051.gtmcg @@ -0,0 +1,106 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4dfltv", + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0052.cpp b/tools/cage/test/input/functionPointers/0052.cpp new file mode 100644 index 00000000..e6091b8f --- /dev/null +++ b/tools/cage/test/input/functionPointers/0052.cpp @@ -0,0 +1,22 @@ + +int one() { return 1; } + +int dflt() { return 42; } + +typedef int (*Fn)(); + +Fn get(int i) { + Fn a; + a = dflt; + if (i == 1) { + return one; + } + return a; +} + +Fn get2(int i) { return get(i); } + +int main() { + get2(1)(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0052.gtaacg b/tools/cage/test/input/functionPointers/0052.gtaacg new file mode 100644 index 00000000..e87dd536 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0052.gtaacg @@ -0,0 +1,312 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@212-220": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@212-220": { + "Arguments": [], + "CalledObjects": [ + "c:@F@main#@CALL_EXPR@@212-218" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get2#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0052.cpp@82@F@get#I#@i", + "c:0052.cpp@170@F@get2#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@212-218", + "c:@F@get2#I#@CALL_EXPR@@186-191", + "c:0052.cpp@93@F@get#I#@a", + "c:@F@one#", + "c:@F@get#I#@SRETURN", + "c:@F@get2#I#@SRETURN", + "c:@F@dflt#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@212-220", + "c:@F@one#@SRETURN", + "c:@F@dflt#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@dflt#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4dfltv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@dflt#@SRETURN" + ] + }, + "c:@F@get#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3geti" + ], + "Parameters": [ + "c:0052.cpp@82@F@get#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:0052.cpp@93@F@get#I#@a", + "c:@F@one#", + "c:@F@get#I#@SRETURN" + ] + }, + "c:@F@get2#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4get2i" + ], + "Parameters": [ + "c:0052.cpp@170@F@get2#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get2#I#@CALL_EXPR@@186-191", + "c:@F@get2#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@one#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3onev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@one#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@dflt#": "c:@F@dflt#", + "c:@F@get#I#": "c:@F@get#I#", + "c:@F@get2#I#": "c:@F@get2#I#", + "c:@F@main#": "c:@F@main#", + "c:@F@one#": "c:@F@one#" + } + }, + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3geti": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4get2i": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0052.gtipcg b/tools/cage/test/input/functionPointers/0052.gtipcg new file mode 100644 index 00000000..5b7490d5 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0052.gtipcg @@ -0,0 +1,66 @@ +{ + "_Z3geti": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4get2i" + ] + }, + "_Z3onev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4dfltv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3onev", + "_Z4dfltv", + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0052.gtmcg b/tools/cage/test/input/functionPointers/0052.gtmcg new file mode 100644 index 00000000..054f3e2f --- /dev/null +++ b/tools/cage/test/input/functionPointers/0052.gtmcg @@ -0,0 +1,106 @@ +{ + "_CG": { + "_Z3geti": { + "callees": [], + "callers": [ + "_Z4get2i" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3onev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4dfltv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4get2i": { + "callees": [ + "_Z3geti" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4dfltv", + "_Z3onev", + "_Z4get2i" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0053.cpp b/tools/cage/test/input/functionPointers/0053.cpp new file mode 100644 index 00000000..734d2afe --- /dev/null +++ b/tools/cage/test/input/functionPointers/0053.cpp @@ -0,0 +1,13 @@ +// TODO Fix this for AA +int main(int argc, char** argv) { + const auto l = [](int a, int b) { + float alpha = a / (1.0 * b); + double delta = .0; + for (int i = 0; i < 4; ++i) { + delta = a * i * alpha; + } + return delta; + }; + auto d = l(2, 4); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0053.gtaacg b/tools/cage/test/input/functionPointers/0053.gtaacg new file mode 100644 index 00000000..eb9cedf2 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0053.gtaacg @@ -0,0 +1 @@ +{"_ZZ4mainEN3$_08__invokeEii":{"callees":["_ZZ4mainENK3$_0clEii"],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["_ZZ4mainENK3$_0cvPFdiiEEv"]},"_ZZ4mainEN3$_0C1EOS_":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0C2EOS_":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0D1Ev":{"callees":[],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0D2Ev":{"callees":[],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainENK3$_0clEii":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":5,"overriddenBy":[],"overriddenFunctions":[],"parents":["_ZZ4mainEN3$_08__invokeEii","main"]},"_ZZ4mainENK3$_0cvPFdiiEEv":{"callees":["_ZZ4mainEN3$_08__invokeEii"],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":[]},"main":{"callees":["_ZZ4mainEN3$_0C1EOS_","_ZZ4mainEN3$_0C2EOS_","_ZZ4mainEN3$_0D1Ev","_ZZ4mainEN3$_0D2Ev","_ZZ4mainENK3$_0clEii"],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":3,"overriddenBy":[],"overriddenFunctions":[],"parents":[]}} diff --git a/tools/cage/test/input/functionPointers/0053.gtipcg b/tools/cage/test/input/functionPointers/0053.gtipcg new file mode 100644 index 00000000..eb7dc0c2 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0053.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0clEii": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0053.gtmcg b/tools/cage/test/input/functionPointers/0053.gtmcg new file mode 100644 index 00000000..13103f02 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0053.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0clEii": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0053.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 15, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0053.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_ZZ4mainENK3$_0clEii": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 17, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "GITDIR-NOTFOUND", + "version": "0.4" + }, + "version": "2.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0100.cpp b/tools/cage/test/input/functionPointers/0100.cpp new file mode 100644 index 00000000..a2033017 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0100.cpp @@ -0,0 +1,11 @@ +// function pointer without hit + +int foo(float a) { return 0; } + +int main(int argc, char* argv[]) { + int (*function)(); + + function(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0100.gtaacg b/tools/cage/test/input/functionPointers/0100.gtaacg new file mode 100644 index 00000000..2867703a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0100.gtaacg @@ -0,0 +1,172 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#I#**C#@CALL_EXPR@@124-133": "c:@F@main#I#**C#" + }, + "CallInfoMap": { + "c:@F@main#I#**C#@CALL_EXPR@@124-133": { + "Arguments": [], + "CalledObjects": [ + "c:0100.cpp@102@F@main#I#**C#@function" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@124-133" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0100.cpp@84@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0100.cpp@74@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0100.cpp@41@F@foo#f#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0100.cpp@102@F@main#I#**C#@function" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#f#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foof" + ], + "Parameters": [ + "c:0100.cpp@41@F@foo#f#@a" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#f#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0100.cpp@74@F@main#I#**C#@argc", + "c:0100.cpp@84@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#f#": "c:@F@foo#f#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0100.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0100.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0100.gtipcg b/tools/cage/test/input/functionPointers/0100.gtipcg new file mode 100644 index 00000000..9da643e1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0100.gtipcg @@ -0,0 +1,22 @@ +{ + "_Z3foof": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0100.gtmcg b/tools/cage/test/input/functionPointers/0100.gtmcg new file mode 100644 index 00000000..7deca77a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0100.gtmcg @@ -0,0 +1,44 @@ +{ + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0100.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0100.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0101.cpp b/tools/cage/test/input/functionPointers/0101.cpp new file mode 100644 index 00000000..be644099 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0101.cpp @@ -0,0 +1,13 @@ +// function pointer without hit + +int foo(float a) { return 0; } + +int hit1() { return 0; } + +int main(int argc, char* argv[]) { + int (*function)(); + + function(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0101.gtaacg b/tools/cage/test/input/functionPointers/0101.gtaacg new file mode 100644 index 00000000..f5929f9b --- /dev/null +++ b/tools/cage/test/input/functionPointers/0101.gtaacg @@ -0,0 +1,225 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#I#**C#@CALL_EXPR@@150-159": "c:@F@main#I#**C#" + }, + "CallInfoMap": { + "c:@F@main#I#**C#@CALL_EXPR@@150-159": { + "Arguments": [], + "CalledObjects": [ + "c:0101.cpp@128@F@main#I#**C#@function" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@150-159" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0101.cpp@41@F@foo#f#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0101.cpp@128@F@main#I#**C#@function" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0101.cpp@110@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0101.cpp@100@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#f#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foof" + ], + "Parameters": [ + "c:0101.cpp@41@F@foo#f#@a" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#f#@SRETURN" + ] + }, + "c:@F@hit1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4hit1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@hit1#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0101.cpp@100@F@main#I#**C#@argc", + "c:0101.cpp@110@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#f#": "c:@F@foo#f#", + "c:@F@hit1#": "c:@F@hit1#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0101.gtipcg b/tools/cage/test/input/functionPointers/0101.gtipcg new file mode 100644 index 00000000..24f600f8 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0101.gtipcg @@ -0,0 +1,32 @@ +{ + "_Z3foof": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z4hit1v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0101.gtmcg b/tools/cage/test/input/functionPointers/0101.gtmcg new file mode 100644 index 00000000..ec87dba8 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0101.gtmcg @@ -0,0 +1,60 @@ +{ + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0102.cpp b/tools/cage/test/input/functionPointers/0102.cpp new file mode 100644 index 00000000..2c4996bc --- /dev/null +++ b/tools/cage/test/input/functionPointers/0102.cpp @@ -0,0 +1,15 @@ +// function pointer with two hits + +int foo(float a) { return 0; } + +int hit1() { return 0; } + +int hit2() { return 5; } + +int main(int argc, char* argv[]) { + int (*function)(); + + function(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0102.gtaacg b/tools/cage/test/input/functionPointers/0102.gtaacg new file mode 100644 index 00000000..42f09d1f --- /dev/null +++ b/tools/cage/test/input/functionPointers/0102.gtaacg @@ -0,0 +1,278 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#I#**C#@CALL_EXPR@@178-187": "c:@F@main#I#**C#" + }, + "CallInfoMap": { + "c:@F@main#I#**C#@CALL_EXPR@@178-187": { + "Arguments": [], + "CalledObjects": [ + "c:0102.cpp@156@F@main#I#**C#@function" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@178-187" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0102.cpp@43@F@foo#f#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0102.cpp@156@F@main#I#**C#@function" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0102.cpp@138@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0102.cpp@128@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#f#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foof" + ], + "Parameters": [ + "c:0102.cpp@43@F@foo#f#@a" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#f#@SRETURN" + ] + }, + "c:@F@hit1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4hit1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@hit1#@SRETURN" + ] + }, + "c:@F@hit2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4hit2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@hit2#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0102.cpp@128@F@main#I#**C#@argc", + "c:0102.cpp@138@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#f#": "c:@F@foo#f#", + "c:@F@hit1#": "c:@F@hit1#", + "c:@F@hit2#": "c:@F@hit2#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit2v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0102.gtipcg b/tools/cage/test/input/functionPointers/0102.gtipcg new file mode 100644 index 00000000..525b763e --- /dev/null +++ b/tools/cage/test/input/functionPointers/0102.gtipcg @@ -0,0 +1,42 @@ +{ + "_Z3foof": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z4hit1v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z4hit2v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0102.gtmcg b/tools/cage/test/input/functionPointers/0102.gtmcg new file mode 100644 index 00000000..bd8007c1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0102.gtmcg @@ -0,0 +1,76 @@ +{ + "_CG": { + "_Z3foof": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4hit2v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0103.cpp b/tools/cage/test/input/functionPointers/0103.cpp new file mode 100644 index 00000000..3f219c0c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0103.cpp @@ -0,0 +1,14 @@ +// function pointer with two hits + +void caller(int (*function)()) {} + +void foo() {} + +int hit() { return 5; } + +int main(int argc, char* argv[]) { + caller(&hit); + foo(); + + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0103.gtaacg b/tools/cage/test/input/functionPointers/0103.gtaacg new file mode 100644 index 00000000..6c9b32f9 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0103.gtaacg @@ -0,0 +1,276 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@hit#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@caller#*FI()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0103.cpp@129@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0103.cpp@119@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0103.cpp@47@F@caller#*FI()#@function", + "&c:@F@hit#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@hit#" + } + ] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@147-158", + "c:@F@caller#*FI()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@163-167", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@caller#*FI()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z6callerPFivE" + ], + "Parameters": [ + "c:0103.cpp@47@F@caller#*FI()#@function" + ], + "ReferencedInReturnStmts": [ + "c:@F@caller#*FI()#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@hit#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3hitv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@hit#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0103.cpp@119@F@main#I#**C#@argc", + "c:0103.cpp@129@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@F@hit#": "c:@F@hit#", + "c:@F@caller#*FI()#": "c:@F@caller#*FI()#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@hit#": "c:@F@hit#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3hitv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z6callerPFivE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z6callerPFivE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "_Z6callerPFivE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0103.gtipcg b/tools/cage/test/input/functionPointers/0103.gtipcg new file mode 100644 index 00000000..d87ac13a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0103.gtipcg @@ -0,0 +1,49 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3hitv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z6callerPFivE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z6callerPFivE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0103.gtmcg b/tools/cage/test/input/functionPointers/0103.gtmcg new file mode 100644 index 00000000..b0e45e78 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0103.gtmcg @@ -0,0 +1,83 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3hitv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z6callerPFivE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z6callerPFivE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0115.cpp b/tools/cage/test/input/functionPointers/0115.cpp new file mode 100644 index 00000000..d46eb7b0 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0115.cpp @@ -0,0 +1,18 @@ +// Test for unions involving function pointers +extern void foo(); +using FType = decltype(foo); + +class C { + public: + union { + int i; + FType* f; + }; +}; + +int main() { + C c; + c.i = 4; + c.f = foo; + c.f(); +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0115.gtaacg b/tools/cage/test/input/functionPointers/0115.gtaacg new file mode 100644 index 00000000..3202c261 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0115.gtaacg @@ -0,0 +1,453 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@205-209": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@205-209": { + "Arguments": [], + "CalledObjects": [ + "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@C@Ua@F@#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&1$@S@C@Ua#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&1$@S@C@Ua#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&1$@S@C@Ua#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&1$@S@C@Ua#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&&$@S@C@Ua#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&&$@S@C@Ua#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&&$@S@C@Ua#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#&&$@S@C@Ua#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@Ua@F@#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@i", + "c:@S@C@Ua@FI@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155", + "c:@S@C@UNNAMED_UNION@96-155" + ], + "Prefixes": [ + { + "Member": "c:@S@C@Ua@FI@f", + "Object": "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f" + }, + { + "Member": "c:@S@C@Ua@FI@i", + "Object": "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@i" + } + ] + }, + { + "Objects": [ + "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f", + "c:@S@C@Ua@FI@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@205-209", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0115.cpp@174@F@main#@c", + "c:@F@main#@CALL_EXPR@@176-176" + ], + "Prefixes": [ + { + "Member": "c:@S@C@UNNAMED_UNION@96-155", + "Object": "(c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155" + } + ] + }, + { + "Objects": [ + "c:@S@C@F@C#@THIS", + "&c:@F@main#@CALL_EXPR@@176-176" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@176-176" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@C@F@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2Ev", + "_ZN1CC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#&&$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2EOS_", + "_ZN1CC1EOS_" + ], + "Parameters": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#&1$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2ERKS_", + "_ZN1CC1ERKS_" + ], + "Parameters": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@Ua@F@#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CUt_C2Ev", + "_ZN1CUt_C1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@Ua@F@#&&$@S@C@Ua#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CUt_C2EOS0_", + "_ZN1CUt_C1EOS0_" + ], + "Parameters": [ + "c:@S@C@Ua@F@#&&$@S@C@Ua#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@Ua@F@#&1$@S@C@Ua#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CUt_C2ERKS0_", + "_ZN1CUt_C1ERKS0_" + ], + "Parameters": [ + "c:@S@C@Ua@F@#&1$@S@C@Ua#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@S@C@F@C#": "c:@S@C@F@C#", + "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", + "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", + "c:@S@C@Ua@F@#": "c:@S@C@Ua@F@#", + "c:@S@C@Ua@F@#&&$@S@C@Ua#": "c:@S@C@Ua@F@#&&$@S@C@Ua#", + "c:@S@C@Ua@F@#&1$@S@C@Ua#": "c:@S@C@Ua@F@#&1$@S@C@Ua#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_ZN1CC1Ev", + "_ZN1CC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 9 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0115.gtipcg b/tools/cage/test/input/functionPointers/0115.gtipcg new file mode 100644 index 00000000..6f96317f --- /dev/null +++ b/tools/cage/test/input/functionPointers/0115.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0115.gtmcg b/tools/cage/test/input/functionPointers/0115.gtmcg new file mode 100644 index 00000000..b2ae4d91 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0115.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0115.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 9 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", + "version": "0.3" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0201.cpp b/tools/cage/test/input/functionPointers/0201.cpp new file mode 100644 index 00000000..c6e26aa3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0201.cpp @@ -0,0 +1,11 @@ + +using func_t = void (*)(); + +void foo() {}; + +func_t get_f(func_t f) { return f; } + +int main() { + func_t f = get_f(foo); + f(); +} diff --git a/tools/cage/test/input/functionPointers/0201.gtaacg b/tools/cage/test/input/functionPointers/0201.gtaacg new file mode 100644 index 00000000..54a1c7f5 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0201.gtaacg @@ -0,0 +1,202 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@122-124": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@122-124": { + "Arguments": [], + "CalledObjects": [ + "c:0201.cpp@97@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_f#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0201.cpp@97@F@main#@f", + "c:@F@main#@CALL_EXPR@@108-117", + "c:0201.cpp@57@F@get_f#*Fv()#@f", + "c:@F@foo#", + "c:@F@get_f#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@122-124", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@get_f#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5get_fPFvvE" + ], + "Parameters": [ + "c:0201.cpp@57@F@get_f#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:0201.cpp@57@F@get_f#*Fv()#@f", + "c:@F@get_f#*Fv()#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@get_f#*Fv()#": "c:@F@get_f#*Fv()#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5get_fPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "_Z5get_fPFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0201.gtipcg b/tools/cage/test/input/functionPointers/0201.gtipcg new file mode 100644 index 00000000..fe98d17c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0201.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5get_fPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0201.gtmcg b/tools/cage/test/input/functionPointers/0201.gtmcg new file mode 100644 index 00000000..76bb81c8 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0201.gtmcg @@ -0,0 +1,67 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5get_fPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0202.cpp b/tools/cage/test/input/functionPointers/0202.cpp new file mode 100644 index 00000000..5349de32 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0202.cpp @@ -0,0 +1,10 @@ + +using func_t = void (*)(); + +void foo() {} + +void cast() { + func_t f; + f = reinterpret_cast(reinterpret_cast(foo)); + f(); +} diff --git a/tools/cage/test/input/functionPointers/0202.gtaacg b/tools/cage/test/input/functionPointers/0202.gtaacg new file mode 100644 index 00000000..8a63cdd8 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0202.gtaacg @@ -0,0 +1,145 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@cast#@CALL_EXPR@@135-137": "c:@F@cast#" + }, + "CallInfoMap": { + "c:@F@cast#@CALL_EXPR@@135-137": { + "Arguments": [], + "CalledObjects": [ + "c:0202.cpp@60@F@cast#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@cast#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@cast#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0202.cpp@60@F@cast#@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@cast#@CALL_EXPR@@135-137", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@cast#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4castv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@cast#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@cast#": "c:@F@cast#", + "c:@F@foo#": "c:@F@foo#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z4castv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0202.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4castv": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0202.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0202.gtipcg b/tools/cage/test/input/functionPointers/0202.gtipcg new file mode 100644 index 00000000..e4a91315 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0202.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4castv" + ] + }, + "_Z4castv": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0202.gtmcg b/tools/cage/test/input/functionPointers/0202.gtmcg new file mode 100644 index 00000000..92a87e42 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0202.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z4castv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0202.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4castv": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0202.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0203.cpp b/tools/cage/test/input/functionPointers/0203.cpp new file mode 100644 index 00000000..cb618332 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0203.cpp @@ -0,0 +1,17 @@ + +using func_t = void (*)(); + +void get_func2(func_t* out, func_t in) { + *out = in; + in(); +} +func_t get_func(func_t f) { + func_t res; + get_func2(&res, f); + return res; +} +void foo() {} +int main() { + auto f = get_func(foo); + f(); +} diff --git a/tools/cage/test/input/functionPointers/0203.gtaacg b/tools/cage/test/input/functionPointers/0203.gtaacg new file mode 100644 index 00000000..7a1c622c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0203.gtaacg @@ -0,0 +1,291 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88": "c:@F@get_func2#**Fv()#S1_#", + "c:@F@main#@CALL_EXPR@@228-230": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88": { + "Arguments": [], + "CalledObjects": [ + "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in" + ] + }, + "c:@F@main#@CALL_EXPR@@228-230": { + "Arguments": [], + "CalledObjects": [ + "c:0203.cpp@202@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func2#**Fv()#S1_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", + "&c:0203.cpp@123@F@get_func#*Fv()#@res" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out" + } + ] + }, + { + "Objects": [ + "c:@F@get_func#*Fv()#@CALL_EXPR@@137-154", + "c:@F@get_func2#**Fv()#S1_#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0203.cpp@202@F@main#@f", + "c:@F@main#@CALL_EXPR@@211-223", + "c:0203.cpp@123@F@get_func#*Fv()#@res", + "*c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", + "c:@F@get_func#*Fv()#@SRETURN", + "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in", + "c:0203.cpp@109@F@get_func#*Fv()#@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@228-230", + "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@get_func#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8get_funcPFvvE" + ], + "Parameters": [ + "c:0203.cpp@109@F@get_func#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:0203.cpp@123@F@get_func#*Fv()#@res", + "c:@F@get_func#*Fv()#@SRETURN" + ] + }, + "c:@F@get_func2#**Fv()#S1_#": { + "IsVariadic": false, + "MangledNames": [ + "_Z9get_func2PPFvvES0_" + ], + "Parameters": [ + "c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", + "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in" + ], + "ReferencedInReturnStmts": [ + "c:@F@get_func2#**Fv()#S1_#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@get_func#*Fv()#": "c:@F@get_func#*Fv()#", + "c:@F@get_func2#**Fv()#S1_#": "c:@F@get_func2#**Fv()#S1_#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z9get_func2PPFvvES0_", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8get_funcPFvvE": { + "callees": [ + "_Z9get_func2PPFvvES0_" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z9get_func2PPFvvES0_": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9get_func2PPFvvES0_": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "_Z8get_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z8get_funcPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "_Z8get_funcPFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0203.gtipcg b/tools/cage/test/input/functionPointers/0203.gtipcg new file mode 100644 index 00000000..81dd03f1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0203.gtipcg @@ -0,0 +1,56 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z9get_func2PPFvvES0_", + "main" + ] + }, + "_Z8get_funcPFvvE": { + "callees": [ + "_Z9get_func2PPFvvES0_" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z9get_func2PPFvvES0_": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z8get_funcPFvvE" + ] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z8get_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0203.gtmcg b/tools/cage/test/input/functionPointers/0203.gtmcg new file mode 100644 index 00000000..3470f01a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0203.gtmcg @@ -0,0 +1,90 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main", + "_Z9get_func2PPFvvES0_" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8get_funcPFvvE": { + "callees": [ + "_Z9get_func2PPFvvES0_" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9get_func2PPFvvES0_": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "_Z8get_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z8get_funcPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0204.cpp b/tools/cage/test/input/functionPointers/0204.cpp new file mode 100644 index 00000000..fb3d0846 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0204.cpp @@ -0,0 +1,16 @@ + +using func_t = void (*)(); +void call_func2(func_t f) { + auto f2 = f; + f(); +} +void call_func(func_t f) { + auto f2 = f; + call_func2(f2); +} +void foo() {} +int main() { + func_t f = foo; + call_func(f); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0204.gtaacg b/tools/cage/test/input/functionPointers/0204.gtaacg new file mode 100644 index 00000000..cb2077d1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0204.gtaacg @@ -0,0 +1,271 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75": "c:@F@call_func2#*Fv()#" + }, + "CallInfoMap": { + "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75": { + "Arguments": [], + "CalledObjects": [ + "c:0204.cpp@44@F@call_func2#*Fv()#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_func2#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_func#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_func#*Fv()#@CALL_EXPR@@124-137", + "c:@F@call_func2#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@189-200", + "c:@F@call_func#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0204.cpp@58@F@call_func2#*Fv()#@f2", + "c:0204.cpp@44@F@call_func2#*Fv()#@f", + "c:0204.cpp@109@F@call_func#*Fv()#@f2", + "c:0204.cpp@95@F@call_func#*Fv()#@f", + "c:0204.cpp@171@F@main#@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@call_func#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z9call_funcPFvvE" + ], + "Parameters": [ + "c:0204.cpp@95@F@call_func#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@call_func#*Fv()#@SRETURN" + ] + }, + "c:@F@call_func2#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z10call_func2PFvvE" + ], + "Parameters": [ + "c:0204.cpp@44@F@call_func2#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@call_func2#*Fv()#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@call_func#*Fv()#": "c:@F@call_func#*Fv()#", + "c:@F@call_func2#*Fv()#": "c:@F@call_func2#*Fv()#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z10call_func2PFvvE": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "_Z9call_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z10call_func2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9call_funcPFvvE": { + "callees": [ + "_Z10call_func2PFvvE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z10call_func2PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z9call_funcPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z9call_funcPFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0204.gtipcg b/tools/cage/test/input/functionPointers/0204.gtipcg new file mode 100644 index 00000000..1892aa83 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0204.gtipcg @@ -0,0 +1,54 @@ +{ + "_Z10call_func2PFvvE": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z9call_funcPFvvE" + ] + }, + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z10call_func2PFvvE" + ] + }, + "_Z9call_funcPFvvE": { + "callees": [ + "_Z10call_func2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z9call_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0204.gtmcg b/tools/cage/test/input/functionPointers/0204.gtmcg new file mode 100644 index 00000000..30f473a3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0204.gtmcg @@ -0,0 +1,88 @@ +{ + "_CG": { + "_Z10call_func2PFvvE": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "_Z9call_funcPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z10call_func2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9call_funcPFvvE": { + "callees": [ + "_Z10call_func2PFvvE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z9call_funcPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0205.cpp b/tools/cage/test/input/functionPointers/0205.cpp new file mode 100644 index 00000000..b3b2842c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0205.cpp @@ -0,0 +1,11 @@ + +using func_t = void (*)(); +void foo() {} +void bar() {} + +int main() { + func_t a, b; + bool s = true; + (s ? a : b) = foo; + (s ? a : b)(); +} diff --git a/tools/cage/test/input/functionPointers/0205.gtaacg b/tools/cage/test/input/functionPointers/0205.gtaacg new file mode 100644 index 00000000..c0830448 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0205.gtaacg @@ -0,0 +1,206 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@125-137": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@125-137": { + "Arguments": [], + "CalledObjects": [ + "c:0205.cpp@72@F@main#@a", + "c:0205.cpp@72@F@main#@b" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0205.cpp@87@F@main#@s" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@125-137", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0205.cpp@72@F@main#@b", + "c:0205.cpp@72@F@main#@a", + "c:@F@foo#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0205.gtipcg b/tools/cage/test/input/functionPointers/0205.gtipcg new file mode 100644 index 00000000..25e0c4fc --- /dev/null +++ b/tools/cage/test/input/functionPointers/0205.gtipcg @@ -0,0 +1,36 @@ +{ + "_Z3barv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0205.gtmcg b/tools/cage/test/input/functionPointers/0205.gtmcg new file mode 100644 index 00000000..8eb7620d --- /dev/null +++ b/tools/cage/test/input/functionPointers/0205.gtmcg @@ -0,0 +1,64 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0206.cpp b/tools/cage/test/input/functionPointers/0206.cpp new file mode 100644 index 00000000..ef29326a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0206.cpp @@ -0,0 +1,19 @@ + +using func_t = void (*)(); +void foo() {} +void bar() {} + +void call() { + func_t a, b; + bool s = true; + if (s) + a = foo; + else + b = foo; + if (s) + a(); + else + b(); +} + +int main() { call(); } diff --git a/tools/cage/test/input/functionPointers/0206.gtaacg b/tools/cage/test/input/functionPointers/0206.gtaacg new file mode 100644 index 00000000..1da467a8 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0206.gtaacg @@ -0,0 +1,273 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@call#@CALL_EXPR@@158-160": "c:@F@call#", + "c:@F@call#@CALL_EXPR@@174-176": "c:@F@call#" + }, + "CallInfoMap": { + "c:@F@call#@CALL_EXPR@@158-160": { + "Arguments": [], + "CalledObjects": [ + "c:0206.cpp@73@F@call#@a" + ] + }, + "c:@F@call#@CALL_EXPR@@174-176": { + "Arguments": [], + "CalledObjects": [ + "c:0206.cpp@73@F@call#@b" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0206.cpp@88@F@call#@s" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@195-200", + "c:@F@call#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0206.cpp@73@F@call#@b", + "c:0206.cpp@73@F@call#@a", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call#@CALL_EXPR@@174-176", + "c:@F@call#@CALL_EXPR@@158-160", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@call#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4callv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@call#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@call#": "c:@F@call#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z4callv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4callv": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4callv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4callv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0206.gtipcg b/tools/cage/test/input/functionPointers/0206.gtipcg new file mode 100644 index 00000000..e79414f3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0206.gtipcg @@ -0,0 +1,50 @@ +{ + "_Z3barv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4callv" + ] + }, + "_Z4callv": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 8, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z4callv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0206.gtmcg b/tools/cage/test/input/functionPointers/0206.gtmcg new file mode 100644 index 00000000..a821fcb5 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0206.gtmcg @@ -0,0 +1,84 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z4callv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4callv": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", + "systemInclude": false + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4callv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0207.cpp b/tools/cage/test/input/functionPointers/0207.cpp new file mode 100644 index 00000000..f69bb261 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0207.cpp @@ -0,0 +1,20 @@ + +using func_t = void (*)(); + +func_t f0(func_t f) { return f; } +func_t f1(func_t f) { return f0(f); } +func_t f2(func_t f) { return f1(f); } +func_t f3(func_t f) { return f2(f); } +func_t f4(func_t f) { return f3(f); } +func_t f5(func_t f) { return f4(f); } +func_t f6(func_t f) { return f5(f); } +func_t f7(func_t f) { return f6(f); } +func_t f8(func_t f) { return f7(f); } +func_t f9(func_t f) { return f8(f); } + +void foo() {} + +int main() { + auto f = f9(foo); + f(); +} diff --git a/tools/cage/test/input/functionPointers/0207.gtaacg b/tools/cage/test/input/functionPointers/0207.gtaacg new file mode 100644 index 00000000..68091bc6 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0207.gtaacg @@ -0,0 +1,733 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@456-458": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@456-458": { + "Arguments": [], + "CalledObjects": [ + "c:0207.cpp@436@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f9#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f8#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f7#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f6#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f5#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f4#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f3#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f2#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f1#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f0#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0207.cpp@436@F@main#@f", + "c:@F@main#@CALL_EXPR@@445-451", + "c:@F@f9#*Fv()#@CALL_EXPR@@396-400", + "c:@F@f8#*Fv()#@CALL_EXPR@@358-362", + "c:@F@f7#*Fv()#@CALL_EXPR@@320-324", + "c:@F@f6#*Fv()#@CALL_EXPR@@282-286", + "c:@F@f5#*Fv()#@CALL_EXPR@@244-248", + "c:@F@f4#*Fv()#@CALL_EXPR@@206-210", + "c:@F@f3#*Fv()#@CALL_EXPR@@168-172", + "c:@F@f2#*Fv()#@CALL_EXPR@@130-134", + "c:@F@f1#*Fv()#@CALL_EXPR@@92-96", + "c:0207.cpp@39@F@f0#*Fv()#@f", + "c:0207.cpp@73@F@f1#*Fv()#@f", + "c:@F@f0#*Fv()#@SRETURN", + "c:0207.cpp@111@F@f2#*Fv()#@f", + "c:@F@f1#*Fv()#@SRETURN", + "c:0207.cpp@149@F@f3#*Fv()#@f", + "c:@F@f2#*Fv()#@SRETURN", + "c:0207.cpp@187@F@f4#*Fv()#@f", + "c:@F@f3#*Fv()#@SRETURN", + "c:0207.cpp@225@F@f5#*Fv()#@f", + "c:@F@f4#*Fv()#@SRETURN", + "c:0207.cpp@263@F@f6#*Fv()#@f", + "c:@F@f5#*Fv()#@SRETURN", + "c:0207.cpp@301@F@f7#*Fv()#@f", + "c:@F@f6#*Fv()#@SRETURN", + "c:0207.cpp@339@F@f8#*Fv()#@f", + "c:@F@f7#*Fv()#@SRETURN", + "c:0207.cpp@377@F@f9#*Fv()#@f", + "c:@F@f8#*Fv()#@SRETURN", + "c:@F@foo#", + "c:@F@f9#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@456-458", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@f0#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f0PFvvE" + ], + "Parameters": [ + "c:0207.cpp@39@F@f0#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:0207.cpp@39@F@f0#*Fv()#@f", + "c:@F@f0#*Fv()#@SRETURN" + ] + }, + "c:@F@f1#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f1PFvvE" + ], + "Parameters": [ + "c:0207.cpp@73@F@f1#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f1#*Fv()#@CALL_EXPR@@92-96", + "c:@F@f1#*Fv()#@SRETURN" + ] + }, + "c:@F@f2#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f2PFvvE" + ], + "Parameters": [ + "c:0207.cpp@111@F@f2#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f2#*Fv()#@CALL_EXPR@@130-134", + "c:@F@f2#*Fv()#@SRETURN" + ] + }, + "c:@F@f3#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f3PFvvE" + ], + "Parameters": [ + "c:0207.cpp@149@F@f3#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f3#*Fv()#@CALL_EXPR@@168-172", + "c:@F@f3#*Fv()#@SRETURN" + ] + }, + "c:@F@f4#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f4PFvvE" + ], + "Parameters": [ + "c:0207.cpp@187@F@f4#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f4#*Fv()#@CALL_EXPR@@206-210", + "c:@F@f4#*Fv()#@SRETURN" + ] + }, + "c:@F@f5#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f5PFvvE" + ], + "Parameters": [ + "c:0207.cpp@225@F@f5#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f5#*Fv()#@CALL_EXPR@@244-248", + "c:@F@f5#*Fv()#@SRETURN" + ] + }, + "c:@F@f6#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f6PFvvE" + ], + "Parameters": [ + "c:0207.cpp@263@F@f6#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f6#*Fv()#@CALL_EXPR@@282-286", + "c:@F@f6#*Fv()#@SRETURN" + ] + }, + "c:@F@f7#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f7PFvvE" + ], + "Parameters": [ + "c:0207.cpp@301@F@f7#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f7#*Fv()#@CALL_EXPR@@320-324", + "c:@F@f7#*Fv()#@SRETURN" + ] + }, + "c:@F@f8#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f8PFvvE" + ], + "Parameters": [ + "c:0207.cpp@339@F@f8#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f8#*Fv()#@CALL_EXPR@@358-362", + "c:@F@f8#*Fv()#@SRETURN" + ] + }, + "c:@F@f9#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f9PFvvE" + ], + "Parameters": [ + "c:0207.cpp@377@F@f9#*Fv()#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@f9#*Fv()#@CALL_EXPR@@396-400", + "c:@F@f9#*Fv()#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@f0#*Fv()#": "c:@F@f0#*Fv()#", + "c:@F@f1#*Fv()#": "c:@F@f1#*Fv()#", + "c:@F@f2#*Fv()#": "c:@F@f2#*Fv()#", + "c:@F@f3#*Fv()#": "c:@F@f3#*Fv()#", + "c:@F@f4#*Fv()#": "c:@F@f4#*Fv()#", + "c:@F@f5#*Fv()#": "c:@F@f5#*Fv()#", + "c:@F@f6#*Fv()#": "c:@F@f6#*Fv()#", + "c:@F@f7#*Fv()#": "c:@F@f7#*Fv()#", + "c:@F@f8#*Fv()#": "c:@F@f8#*Fv()#", + "c:@F@f9#*Fv()#": "c:@F@f9#*Fv()#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z2f0PFvvE": { + "callees": [], + "callers": [ + "_Z2f1PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f1PFvvE": { + "callees": [ + "_Z2f0PFvvE" + ], + "callers": [ + "_Z2f2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f0PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f2PFvvE": { + "callees": [ + "_Z2f1PFvvE" + ], + "callers": [ + "_Z2f3PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f1PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f3PFvvE": { + "callees": [ + "_Z2f2PFvvE" + ], + "callers": [ + "_Z2f4PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f2PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f4PFvvE": { + "callees": [ + "_Z2f3PFvvE" + ], + "callers": [ + "_Z2f5PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f3PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f5PFvvE": { + "callees": [ + "_Z2f4PFvvE" + ], + "callers": [ + "_Z2f6PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f4PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f6PFvvE": { + "callees": [ + "_Z2f5PFvvE" + ], + "callers": [ + "_Z2f7PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f5PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f7PFvvE": { + "callees": [ + "_Z2f6PFvvE" + ], + "callers": [ + "_Z2f8PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f6PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f8PFvvE": { + "callees": [ + "_Z2f7PFvvE" + ], + "callers": [ + "_Z2f9PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f7PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f9PFvvE": { + "callees": [ + "_Z2f8PFvvE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f8PFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z2f9PFvvE", + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z2f9PFvvE": 0, + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0207.gtipcg b/tools/cage/test/input/functionPointers/0207.gtipcg new file mode 100644 index 00000000..9d4643a6 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0207.gtipcg @@ -0,0 +1,165 @@ +{ + "_Z2f0PFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f1PFvvE" + ] + }, + "_Z2f1PFvvE": { + "callees": [ + "_Z2f0PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f2PFvvE" + ] + }, + "_Z2f2PFvvE": { + "callees": [ + "_Z2f1PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f3PFvvE" + ] + }, + "_Z2f3PFvvE": { + "callees": [ + "_Z2f2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f4PFvvE" + ] + }, + "_Z2f4PFvvE": { + "callees": [ + "_Z2f3PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f5PFvvE" + ] + }, + "_Z2f5PFvvE": { + "callees": [ + "_Z2f4PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f6PFvvE" + ] + }, + "_Z2f6PFvvE": { + "callees": [ + "_Z2f5PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f7PFvvE" + ] + }, + "_Z2f7PFvvE": { + "callees": [ + "_Z2f6PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f8PFvvE" + ] + }, + "_Z2f8PFvvE": { + "callees": [ + "_Z2f7PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z2f9PFvvE" + ] + }, + "_Z2f9PFvvE": { + "callees": [ + "_Z2f8PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z2f9PFvvE", + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0207.gtmcg b/tools/cage/test/input/functionPointers/0207.gtmcg new file mode 100644 index 00000000..6a470103 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0207.gtmcg @@ -0,0 +1,247 @@ +{ + "_CG": { + "_Z2f0PFvvE": { + "callees": [], + "callers": [ + "_Z2f1PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f1PFvvE": { + "callees": [ + "_Z2f0PFvvE" + ], + "callers": [ + "_Z2f2PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f2PFvvE": { + "callees": [ + "_Z2f1PFvvE" + ], + "callers": [ + "_Z2f3PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f3PFvvE": { + "callees": [ + "_Z2f2PFvvE" + ], + "callers": [ + "_Z2f4PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f4PFvvE": { + "callees": [ + "_Z2f3PFvvE" + ], + "callers": [ + "_Z2f5PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f5PFvvE": { + "callees": [ + "_Z2f4PFvvE" + ], + "callers": [ + "_Z2f6PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f6PFvvE": { + "callees": [ + "_Z2f5PFvvE" + ], + "callers": [ + "_Z2f7PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f7PFvvE": { + "callees": [ + "_Z2f6PFvvE" + ], + "callers": [ + "_Z2f8PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f8PFvvE": { + "callees": [ + "_Z2f7PFvvE" + ], + "callers": [ + "_Z2f9PFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z2f9PFvvE": { + "callees": [ + "_Z2f8PFvvE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z2f9PFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0208.cpp b/tools/cage/test/input/functionPointers/0208.cpp new file mode 100644 index 00000000..4d5fed3e --- /dev/null +++ b/tools/cage/test/input/functionPointers/0208.cpp @@ -0,0 +1,9 @@ + +struct A { + void foo() {} +}; +void bar(A* a, void (A::*f)()) { (a->*f)(); } +int main() { + A a; + bar(&a, &A::foo); +} diff --git a/tools/cage/test/input/functionPointers/0208.gtaacg b/tools/cage/test/input/functionPointers/0208.gtaacg new file mode 100644 index 00000000..0bcec27a --- /dev/null +++ b/tools/cage/test/input/functionPointers/0208.gtaacg @@ -0,0 +1,415 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72": "c:@F@bar#*$@S@A# #" + }, + "CallInfoMap": { + "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72": { + "Arguments": [], + "CalledObjects": [ + "c:0208.cpp@40@F@bar#*$@S@A# #@a" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#*$@S@A# #" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0208.cpp@46@F@bar#*$@S@A# #@f", + "&c:@S@A@F@foo#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@S@A@F@foo#" + } + ] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@99-114", + "c:@F@bar#*$@S@A# #@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0208.cpp@92@F@main#@a", + "c:@F@main#@CALL_EXPR@@94-94" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@foo#@THIS", + "c:0208.cpp@40@F@bar#*$@S@A# #@a", + "&c:0208.cpp@92@F@main#@a" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0208.cpp@92@F@main#@a" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@94-94" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@94-94" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@bar#*$@S@A# #": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barP1AMS_FvvE" + ], + "Parameters": [ + "c:0208.cpp@40@F@bar#*$@S@A# #@a", + "c:0208.cpp@46@F@bar#*$@S@A# #@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@bar#*$@S@A# #@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1A3fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@A@F@foo#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@S@A@F@foo#": "c:@S@A@F@foo#", + "c:@F@bar#*$@S@A# #": "c:@F@bar#*$@S@A# #", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", + "c:@S@A@F@foo#": "c:@S@A@F@foo#" + } + }, + "_CG": { + "_Z3barP1AMS_FvvE": { + "callees": [ + "_ZN1A3fooEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3fooEv": { + "callees": [], + "callers": [ + "_Z3barP1AMS_FvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3barP1AMS_FvvE", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3barP1AMS_FvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0208.gtipcg b/tools/cage/test/input/functionPointers/0208.gtipcg new file mode 100644 index 00000000..4cf8532d --- /dev/null +++ b/tools/cage/test/input/functionPointers/0208.gtipcg @@ -0,0 +1,40 @@ +{ + "_Z3barP1AMS_FvvE": { + "callees": [ + "_ZN1A3fooEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1A3fooEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z3barP1AMS_FvvE" + ] + }, + "main": { + "callees": [ + "_Z3barP1AMS_FvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0208.gtmcg b/tools/cage/test/input/functionPointers/0208.gtmcg new file mode 100644 index 00000000..5635d505 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0208.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_Z3barP1AMS_FvvE": { + "callees": [ + "_ZN1A3fooEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3fooEv": { + "callees": [], + "callers": [ + "_Z3barP1AMS_FvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3barP1AMS_FvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0209.cpp b/tools/cage/test/input/functionPointers/0209.cpp new file mode 100644 index 00000000..feaeb59c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0209.cpp @@ -0,0 +1,20 @@ + +struct A { + void foo() {} + void bar() {} + void baz() {} +}; +using func_t = void (A::*)(); +func_t get_f(bool b) { + func_t fooPtr; + fooPtr = &A::foo; + if (b) { + return &A::bar; + } + return fooPtr; +} +int main() { + A a; + auto f = get_f(1); + (a.*f)(); +} diff --git a/tools/cage/test/input/functionPointers/0209.gtaacg b/tools/cage/test/input/functionPointers/0209.gtaacg new file mode 100644 index 00000000..c49800d3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0209.gtaacg @@ -0,0 +1,530 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@250-257": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@250-257": { + "Arguments": [], + "CalledObjects": [ + "c:0209.cpp@222@F@main#@a" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@baz#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@baz#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@baz#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@bar#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@250-257" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_f#b#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0209.cpp@106@F@get_f#b#@b" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0209.cpp@229@F@main#@f", + "c:@F@main#@CALL_EXPR@@238-245", + "&c:@S@A@F@bar#", + "c:0209.cpp@118@F@get_f#b#@fooPtr", + "c:@F@get_f#b#@SRETURN", + "&c:@S@A@F@foo#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@S@A@F@bar#" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@foo#", + "c:@S@A@F@bar#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0209.cpp@222@F@main#@a", + "c:@F@main#@CALL_EXPR@@224-224" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@224-224" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@224-224" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@foo#@THIS", + "c:@S@A@F@bar#@THIS", + "&c:0209.cpp@222@F@main#@a" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0209.cpp@222@F@main#@a" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@get_f#b#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5get_fb" + ], + "Parameters": [ + "c:0209.cpp@106@F@get_f#b#@b" + ], + "ReferencedInReturnStmts": [ + "&c:@S@A@F@bar#", + "c:0209.cpp@118@F@get_f#b#@fooPtr", + "c:@F@get_f#b#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1A3barEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@A@F@bar#@SRETURN" + ] + }, + "c:@S@A@F@baz#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1A3bazEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@A@F@baz#@SRETURN" + ] + }, + "c:@S@A@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1A3fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@A@F@foo#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@S@A@F@bar#": "c:@S@A@F@bar#", + "&c:@S@A@F@foo#": "c:@S@A@F@foo#", + "c:@F@get_f#b#": "c:@F@get_f#b#", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", + "c:@S@A@F@bar#": "c:@S@A@F@bar#", + "c:@S@A@F@baz#": "c:@S@A@F@baz#", + "c:@S@A@F@foo#": "c:@S@A@F@foo#" + } + }, + "_CG": { + "_Z5get_fb": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3barEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3bazEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z5get_fb", + "_ZN1A3barEv", + "_ZN1A3fooEv", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z5get_fb": 0, + "_ZN1A3barEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0209.gtipcg b/tools/cage/test/input/functionPointers/0209.gtipcg new file mode 100644 index 00000000..cb4802ec --- /dev/null +++ b/tools/cage/test/input/functionPointers/0209.gtipcg @@ -0,0 +1,62 @@ +{ + "_Z5get_fb": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1A3barEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1A3bazEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1A3fooEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z5get_fb", + "_ZN1A3barEv", + "_ZN1A3fooEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0209.gtmcg b/tools/cage/test/input/functionPointers/0209.gtmcg new file mode 100644 index 00000000..0027b886 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0209.gtmcg @@ -0,0 +1,102 @@ +{ + "_CG": { + "_Z5get_fb": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3barEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3bazEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1A3fooEv", + "_ZN1A3barEv", + "_Z5get_fb" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0210.cpp b/tools/cage/test/input/functionPointers/0210.cpp new file mode 100644 index 00000000..740c59b1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0210.cpp @@ -0,0 +1,10 @@ +// Test fpr a lambda that is casted to a function pointer +using func_t = void (*)(); + +int main() { + func_t a, b; + bool s = true; + (s ? a : b) = []() {}; + (s ? a : b)(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0210.gtaacg b/tools/cage/test/input/functionPointers/0210.gtaacg new file mode 100644 index 00000000..86378a9b --- /dev/null +++ b/tools/cage/test/input/functionPointers/0210.gtaacg @@ -0,0 +1,324 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@158-170": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@158-170": { + "Arguments": [], + "CalledObjects": [ + "c:0210.cpp@101@F@main#@a", + "c:0210.cpp@101@F@main#@b" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@MTE@147-153" + ], + "Prefixes": [ + { + "Member": "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", + "Object": "(c:@F@main#@MTE@147-153).c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1" + } + ] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@150@F@main#@Sa@F@operator()#1@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@150@F@main#@Sa@F@operator()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@150@F@main#@Sa@F@operator()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@147@F@main#@Sa@F@~#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@147@F@main#@Sa@F@~#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@147@F@main#@Sa@F@~#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@116@F@main#@s" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:@F@main#@MTE@147-153).c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@158-170", + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@101@F@main#@b", + "c:0210.cpp@101@F@main#@a", + "c:@F@main#@CALL_EXPR@@147-153", + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@THIS", + "&c:@F@main#@MTE@147-153" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@MTE@147-153" + } + ] + } + ], + "FunctionInfoMap": { + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S@SRETURN" + ] + }, + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@SRETURN" + ] + }, + "c:0210.cpp@147@F@main#@Sa@F@~#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainEN3$_0D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:0210.cpp@150@F@main#@Sa@F@operator()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0clEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0210.cpp@150@F@main#@Sa@F@operator()#1@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0210.cpp@147@F@main#@Sa@F@__invoke#S": "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", + "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1": "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", + "c:0210.cpp@147@F@main#@Sa@F@~#": "c:0210.cpp@147@F@main#@Sa@F@~#", + "c:0210.cpp@150@F@main#@Sa@F@operator()#1": "c:0210.cpp@150@F@main#@Sa@F@operator()#1", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_ZZ4mainEN3$_08__invokeEv": { + "callees": [ + "_ZZ4mainENK3$_0clEv" + ], + "callers": [ + "_ZZ4mainENK3$_0cvPFvvEEv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0clEv": { + "callees": [], + "callers": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEv", + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFvvEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0210.gtipcg b/tools/cage/test/input/functionPointers/0210.gtipcg new file mode 100644 index 00000000..e296ff3e --- /dev/null +++ b/tools/cage/test/input/functionPointers/0210.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0210.gtmcg b/tools/cage/test/input/functionPointers/0210.gtmcg new file mode 100644 index 00000000..e7f2a110 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0210.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFvvEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "GITDIR-NOTFOUND", + "version": "0.4" + }, + "version": "2.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0211.cpp b/tools/cage/test/input/functionPointers/0211.cpp new file mode 100644 index 00000000..d9fb4539 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0211.cpp @@ -0,0 +1,14 @@ + +using func_t = void (*)(); + +struct A { + func_t f; +}; + +void foo() {} + +int main() { + A a; + a.f = foo; + a.f(); +} diff --git a/tools/cage/test/input/functionPointers/0211.gtaacg b/tools/cage/test/input/functionPointers/0211.gtaacg new file mode 100644 index 00000000..adb7af57 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0211.gtaacg @@ -0,0 +1,330 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@106-110": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@106-110": { + "Arguments": [], + "CalledObjects": [ + "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f", + "c:@S@A@FI@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@106-110", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0211.cpp@86@F@main#@a", + "c:@F@main#@CALL_EXPR@@88-88" + ], + "Prefixes": [ + { + "Member": "c:@S@A@FI@f", + "Object": "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@88-88" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@88-88" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0211.gtipcg b/tools/cage/test/input/functionPointers/0211.gtipcg new file mode 100644 index 00000000..f9dcb249 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0211.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0211.gtmcg b/tools/cage/test/input/functionPointers/0211.gtmcg new file mode 100644 index 00000000..8acea6e2 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0211.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0211.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0211.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0212.cpp b/tools/cage/test/input/functionPointers/0212.cpp new file mode 100644 index 00000000..3958df50 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0212.cpp @@ -0,0 +1,15 @@ + +using func_t = void (*)(); + +struct A { + func_t f; +}; + +void foo() {} +void call_f(const A& arg) { arg.f(); } + +int main() { + A a; + a.f = foo; + call_f(a); +} diff --git a/tools/cage/test/input/functionPointers/0212.gtaacg b/tools/cage/test/input/functionPointers/0212.gtaacg new file mode 100644 index 00000000..030dae95 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0212.gtaacg @@ -0,0 +1,392 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104": "c:@F@call_f#&1$@S@A#" + }, + "CallInfoMap": { + "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104": { + "Arguments": [], + "CalledObjects": [ + "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_f#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@145-153", + "c:@F@call_f#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0212.cpp@125@F@main#@a).c:@S@A@FI@f", + "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f", + "c:@S@A@FI@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0212.cpp@82@F@call_f#&1$@S@A#@arg", + "c:0212.cpp@125@F@main#@a", + "c:@F@main#@CALL_EXPR@@127-127" + ], + "Prefixes": [ + { + "Member": "c:@S@A@FI@f", + "Object": "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@127-127" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@127-127" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@call_f#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_Z6call_fRK1A" + ], + "Parameters": [ + "c:0212.cpp@82@F@call_f#&1$@S@A#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@call_f#&1$@S@A#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@call_f#&1$@S@A#": "c:@F@call_f#&1$@S@A#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z6call_fRK1A" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z6call_fRK1A": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z6call_fRK1A", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z6call_fRK1A": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0212.gtipcg b/tools/cage/test/input/functionPointers/0212.gtipcg new file mode 100644 index 00000000..5d3ffa7c --- /dev/null +++ b/tools/cage/test/input/functionPointers/0212.gtipcg @@ -0,0 +1,40 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z6call_fRK1A" + ] + }, + "_Z6call_fRK1A": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z6call_fRK1A" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0212.gtmcg b/tools/cage/test/input/functionPointers/0212.gtmcg new file mode 100644 index 00000000..177a1744 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0212.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z6call_fRK1A" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z6call_fRK1A": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z6call_fRK1A" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0213.cpp b/tools/cage/test/input/functionPointers/0213.cpp new file mode 100644 index 00000000..16d4cde7 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0213.cpp @@ -0,0 +1,16 @@ + +using func_t = void (*)(); + +struct A { + func_t f; +}; + +void foo() {} +func_t get_f(const A& a) { return a.f; } + +int main() { + A a; + a.f = foo; + auto f = get_f(a); + f(); +} diff --git a/tools/cage/test/input/functionPointers/0213.gtaacg b/tools/cage/test/input/functionPointers/0213.gtaacg new file mode 100644 index 00000000..89a11f54 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0213.gtaacg @@ -0,0 +1,389 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@168-170": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@168-170": { + "Arguments": [], + "CalledObjects": [ + "c:0213.cpp@147@F@main#@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_f#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0213.cpp@147@F@main#@f", + "c:@F@main#@CALL_EXPR@@156-163", + "(c:0213.cpp@127@F@main#@a).c:@S@A@FI@f", + "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f", + "c:@F@get_f#&1$@S@A#@SRETURN", + "c:@S@A@FI@f", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@168-170", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0213.cpp@83@F@get_f#&1$@S@A#@a", + "c:0213.cpp@127@F@main#@a", + "c:@F@main#@CALL_EXPR@@129-129" + ], + "Prefixes": [ + { + "Member": "c:@S@A@FI@f", + "Object": "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f" + } + ] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@129-129" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@129-129" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@get_f#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5get_fRK1A" + ], + "Parameters": [ + "c:0213.cpp@83@F@get_f#&1$@S@A#@a" + ], + "ReferencedInReturnStmts": [ + "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f", + "c:@F@get_f#&1$@S@A#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@get_f#&1$@S@A#": "c:@F@get_f#&1$@S@A#", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5get_fRK1A": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fRK1A", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "_Z5get_fRK1A": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0213.gtipcg b/tools/cage/test/input/functionPointers/0213.gtipcg new file mode 100644 index 00000000..d4f255ac --- /dev/null +++ b/tools/cage/test/input/functionPointers/0213.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5get_fRK1A": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fRK1A" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0213.gtmcg b/tools/cage/test/input/functionPointers/0213.gtmcg new file mode 100644 index 00000000..0342e92b --- /dev/null +++ b/tools/cage/test/input/functionPointers/0213.gtmcg @@ -0,0 +1,67 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5get_fRK1A": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_Z5get_fRK1A" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0214.cpp b/tools/cage/test/input/functionPointers/0214.cpp new file mode 100644 index 00000000..65e683f1 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0214.cpp @@ -0,0 +1,11 @@ +typedef void (*func_t)(); + +void foo(func_t fp) {} +void bar() {} + +int main(int argc, char** argv) { + func_t f; + f = bar; + foo(f); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0214.gtaacg b/tools/cage/test/input/functionPointers/0214.gtaacg new file mode 100644 index 00000000..d45164fe --- /dev/null +++ b/tools/cage/test/input/functionPointers/0214.gtaacg @@ -0,0 +1,207 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0214.cpp@84@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0214.cpp@74@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@124-129", + "c:@F@foo#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0214.cpp@36@F@foo#*Fv()#@fp", + "c:0214.cpp@101@F@main#I#**C#@f", + "c:@F@bar#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@foo#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooPFvvE" + ], + "Parameters": [ + "c:0214.cpp@36@F@foo#*Fv()#@fp" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#*Fv()#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0214.cpp@74@F@main#I#**C#@argc", + "c:0214.cpp@84@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@foo#*Fv()#": "c:@F@foo#*Fv()#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooPFvvE": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0214.gtipcg b/tools/cage/test/input/functionPointers/0214.gtipcg new file mode 100644 index 00000000..1eb69ebb --- /dev/null +++ b/tools/cage/test/input/functionPointers/0214.gtipcg @@ -0,0 +1,36 @@ +{ + "_Z3barv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z3fooPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooPFvvE" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0214.gtmcg b/tools/cage/test/input/functionPointers/0214.gtmcg new file mode 100644 index 00000000..10c46c82 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0214.gtmcg @@ -0,0 +1,64 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0216.cpp b/tools/cage/test/input/functionPointers/0216.cpp new file mode 100644 index 00000000..10d8dcb3 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0216.cpp @@ -0,0 +1,9 @@ + +using func_t = void (*)(); + +int main() { + func_t a; + a = []() {}; + a(); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0216.gtaacg b/tools/cage/test/input/functionPointers/0216.gtaacg new file mode 100644 index 00000000..0a0e6727 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0216.gtaacg @@ -0,0 +1,316 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@70-72": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@70-72": { + "Arguments": [], + "CalledObjects": [ + "c:0216.cpp@44@F@main#@a" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@MTE@60-65" + ], + "Prefixes": [ + { + "Member": "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", + "Object": "(c:@F@main#@MTE@60-65).c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1" + } + ] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@63@F@main#@Sa@F@operator()#1@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@63@F@main#@Sa@F@operator()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@63@F@main#@Sa@F@operator()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@60@F@main#@Sa@F@~#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@60@F@main#@Sa@F@~#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@60@F@main#@Sa@F@~#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:@F@main#@MTE@60-65).c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@44@F@main#@a", + "c:@F@main#@CALL_EXPR@@60-65", + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@70-72", + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@THIS", + "&c:@F@main#@MTE@60-65" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@MTE@60-65" + } + ] + } + ], + "FunctionInfoMap": { + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S@SRETURN" + ] + }, + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@SRETURN" + ] + }, + "c:0216.cpp@60@F@main#@Sa@F@~#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainEN3$_0D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:0216.cpp@63@F@main#@Sa@F@operator()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0clEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0216.cpp@63@F@main#@Sa@F@operator()#1@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0216.cpp@60@F@main#@Sa@F@__invoke#S": "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", + "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1": "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", + "c:0216.cpp@60@F@main#@Sa@F@~#": "c:0216.cpp@60@F@main#@Sa@F@~#", + "c:0216.cpp@63@F@main#@Sa@F@operator()#1": "c:0216.cpp@63@F@main#@Sa@F@operator()#1", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_ZZ4mainEN3$_08__invokeEv": { + "callees": [ + "_ZZ4mainENK3$_0clEv" + ], + "callers": [ + "_ZZ4mainENK3$_0cvPFvvEEv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0clEv": { + "callees": [], + "callers": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEv", + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFvvEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0216.gtipcg b/tools/cage/test/input/functionPointers/0216.gtipcg new file mode 100644 index 00000000..aff2b684 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0216.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0216.gtmcg b/tools/cage/test/input/functionPointers/0216.gtmcg new file mode 100644 index 00000000..bccc6f5d --- /dev/null +++ b/tools/cage/test/input/functionPointers/0216.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [ ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFvvEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "GITDIR-NOTFOUND", + "version": "0.4" + }, + "version": "2.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0217.cpp b/tools/cage/test/input/functionPointers/0217.cpp new file mode 100644 index 00000000..965e2b57 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0217.cpp @@ -0,0 +1,12 @@ +// Test passing a variable through a lambda that is cast to a fptr +using func_t = int (*)(int); + +int main() { + func_t lamb = [](int a) { + int tmp = a; + return tmp; + }; + int parameter = 0; + int result = lamb(parameter); + return 0; +} diff --git a/tools/cage/test/input/functionPointers/0217.gtaacg b/tools/cage/test/input/functionPointers/0217.gtaacg new file mode 100644 index 00000000..9699c119 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0217.gtaacg @@ -0,0 +1,331 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@212-226": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@212-226": { + "Arguments": [ + [ + "c:0217.cpp@178@F@main#@parameter" + ] + ], + "CalledObjects": [ + "c:0217.cpp@112@F@main#@lamb" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@MTE@126-173" + ], + "Prefixes": [ + { + "Member": "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", + "Object": "(c:@F@main#@MTE@126-173).c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1" + } + ] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@126@F@main#@Sa@F@~#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@126@F@main#@Sa@F@~#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@126@F@main#@Sa@F@~#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:@F@main#@MTE@126-173).c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@112@F@main#@lamb", + "c:@F@main#@CALL_EXPR@@126-173", + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@199@F@main#@result", + "c:@F@main#@CALL_EXPR@@212-226", + "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S@SRETURN", + "c:0217.cpp@129@F@main#@Sa@F@__invoke#I#S@a", + "c:0217.cpp@129@F@main#@Sa@F@operator()#I#1@a", + "c:0217.cpp@178@F@main#@parameter" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@THIS", + "&c:@F@main#@MTE@126-173" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@MTE@126-173" + } + ] + } + ], + "FunctionInfoMap": { + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_08__invokeEi" + ], + "Parameters": [ + "c:0217.cpp@129@F@main#@Sa@F@__invoke#I#S@a" + ], + "ReferencedInReturnStmts": [ + "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S@SRETURN" + ] + }, + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0cvPFiiEEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@SRETURN" + ] + }, + "c:0217.cpp@126@F@main#@Sa@F@~#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainEN3$_0D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0clEi" + ], + "Parameters": [ + "c:0217.cpp@129@F@main#@Sa@F@operator()#I#1@a" + ], + "ReferencedInReturnStmts": [ + "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S": "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", + "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1": "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", + "c:0217.cpp@126@F@main#@Sa@F@~#": "c:0217.cpp@126@F@main#@Sa@F@~#", + "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1": "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_ZZ4mainEN3$_08__invokeEi": { + "callees": [ + "_ZZ4mainENK3$_0clEi" + ], + "callers": [ + "_ZZ4mainENK3$_0cvPFiiEEv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0clEi": { + "callees": [], + "callers": [ + "_ZZ4mainEN3$_08__invokeEi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0cvPFiiEEv": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEi" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEi", + "_ZZ4mainENK3$_0cvPFiiEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFiiEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "e99454234010d5c91f671a53644c35b50f26c368", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/functionPointers/0217.gtipcg b/tools/cage/test/input/functionPointers/0217.gtipcg new file mode 100644 index 00000000..55b03195 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0217.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0cvPFiiEEv": { + "callees": [ ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFiiEEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/functionPointers/0217.gtmcg b/tools/cage/test/input/functionPointers/0217.gtmcg new file mode 100644 index 00000000..43a83306 --- /dev/null +++ b/tools/cage/test/input/functionPointers/0217.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0cvPFiiEEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0cvPFiiEEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0cvPFiiEEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "e99454234010d5c91f671a53644c35b50f26c368", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.cpp b/tools/cage/test/input/metaCollectors/numStatements/0023.cpp new file mode 100644 index 00000000..079e8201 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0023.cpp @@ -0,0 +1,10 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k; ++i) { + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg new file mode 100644 index 00000000..a0a7bdc9 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0023.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0023.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0023.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0023.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0023.cpp@11@F@main#I#**C#@argc", + "c:0023.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0023.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg new file mode 100644 index 00000000..e243b733 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg new file mode 100644 index 00000000..6423dd99 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0023.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.cpp b/tools/cage/test/input/metaCollectors/numStatements/0024.cpp new file mode 100644 index 00000000..942ed542 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0024.cpp @@ -0,0 +1,11 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k;) { + ++i; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg new file mode 100644 index 00000000..1a085dcf --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0024.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0024.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0024.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0024.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0024.cpp@11@F@main#I#**C#@argc", + "c:0024.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0024.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg new file mode 100644 index 00000000..f055fa7b --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg new file mode 100644 index 00000000..b7ee6993 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0024.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.cpp b/tools/cage/test/input/metaCollectors/numStatements/0025.cpp new file mode 100644 index 00000000..fe1e1a09 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0025.cpp @@ -0,0 +1,12 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k;) { + ++i; + --k; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg new file mode 100644 index 00000000..70b42bad --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0025.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0025.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0025.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0025.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0025.cpp@11@F@main#I#**C#@argc", + "c:0025.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0025.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 6, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg new file mode 100644 index 00000000..f465226c --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg new file mode 100644 index 00000000..db824351 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0025.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.cpp b/tools/cage/test/input/metaCollectors/numStatements/0026.cpp new file mode 100644 index 00000000..d4602add --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0026.cpp @@ -0,0 +1,15 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k;) { + ++i; + --k; + if (k % 2 == 0) { + ++k; + } + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg new file mode 100644 index 00000000..45940fc7 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0026.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0026.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0026.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0026.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0026.cpp@11@F@main#I#**C#@argc", + "c:0026.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0026.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 10, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg new file mode 100644 index 00000000..55c50070 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 7, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg new file mode 100644 index 00000000..49092fa3 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0026.cpp", + "systemInclude": false + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.cpp b/tools/cage/test/input/metaCollectors/numStatements/0027.cpp new file mode 100644 index 00000000..9a46bd25 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0027.cpp @@ -0,0 +1,16 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k;) { + ++i; + --k; + if (k % 2 == 0) { + ++k; + } else { + } + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg new file mode 100644 index 00000000..e2367ad9 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0027.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0027.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0027.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0027.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0027.cpp@11@F@main#I#**C#@argc", + "c:0027.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0027.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 10, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg new file mode 100644 index 00000000..55c50070 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 7, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg new file mode 100644 index 00000000..b9b26613 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0027.cpp", + "systemInclude": false + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.cpp b/tools/cage/test/input/metaCollectors/numStatements/0028.cpp new file mode 100644 index 00000000..33f90e63 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0028.cpp @@ -0,0 +1,16 @@ + + +int main(int argc, char** argv) { + int k = 12; + + for (int i = 0; i < k;) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg new file mode 100644 index 00000000..bbb9591a --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0028.cpp@58@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0028.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0028.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0028.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0028.cpp@11@F@main#I#**C#@argc", + "c:0028.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0028.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 10, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg new file mode 100644 index 00000000..55c50070 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 7, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg new file mode 100644 index 00000000..34bcb708 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0028.cpp", + "systemInclude": false + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.cpp b/tools/cage/test/input/metaCollectors/numStatements/0029.cpp new file mode 100644 index 00000000..97b76b7f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0029.cpp @@ -0,0 +1,18 @@ + + +int main(int argc, char** argv) { + int k = 12; + int i = 0; + + while (i < k) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + ++i; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg new file mode 100644 index 00000000..65dfa33f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg @@ -0,0 +1,102 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0029.cpp@52@F@main#I#**C#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0029.cpp@38@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0029.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0029.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0029.cpp@11@F@main#I#**C#@argc", + "c:0029.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0029.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 11, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg new file mode 100644 index 00000000..c192a51f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 9, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg new file mode 100644 index 00000000..286af256 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0029.cpp", + "systemInclude": false + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.cpp b/tools/cage/test/input/metaCollectors/numStatements/0030.cpp new file mode 100644 index 00000000..1f22e4a7 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0030.cpp @@ -0,0 +1,19 @@ + +int foo() { return 4 + 2; } + +int main(int argc, char** argv) { + int k = 12; + int i = foo(); + + while (i < k) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + ++i; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg new file mode 100644 index 00000000..e4634efa --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg @@ -0,0 +1,157 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0030.cpp@66@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0030.cpp@49@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0030.cpp@39@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0030.cpp@80@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@88-92", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0030.cpp@39@F@main#I#**C#@argc", + "c:0030.cpp@49@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0030.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0030.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 11, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg new file mode 100644 index 00000000..b1023de0 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 9, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg new file mode 100644 index 00000000..0059f732 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0030.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0030.cpp", + "systemInclude": false + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.cpp b/tools/cage/test/input/metaCollectors/numStatements/0031.cpp new file mode 100644 index 00000000..a2cc98de --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0031.cpp @@ -0,0 +1,22 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + while (i < k) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + ++i; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg new file mode 100644 index 00000000..7739ac03 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg @@ -0,0 +1,160 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0031.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0031.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0031.cpp@9@F@foo#I#@k", + "c:0031.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0031.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0031.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0031.cpp@53@F@main#I#**C#@argc", + "c:0031.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0031.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0031.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 11, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg new file mode 100644 index 00000000..9474853f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 9, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg new file mode 100644 index 00000000..0db11623 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0031.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0031.cpp", + "systemInclude": false + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.cpp b/tools/cage/test/input/metaCollectors/numStatements/0032.cpp new file mode 100644 index 00000000..e8768500 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0032.cpp @@ -0,0 +1,34 @@ + +int bar(int f) { + int k = f % 3; + int n = 0; + while (k > 0) { + --k; + ++n; + } + return n; +} + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + while (i < k) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + ++i; + } + + int n = bar(i); + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg new file mode 100644 index 00000000..94f0cf48 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg @@ -0,0 +1,225 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0032.cpp@165@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0032.cpp@155@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0032.cpp@111@F@foo#I#@k", + "c:0032.cpp@182@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0032.cpp@20@F@bar#I#@k", + "c:0032.cpp@9@F@bar#I#@f", + "c:0032.cpp@196@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@204-209", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0032.cpp@321@F@main#I#**C#@n", + "c:@F@main#I#**C#@CALL_EXPR@@329-334", + "c:0032.cpp@37@F@bar#I#@n", + "c:@F@bar#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3bari" + ], + "Parameters": [ + "c:0032.cpp@9@F@bar#I#@f" + ], + "ReferencedInReturnStmts": [ + "c:0032.cpp@37@F@bar#I#@n", + "c:@F@bar#I#@SRETURN" + ] + }, + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0032.cpp@111@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0032.cpp@155@F@main#I#**C#@argc", + "c:0032.cpp@165@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#I#": "c:@F@bar#I#", + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3bari": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z3bari": 0, + "_Z3fooi": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 12, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg new file mode 100644 index 00000000..f6240d2e --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z3bari": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 10, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg new file mode 100644 index 00000000..cabc1b17 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg @@ -0,0 +1,67 @@ +{ + "_CG": { + "_Z3bari": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", + "systemInclude": false + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.cpp b/tools/cage/test/input/metaCollectors/numStatements/0033.cpp new file mode 100644 index 00000000..4b77d5f9 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0033.cpp @@ -0,0 +1,36 @@ + +int sentinel(int f) { return f / 2; } + +int bar(int f) { + int k = f % 3; + int n = 0; + while (k > 0) { + --k; + ++n; + } + return sentinel(n); +} + +int foo(int k) { + ++k; + return sentinel(4 * k); +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + while (i < k) { + if (k % 2 == 0) { + ++k; + } else { + ++i; + ++k; + } + ++i; + } + + int n = bar(i); + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg new file mode 100644 index 00000000..901b2790 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg @@ -0,0 +1,286 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@sentinel#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0033.cpp@224@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0033.cpp@214@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0033.cpp@160@F@foo#I#@k", + "c:0033.cpp@241@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0033.cpp@380@F@main#I#**C#@n", + "c:0033.cpp@59@F@bar#I#@k", + "c:0033.cpp@48@F@bar#I#@f", + "c:0033.cpp@255@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@388-393", + "c:@F@main#I#**C#@CALL_EXPR@@263-268", + "c:@F@foo#I#@CALL_EXPR@@185-199", + "c:@F@bar#I#@CALL_EXPR@@136-146", + "c:0033.cpp@14@F@sentinel#I#@f", + "c:0033.cpp@76@F@bar#I#@n", + "c:@F@sentinel#I#@SRETURN", + "c:@F@foo#I#@SRETURN", + "c:@F@bar#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3bari" + ], + "Parameters": [ + "c:0033.cpp@48@F@bar#I#@f" + ], + "ReferencedInReturnStmts": [ + "c:@F@bar#I#@CALL_EXPR@@136-146", + "c:@F@bar#I#@SRETURN" + ] + }, + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0033.cpp@160@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@CALL_EXPR@@185-199", + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0033.cpp@214@F@main#I#**C#@argc", + "c:0033.cpp@224@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + }, + "c:@F@sentinel#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8sentineli" + ], + "Parameters": [ + "c:0033.cpp@14@F@sentinel#I#@f" + ], + "ReferencedInReturnStmts": [ + "c:0033.cpp@14@F@sentinel#I#@f", + "c:@F@sentinel#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#I#": "c:@F@bar#I#", + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#", + "c:@F@sentinel#I#": "c:@F@sentinel#I#" + } + }, + "_CG": { + "_Z3bari": { + "callees": [ + "_Z8sentineli" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z8sentineli": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooi": { + "callees": [ + "_Z8sentineli" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z8sentineli": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8sentineli": { + "callees": [], + "callers": [ + "_Z3bari", + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z3bari": 0, + "_Z3fooi": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 12, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg new file mode 100644 index 00000000..cf5d16a2 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg @@ -0,0 +1,56 @@ +{ + "_Z3bari": { + "callees": [ + "_Z8sentineli" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z3fooi": { + "callees": [ + "_Z8sentineli" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z8sentineli": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z3bari", + "_Z3fooi" + ] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 10, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg new file mode 100644 index 00000000..d8244473 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg @@ -0,0 +1,90 @@ +{ + "_CG": { + "_Z3bari": { + "callees": [ + "_Z8sentineli" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooi": { + "callees": [ + "_Z8sentineli" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8sentineli": { + "callees": [], + "callers": [ + "_Z3fooi", + "_Z3bari" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3bari", + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", + "systemInclude": false + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.cpp b/tools/cage/test/input/metaCollectors/numStatements/0034.cpp new file mode 100644 index 00000000..ac746f68 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0034.cpp @@ -0,0 +1,18 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + switch (k) { + default: + k = 11; + break; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg new file mode 100644 index 00000000..3b67350e --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg @@ -0,0 +1,160 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0034.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0034.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0034.cpp@9@F@foo#I#@k", + "c:0034.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0034.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0034.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0034.cpp@53@F@main#I#**C#@argc", + "c:0034.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0034.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0034.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg new file mode 100644 index 00000000..a6a8ec47 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg new file mode 100644 index 00000000..7da9971b --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0034.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0034.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.cpp b/tools/cage/test/input/metaCollectors/numStatements/0035.cpp new file mode 100644 index 00000000..e49c5549 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0035.cpp @@ -0,0 +1,20 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + switch (k) { + case 1: + case 2: + default: + k = 11; + break; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg new file mode 100644 index 00000000..744e2718 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg @@ -0,0 +1,160 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0035.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0035.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0035.cpp@9@F@foo#I#@k", + "c:0035.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0035.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0035.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0035.cpp@53@F@main#I#**C#@argc", + "c:0035.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0035.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0035.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 6, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg new file mode 100644 index 00000000..a6a8ec47 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg new file mode 100644 index 00000000..fccb0746 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0035.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0035.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.cpp b/tools/cage/test/input/metaCollectors/numStatements/0036.cpp new file mode 100644 index 00000000..2ce496b8 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0036.cpp @@ -0,0 +1,25 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + switch (k) { + case 1: + k = 2; + break; + case 4: + k = 100; + i = 101; + break; + default: + k = 11; + break; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg new file mode 100644 index 00000000..c41ff4fe --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg @@ -0,0 +1,160 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0036.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0036.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0036.cpp@9@F@foo#I#@k", + "c:0036.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0036.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0036.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0036.cpp@53@F@main#I#**C#@argc", + "c:0036.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0036.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0036.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 0, + "numberOfIntOps": 9, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 11 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg new file mode 100644 index 00000000..dac488ed --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 11, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg new file mode 100644 index 00000000..7eaf5883 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0036.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0036.cpp", + "systemInclude": false + }, + "numStatements": 11 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.cpp b/tools/cage/test/input/metaCollectors/numStatements/0037.cpp new file mode 100644 index 00000000..217e4124 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0037.cpp @@ -0,0 +1,17 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + do { + i = k - 2; + ++i; + } while (i < k); + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg new file mode 100644 index 00000000..c64bef89 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg @@ -0,0 +1,155 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0037.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0037.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0037.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN", + "c:0037.cpp@9@F@foo#I#@k", + "c:0037.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0037.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0037.cpp@53@F@main#I#**C#@argc", + "c:0037.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0037.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0037.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg new file mode 100644 index 00000000..a6a8ec47 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg new file mode 100644 index 00000000..caa73bbc --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0037.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0037.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.cpp b/tools/cage/test/input/metaCollectors/numStatements/0038.cpp new file mode 100644 index 00000000..0a3bf55e --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0038.cpp @@ -0,0 +1,17 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + try { + ++k; + } catch (int ec) { + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg new file mode 100644 index 00000000..e0d40850 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg @@ -0,0 +1,166 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0038.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0038.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0038.cpp@139@F@main#I#**C#@ec" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0038.cpp@9@F@foo#I#@k", + "c:0038.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0038.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0038.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0038.cpp@53@F@main#I#**C#@argc", + "c:0038.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0038.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0038.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg new file mode 100644 index 00000000..a6a8ec47 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg new file mode 100644 index 00000000..926f19a0 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0038.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0038.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.cpp b/tools/cage/test/input/metaCollectors/numStatements/0039.cpp new file mode 100644 index 00000000..72edc1f1 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0039.cpp @@ -0,0 +1,18 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + try { + ++k; + } catch (int ec) { + ++i; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg new file mode 100644 index 00000000..4942e5ab --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg @@ -0,0 +1,166 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0039.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0039.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0039.cpp@139@F@main#I#**C#@ec" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0039.cpp@9@F@foo#I#@k", + "c:0039.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0039.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0039.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0039.cpp@53@F@main#I#**C#@argc", + "c:0039.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0039.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0039.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 6, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg new file mode 100644 index 00000000..8236746b --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 7, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg new file mode 100644 index 00000000..befaf4eb --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0039.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0039.cpp", + "systemInclude": false + }, + "numStatements": 7 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.cpp b/tools/cage/test/input/metaCollectors/numStatements/0040.cpp new file mode 100644 index 00000000..d867587b --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0040.cpp @@ -0,0 +1,26 @@ + +int foo(int k) { + ++k; + return 4 * k; +} + +int main(int argc, char** argv) { + int k = 12; + int i = foo(k); + + switch (k) { + case 1: + k = 2; + break; + case 4: { + k = 100; + i = 101; + break; + } + default: + k = 11; + break; + } + + return 0; +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg new file mode 100644 index 00000000..9563cefc --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg @@ -0,0 +1,160 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0040.cpp@63@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0040.cpp@53@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0040.cpp@9@F@foo#I#@k", + "c:0040.cpp@80@F@main#I#**C#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0040.cpp@94@F@main#I#**C#@i", + "c:@F@main#I#**C#@CALL_EXPR@@102-107", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0040.cpp@9@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0040.cpp@53@F@main#I#**C#@argc", + "c:0040.cpp@63@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0040.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0040.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 0, + "numberOfIntOps": 9, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 11 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg new file mode 100644 index 00000000..dac488ed --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3fooi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 11, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg new file mode 100644 index 00000000..f1ffbd2f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0040.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0040.cpp", + "systemInclude": false + }, + "numStatements": 11 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.cpp b/tools/cage/test/input/metaCollectors/numStatements/0041.cpp new file mode 100644 index 00000000..c795a862 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0041.cpp @@ -0,0 +1,6 @@ + +int main(int argc, char** argv) { + const auto l = []() {}; + l(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg new file mode 100644 index 00000000..e4924f93 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg @@ -0,0 +1,522 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@20@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@10@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0", + "c:@F@main#I#**C#@MTE@51-56" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@61-63", + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@36@F@main#I#**C#@l", + "c:@F@main#I#**C#@CALL_EXPR@@51-56" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@THIS", + "&c:@F@main#I#**C#@CALL_EXPR@@51-56" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#I#**C#@CALL_EXPR@@51-56" + } + ] + }, + { + "Objects": [ + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@THIS", + "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#@THIS", + "&c:0041.cpp@36@F@main#I#**C#@l" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0041.cpp@36@F@main#I#**C#@l" + } + ] + } + ], + "FunctionInfoMap": { + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0C2EOS_", + "_ZZ4mainEN3$_0C1EOS_" + ], + "Parameters": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0C2ERKS_", + "_ZZ4mainEN3$_0C1ERKS_" + ], + "Parameters": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S@SRETURN" + ] + }, + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@SRETURN" + ] + }, + "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainEN3$_0D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0clEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0041.cpp@10@F@main#I#**C#@argc", + "c:0041.cpp@20@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#", + "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#", + "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S": "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S", + "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1": "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1", + "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#", + "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1": "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_ZZ4mainEN3$_08__invokeEv": { + "callees": [ + "_ZZ4mainENK3$_0clEv" + ], + "callers": [ + "_ZZ4mainENK3$_0cvPFvvEEv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0C1EOS_": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0C2EOS_": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0D1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0D2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0clEv": { + "callees": [], + "callers": [ + "_ZZ4mainEN3$_08__invokeEv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0cvPFvvEEv": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainEN3$_0C1EOS_", + "_ZZ4mainEN3$_0C2EOS_", + "_ZZ4mainEN3$_0D1Ev", + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainENK3$_0clEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0clEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg new file mode 100644 index 00000000..9adebc1f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0clEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg new file mode 100644 index 00000000..ee9a33b9 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0clEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZZ4mainENK3$_0clEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "GITDIR-NOTFOUND", + "version": "0.4" + }, + "version": "2.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.cpp b/tools/cage/test/input/metaCollectors/numStatements/0042.cpp new file mode 100644 index 00000000..3d5af319 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0042.cpp @@ -0,0 +1,12 @@ +int main(int argc, char** argv) { + const auto l = [](int a, int b) { + float alpha = a / (1.0 * b); + double delta = .0; + for (int i = 0; i < 4; ++i) { + delta = a * i * alpha; + } + return delta; + }; + auto d = l(2, 4); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg new file mode 100644 index 00000000..7454b553 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg @@ -0,0 +1,548 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@43@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@33@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@157@F@main#I#**C#@Sa@F@operator()#I#I#1@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0", + "c:@F@main#I#**C#@MTE@74-236" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@84@F@main#I#**C#@Sa@F@__invoke#I#I#S@b", + "c:0042.cpp@84@F@main#I#**C#@Sa@F@operator()#I#I#1@b" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@59@F@main#I#**C#@l", + "c:@F@main#I#**C#@CALL_EXPR@@74-236" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@241@F@main#I#**C#@d", + "c:@F@main#I#**C#@CALL_EXPR@@250-256", + "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@SRETURN", + "c:0042.cpp@96@F@main#I#**C#@Sa@F@operator()#I#I#1@alpha", + "c:0042.cpp@77@F@main#I#**C#@Sa@F@__invoke#I#I#S@a", + "c:0042.cpp@77@F@main#I#**C#@Sa@F@operator()#I#I#1@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@THIS", + "&c:@F@main#I#**C#@CALL_EXPR@@74-236" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#I#**C#@CALL_EXPR@@74-236" + } + ] + }, + { + "Objects": [ + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@THIS", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#@THIS", + "&c:0042.cpp@59@F@main#I#**C#@l" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0042.cpp@59@F@main#I#**C#@l" + } + ] + } + ], + "FunctionInfoMap": { + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0C2EOS_", + "_ZZ4mainEN3$_0C1EOS_" + ], + "Parameters": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0C2ERKS_", + "_ZZ4mainEN3$_0C1ERKS_" + ], + "Parameters": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_08__invokeEii" + ], + "Parameters": [ + "c:0042.cpp@77@F@main#I#**C#@Sa@F@__invoke#I#I#S@a", + "c:0042.cpp@84@F@main#I#**C#@Sa@F@__invoke#I#I#S@b" + ], + "ReferencedInReturnStmts": [ + "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S@SRETURN" + ] + }, + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0cvPFdiiEEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@SRETURN" + ] + }, + "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainEN3$_0D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1": { + "IsVariadic": false, + "MangledNames": [ + "_ZZ4mainENK3$_0clEii" + ], + "Parameters": [ + "c:0042.cpp@77@F@main#I#**C#@Sa@F@operator()#I#I#1@a", + "c:0042.cpp@84@F@main#I#**C#@Sa@F@operator()#I#I#1@b" + ], + "ReferencedInReturnStmts": [ + "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0042.cpp@33@F@main#I#**C#@argc", + "c:0042.cpp@43@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S": "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1": "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1", + "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#", + "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1": "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_ZZ4mainEN3$_08__invokeEii": { + "callees": [ + "_ZZ4mainENK3$_0clEii" + ], + "callers": [ + "_ZZ4mainENK3$_0cvPFdiiEEv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0C1EOS_": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0C2EOS_": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0D1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainEN3$_0D2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0clEii": { + "callees": [], + "callers": [ + "_ZZ4mainEN3$_08__invokeEii", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 15, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZZ4mainENK3$_0cvPFdiiEEv": { + "callees": [ + "_ZZ4mainEN3$_08__invokeEii" + ], + "callers": [], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainEN3$_0C1EOS_", + "_ZZ4mainEN3$_0C2EOS_", + "_ZZ4mainEN3$_0D1Ev", + "_ZZ4mainEN3$_0D2Ev", + "_ZZ4mainENK3$_0clEii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_ZZ4mainENK3$_0clEii": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 17, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "e99454234010d5c91f671a53644c35b50f26c368", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg new file mode 100644 index 00000000..eb7dc0c2 --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg @@ -0,0 +1,26 @@ +{ + "_ZZ4mainENK3$_0clEii": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEii" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg new file mode 100644 index 00000000..2e69e22f --- /dev/null +++ b/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "_ZZ4mainENK3$_0clEii": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 15, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZZ4mainENK3$_0clEii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_ZZ4mainENK3$_0clEii": 0 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 17, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "GITDIR-NOTFOUND", + "version": "0.4" + }, + "version": "2.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042_a.cpp b/tools/cage/test/input/multiTU/0042_a.cpp new file mode 100644 index 00000000..646f9f9c --- /dev/null +++ b/tools/cage/test/input/multiTU/0042_a.cpp @@ -0,0 +1,3 @@ +int foo() { return 42; } + +int baz() { return foo(); } diff --git a/tools/cage/test/input/multiTU/0042_b.cpp b/tools/cage/test/input/multiTU/0042_b.cpp new file mode 100644 index 00000000..e8fd486a --- /dev/null +++ b/tools/cage/test/input/multiTU/0042_b.cpp @@ -0,0 +1,7 @@ +int boo() { + int a = 1; + int b = 0; + return a + b; +} + +int bar() { return boo(); } diff --git a/tools/cage/test/input/multiTU/0042_combined.gtmcg b/tools/cage/test/input/multiTU/0042_combined.gtmcg new file mode 100644 index 00000000..f5d89fad --- /dev/null +++ b/tools/cage/test/input/multiTU/0042_combined.gtmcg @@ -0,0 +1,84 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [ + "_Z3boov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_b.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3bazv": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_a.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3boov": { + "callees": [], + "callers": [ + "_Z3barv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_b.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z3bazv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_a.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0043_a.cpp b/tools/cage/test/input/multiTU/0043_a.cpp new file mode 100644 index 00000000..8c558c56 --- /dev/null +++ b/tools/cage/test/input/multiTU/0043_a.cpp @@ -0,0 +1,3 @@ +int foo() { return 1; } + +int bar() { return 2; } diff --git a/tools/cage/test/input/multiTU/0043_b.cpp b/tools/cage/test/input/multiTU/0043_b.cpp new file mode 100644 index 00000000..72dad579 --- /dev/null +++ b/tools/cage/test/input/multiTU/0043_b.cpp @@ -0,0 +1,5 @@ +extern int bar(); + +int har() { return 4; } + +int goo() { return bar(); } diff --git a/tools/cage/test/input/multiTU/0043_combined.gtmcg b/tools/cage/test/input/multiTU/0043_combined.gtmcg new file mode 100644 index 00000000..252a25a9 --- /dev/null +++ b/tools/cage/test/input/multiTU/0043_combined.gtmcg @@ -0,0 +1,96 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [ + "_Z3goov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_a.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_a.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3goov": { + "callees": [ + "_Z3barv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3harv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0044_a.cpp b/tools/cage/test/input/multiTU/0044_a.cpp new file mode 100644 index 00000000..deffde2e --- /dev/null +++ b/tools/cage/test/input/multiTU/0044_a.cpp @@ -0,0 +1,5 @@ +extern int foo(); + +int bar() { return foo(); } + +int har() { return bar(); } diff --git a/tools/cage/test/input/multiTU/0044_b.cpp b/tools/cage/test/input/multiTU/0044_b.cpp new file mode 100644 index 00000000..642cebe8 --- /dev/null +++ b/tools/cage/test/input/multiTU/0044_b.cpp @@ -0,0 +1,3 @@ +int foo() { return 2; } + +int hf() { return foo(); } diff --git a/tools/cage/test/input/multiTU/0044_combined.gtmcg b/tools/cage/test/input/multiTU/0044_combined.gtmcg new file mode 100644 index 00000000..1d5a77e7 --- /dev/null +++ b/tools/cage/test/input/multiTU/0044_combined.gtmcg @@ -0,0 +1,103 @@ +{ + "_CG": { + "_Z2hfv": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3barv": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "_Z3harv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_a.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z2hfv", + "_Z3barv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3harv": { + "callees": [ + "_Z3barv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_a.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0050.h b/tools/cage/test/input/multiTU/0050.h new file mode 100644 index 00000000..80b8a9f9 --- /dev/null +++ b/tools/cage/test/input/multiTU/0050.h @@ -0,0 +1,8 @@ + +struct Base { + virtual void foo() {} +}; + +struct Derive : public Base { + virtual void foo() override {} +}; diff --git a/tools/cage/test/input/multiTU/0050_a.cpp b/tools/cage/test/input/multiTU/0050_a.cpp new file mode 100644 index 00000000..e243ffc2 --- /dev/null +++ b/tools/cage/test/input/multiTU/0050_a.cpp @@ -0,0 +1,5 @@ +#include "0050.h" + +struct DeriveTwo : public Base { + virtual void foo() override {} +}; diff --git a/tools/cage/test/input/multiTU/0050_b.cpp b/tools/cage/test/input/multiTU/0050_b.cpp new file mode 100644 index 00000000..01b0edab --- /dev/null +++ b/tools/cage/test/input/multiTU/0050_b.cpp @@ -0,0 +1,5 @@ +#include "0050.h" + +struct DeriveDerive : public Derive { + virtual void foo() override {} +}; diff --git a/tools/cage/test/input/multiTU/0050_combined.gtmcg b/tools/cage/test/input/multiTU/0050_combined.gtmcg new file mode 100644 index 00000000..2db20431 --- /dev/null +++ b/tools/cage/test/input/multiTU/0050_combined.gtmcg @@ -0,0 +1,103 @@ +{ + "_CG": { + "_ZN12DeriveDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN6Derive3fooEv" + ] + }, + "_ZN4Base3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050.h", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN9DeriveTwo3fooEv", + "_ZN6Derive3fooEv" + ], + "overrides": [] + }, + "_ZN6Derive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050.h", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN12DeriveDerive3fooEv" + ], + "overrides": [ + "_ZN4Base3fooEv" + ] + }, + "_ZN9DeriveTwo3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050_a.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN4Base3fooEv" + ] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0053.h b/tools/cage/test/input/multiTU/0053.h new file mode 100644 index 00000000..2f4dbded --- /dev/null +++ b/tools/cage/test/input/multiTU/0053.h @@ -0,0 +1,10 @@ + +class MyClass { + public: + virtual int foo() = 0; +}; + +class MyClassDerive : public MyClass { + public: + virtual int foo(); +}; diff --git a/tools/cage/test/input/multiTU/0053_a.cpp b/tools/cage/test/input/multiTU/0053_a.cpp new file mode 100644 index 00000000..817bffd4 --- /dev/null +++ b/tools/cage/test/input/multiTU/0053_a.cpp @@ -0,0 +1,3 @@ +#include "0053.h" + +int MyClassDerive::foo() { return 42; } diff --git a/tools/cage/test/input/multiTU/0053_b.cpp b/tools/cage/test/input/multiTU/0053_b.cpp new file mode 100644 index 00000000..f5aa55a3 --- /dev/null +++ b/tools/cage/test/input/multiTU/0053_b.cpp @@ -0,0 +1,15 @@ +// call to redefining function + +#include "0053.h" + +class MyClassDeriveD : public MyClassDerive { + public: + int foo() { return 1; } +}; + +int main(int argc, char* argv[]) { + MyClass* m = new MyClassDeriveD(); + m->foo(); + + return 0; +} diff --git a/tools/cage/test/input/multiTU/0053_combined.gtmcg b/tools/cage/test/input/multiTU/0053_combined.gtmcg new file mode 100644 index 00000000..929656ca --- /dev/null +++ b/tools/cage/test/input/multiTU/0053_combined.gtmcg @@ -0,0 +1,104 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053.h", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [ + "_ZN14MyClassDeriveD3fooEv" + ], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN14MyClassDeriveD3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [ + "_ZN13MyClassDerive3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053.h", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053_b.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0060_a.cpp b/tools/cage/test/input/multiTU/0060_a.cpp new file mode 100644 index 00000000..0df094e3 --- /dev/null +++ b/tools/cage/test/input/multiTU/0060_a.cpp @@ -0,0 +1,50 @@ +void leaf() { + while (true) { + break; + } +} + +void loop(); + +void x() { + leaf(); + loop(); +} + +void left() { + while (true) { + x(); + break; + } +} + +void right() { + while (true) { + while (true) { + x(); + break; + } + break; + } +} + +void split() { + left(); + right(); +} + +void entry() { + while (true) { + while (true) { + left(); + entry(); + break; + } + break; + } +} + +int main() { + split(); + return 0; +} diff --git a/tools/cage/test/input/multiTU/0060_b.cpp b/tools/cage/test/input/multiTU/0060_b.cpp new file mode 100644 index 00000000..9f66928f --- /dev/null +++ b/tools/cage/test/input/multiTU/0060_b.cpp @@ -0,0 +1,8 @@ +void split(); + +void loop() { + while (true) { + split(); + break; + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0060_combined.gtmcg b/tools/cage/test/input/multiTU/0060_combined.gtmcg new file mode 100644 index 00000000..5be66820 --- /dev/null +++ b/tools/cage/test/input/multiTU/0060_combined.gtmcg @@ -0,0 +1,174 @@ +{ + "_CG": { + "_Z1xv": { + "callees": [ + "_Z4leafv", + "_Z4loopv" + ], + "callers": [ + "_Z4leftv", + "_Z5rightv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leafv": { + "callees": [], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leftv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5entryv", + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4loopv": { + "callees": [ + "_Z5splitv" + ], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_b.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5entryv": { + "callees": [ + "_Z4leftv", + "_Z5entryv" + ], + "callers": [ + "_Z5entryv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5rightv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5splitv": { + "callees": [ + "_Z4leftv", + "_Z5rightv" + ], + "callers": [ + "_Z4loopv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z5splitv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0070_a.cpp b/tools/cage/test/input/multiTU/0070_a.cpp new file mode 100644 index 00000000..6fa0fb76 --- /dev/null +++ b/tools/cage/test/input/multiTU/0070_a.cpp @@ -0,0 +1,7 @@ +// Test for handling different parameters across translation units +int foo(int some_name, int); + +int main() { + foo(1, 2); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0070_a.gtaacg b/tools/cage/test/input/multiTU/0070_a.gtaacg new file mode 100644 index 00000000..67f70cd1 --- /dev/null +++ b/tools/cage/test/input/multiTU/0070_a.gtaacg @@ -0,0 +1,150 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#I#@UNNAMED_PARAM@1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0070_a.cpp@75@F@foo#I#I#@some_name" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@112-120", + "c:@F@foo#I#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooii" + ], + "Parameters": [ + "c:0070_a.cpp@75@F@foo#I#I#@some_name", + "c:@F@foo#I#I#@UNNAMED_PARAM@1" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#I#": "c:@F@foo#I#I#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3fooii": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooii": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0070_b.cpp b/tools/cage/test/input/multiTU/0070_b.cpp new file mode 100644 index 00000000..f291e380 --- /dev/null +++ b/tools/cage/test/input/multiTU/0070_b.cpp @@ -0,0 +1 @@ +int foo(int a, int b) { return a; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0070_b.gtaacg b/tools/cage/test/input/multiTU/0070_b.gtaacg new file mode 100644 index 00000000..17c0bbff --- /dev/null +++ b/tools/cage/test/input/multiTU/0070_b.gtaacg @@ -0,0 +1,91 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@foo#I#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0070_b.cpp@8@F@foo#I#I#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0070_b.cpp@15@F@foo#I#I#@b" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooii" + ], + "Parameters": [ + "c:0070_b.cpp@8@F@foo#I#I#@a", + "c:0070_b.cpp@15@F@foo#I#I#@b" + ], + "ReferencedInReturnStmts": [ + "c:0070_b.cpp@8@F@foo#I#I#@a", + "c:@F@foo#I#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#I#": "c:@F@foo#I#I#" + } + }, + "_CG": { + "_Z3fooii": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0070_combined.gtaacg b/tools/cage/test/input/multiTU/0070_combined.gtaacg new file mode 100644 index 00000000..c3f7d99d --- /dev/null +++ b/tools/cage/test/input/multiTU/0070_combined.gtaacg @@ -0,0 +1,152 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@112-120", + "c:@F@foo#I#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0070_a.cpp@75@F@foo#I#I#@some_name", + "c:0070_b.cpp@8@F@foo#I#I#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#I#@UNNAMED_PARAM@1", + "c:0070_b.cpp@15@F@foo#I#I#@b" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooii" + ], + "Parameters": [ + "c:0070_a.cpp@75@F@foo#I#I#@some_name", + "c:@F@foo#I#I#@UNNAMED_PARAM@1" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#I#": "c:@F@foo#I#I#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3fooii": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooii" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooii": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0071_a.cpp b/tools/cage/test/input/multiTU/0071_a.cpp new file mode 100644 index 00000000..53577d6a --- /dev/null +++ b/tools/cage/test/input/multiTU/0071_a.cpp @@ -0,0 +1,10 @@ +// Test for handling function ptrs in a global variable across different TUs +void function() { int a = 1 + 2; } + +void* functionptr; + +int foo() { + void* var = (void*)&function; + functionptr = var; + return 1; +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0071_a.gtaacg b/tools/cage/test/input/multiTU/0071_a.gtaacg new file mode 100644 index 00000000..79d631e9 --- /dev/null +++ b/tools/cage/test/input/multiTU/0071_a.gtaacg @@ -0,0 +1,148 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@function#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0071_a.cpp@95@F@function#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@functionptr", + "c:0071_a.cpp@147@F@foo#@var", + "&c:@F@function#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@function#" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@function#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@F@function#": "c:@F@function#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@function#": "c:@F@function#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8functionv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0071_b.cpp b/tools/cage/test/input/multiTU/0071_b.cpp new file mode 100644 index 00000000..e562eb3e --- /dev/null +++ b/tools/cage/test/input/multiTU/0071_b.cpp @@ -0,0 +1,9 @@ + +extern void* functionptr; + +typedef void (*Ftype)(); + +int main() { + ((Ftype)functionptr)(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0071_b.gtaacg b/tools/cage/test/input/multiTU/0071_b.gtaacg new file mode 100644 index 00000000..dbfea801 --- /dev/null +++ b/tools/cage/test/input/multiTU/0071_b.gtaacg @@ -0,0 +1,96 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@69-90": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@69-90": { + "Arguments": [], + "CalledObjects": [ + "c:@functionptr" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@functionptr" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@69-90" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0071_combined.gtaacg b/tools/cage/test/input/multiTU/0071_combined.gtaacg new file mode 100644 index 00000000..ced3ff8a --- /dev/null +++ b/tools/cage/test/input/multiTU/0071_combined.gtaacg @@ -0,0 +1,215 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@69-90": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@69-90": { + "Arguments": [], + "CalledObjects": [ + "c:@functionptr" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@functionptr", + "c:0071_a.cpp@147@F@foo#@var", + "&c:@F@function#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@function#" + } + ] + }, + { + "Objects": [ + "c:0071_a.cpp@95@F@function#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@69-90", + "c:@F@function#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@function#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@F@function#": "c:@F@function#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@function#": "c:@F@function#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8functionv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8functionv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0072_a.cpp b/tools/cage/test/input/multiTU/0072_a.cpp new file mode 100644 index 00000000..805b076d --- /dev/null +++ b/tools/cage/test/input/multiTU/0072_a.cpp @@ -0,0 +1,22 @@ +/** + * Testcase for the multi TU imbalance integration test + */ +#define NULL 0 + +void get_func_ptr(void (**func)(), int i); + +void function_pointer_test() { + void (*r)() = NULL; + + get_func_ptr(&r, 0); + + r(); +} + +/** + * Main function + */ +int main(int argc, char** argv) { + function_pointer_test(); + return 0; +} diff --git a/tools/cage/test/input/multiTU/0072_a.gtaacg b/tools/cage/test/input/multiTU/0072_a.gtaacg new file mode 100644 index 00000000..527a13c7 --- /dev/null +++ b/tools/cage/test/input/multiTU/0072_a.gtaacg @@ -0,0 +1,252 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@function_pointer_test#@CALL_EXPR@@204-206": "c:@F@function_pointer_test#" + }, + "CallInfoMap": { + "c:@F@function_pointer_test#@CALL_EXPR@@204-206": { + "Arguments": [], + "CalledObjects": [ + "c:0072_a.cpp@157@F@function_pointer_test#@r" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func_ptr#**Fv()#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function_pointer_test#@CALL_EXPR@@204-206" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function_pointer_test#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@256@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@246@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@157@F@function_pointer_test#@r" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", + "&c:0072_a.cpp@157@F@function_pointer_test#@r" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0072_a.cpp@157@F@function_pointer_test#@r" + } + ] + }, + { + "Objects": [ + "c:@F@function_pointer_test#@CALL_EXPR@@180-198", + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@273-295", + "c:@F@function_pointer_test#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@function_pointer_test#": { + "IsVariadic": false, + "MangledNames": [ + "_Z21function_pointer_testv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@function_pointer_test#@SRETURN" + ] + }, + "c:@F@get_func_ptr#**Fv()#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z12get_func_ptrPPFvvEi" + ], + "Parameters": [ + "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", + "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0072_a.cpp@246@F@main#I#**C#@argc", + "c:0072_a.cpp@256@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@function_pointer_test#": "c:@F@function_pointer_test#", + "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z12get_func_ptrPPFvvEi": { + "callees": [], + "callers": [ + "_Z21function_pointer_testv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z21function_pointer_testv": { + "callees": [ + "_Z12get_func_ptrPPFvvEi" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z12get_func_ptrPPFvvEi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z21function_pointer_testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z21function_pointer_testv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0072_b.cpp b/tools/cage/test/input/multiTU/0072_b.cpp new file mode 100644 index 00000000..75032243 --- /dev/null +++ b/tools/cage/test/input/multiTU/0072_b.cpp @@ -0,0 +1,22 @@ +#define NULL 0 + +void func1(); +void func2(); + +void get_func_ptr(void (**func)(), int i) { + void (*r)() = NULL; + + switch (i) { + case 0: + r = func1; + break; + default: + r = func2; + } + + *func = r; +} + +void func1() {} + +void func2() {} diff --git a/tools/cage/test/input/multiTU/0072_b.gtaacg b/tools/cage/test/input/multiTU/0072_b.gtaacg new file mode 100644 index 00000000..c2039460 --- /dev/null +++ b/tools/cage/test/input/multiTU/0072_b.gtaacg @@ -0,0 +1,198 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func_ptr#**Fv()#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@func2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@func1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" + } + ] + }, + { + "Objects": [ + "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", + "c:0072_b.cpp@91@F@get_func_ptr#**Fv()#I#@r", + "c:@F@func1#", + "c:@F@func2#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@func1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func1#@SRETURN" + ] + }, + "c:@F@func2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func2#@SRETURN" + ] + }, + "c:@F@get_func_ptr#**Fv()#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z12get_func_ptrPPFvvEi" + ], + "Parameters": [ + "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", + "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@func1#": "c:@F@func1#", + "c:@F@func2#": "c:@F@func2#", + "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#" + } + }, + "_CG": { + "_Z12get_func_ptrPPFvvEi": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func2v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0072_combined.gtaacg b/tools/cage/test/input/multiTU/0072_combined.gtaacg new file mode 100644 index 00000000..568a3a46 --- /dev/null +++ b/tools/cage/test/input/multiTU/0072_combined.gtaacg @@ -0,0 +1,348 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@function_pointer_test#@CALL_EXPR@@204-206": "c:@F@function_pointer_test#" + }, + "CallInfoMap": { + "c:@F@function_pointer_test#@CALL_EXPR@@204-206": { + "Arguments": [], + "CalledObjects": [ + "c:0072_a.cpp@157@F@function_pointer_test#@r" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@273-295", + "c:@F@function_pointer_test#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function_pointer_test#@CALL_EXPR@@180-198", + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@246@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@256@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function_pointer_test#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func_ptr#**Fv()#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", + "&c:0072_a.cpp@157@F@function_pointer_test#@r", + "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:0072_a.cpp@157@F@function_pointer_test#@r" + } + ] + }, + { + "Objects": [ + "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", + "c:0072_b.cpp@91@F@get_func_ptr#**Fv()#I#@r", + "c:@F@func1#", + "c:@F@func2#", + "c:0072_a.cpp@157@F@function_pointer_test#@r" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i", + "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@function_pointer_test#@CALL_EXPR@@204-206", + "c:@F@func1#@SRETURN", + "c:@F@func2#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@func1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func1#@SRETURN" + ] + }, + "c:@F@func2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func2#@SRETURN" + ] + }, + "c:@F@function_pointer_test#": { + "IsVariadic": false, + "MangledNames": [ + "_Z21function_pointer_testv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@function_pointer_test#@SRETURN" + ] + }, + "c:@F@get_func_ptr#**Fv()#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z12get_func_ptrPPFvvEi" + ], + "Parameters": [ + "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", + "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@get_func_ptr#**Fv()#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0072_a.cpp@246@F@main#I#**C#@argc", + "c:0072_a.cpp@256@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@func1#": "c:@F@func1#", + "c:@F@func2#": "c:@F@func2#", + "c:@F@function_pointer_test#": "c:@F@function_pointer_test#", + "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z12get_func_ptrPPFvvEi": { + "callees": [], + "callers": [ + "_Z21function_pointer_testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z21function_pointer_testv": { + "callees": [ + "_Z12get_func_ptrPPFvvEi", + "_Z5func1v", + "_Z5func2v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z12get_func_ptrPPFvvEi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func1v": { + "callees": [], + "callers": [ + "_Z21function_pointer_testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func2v": { + "callees": [], + "callers": [ + "_Z21function_pointer_testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z21function_pointer_testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z21function_pointer_testv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0214_a.cpp b/tools/cage/test/input/multiTU/0214_a.cpp new file mode 100644 index 00000000..5e1d7378 --- /dev/null +++ b/tools/cage/test/input/multiTU/0214_a.cpp @@ -0,0 +1,11 @@ + +using func_t = void (*)(); +func_t g_foo; + +void call_foo(); +void foo() {} + +int main() { + g_foo = foo; + call_foo(); +} diff --git a/tools/cage/test/input/multiTU/0214_a.gtaacg b/tools/cage/test/input/multiTU/0214_a.gtaacg new file mode 100644 index 00000000..e4efe228 --- /dev/null +++ b/tools/cage/test/input/multiTU/0214_a.gtaacg @@ -0,0 +1,189 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@105-114", + "c:@F@call_foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@g_foo", + "c:@F@foo#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@call_foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8call_foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@call_foo#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@call_foo#": "c:@F@call_foo#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8call_foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8call_foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z8call_foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0214_b.cpp b/tools/cage/test/input/multiTU/0214_b.cpp new file mode 100644 index 00000000..b6f07806 --- /dev/null +++ b/tools/cage/test/input/multiTU/0214_b.cpp @@ -0,0 +1,5 @@ + +using func_t = void (*)(); +extern func_t g_foo; + +void call_foo() { g_foo(); } diff --git a/tools/cage/test/input/multiTU/0214_b.gtaacg b/tools/cage/test/input/multiTU/0214_b.gtaacg new file mode 100644 index 00000000..da1bc18c --- /dev/null +++ b/tools/cage/test/input/multiTU/0214_b.gtaacg @@ -0,0 +1,96 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@call_foo#@CALL_EXPR@@68-74": "c:@F@call_foo#" + }, + "CallInfoMap": { + "c:@F@call_foo#@CALL_EXPR@@68-74": { + "Arguments": [], + "CalledObjects": [ + "c:@g_foo" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@g_foo" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#@CALL_EXPR@@68-74" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@call_foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8call_foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@call_foo#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@call_foo#": "c:@F@call_foo#" + } + }, + "_CG": { + "_Z8call_foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0214_combined.gtaacg b/tools/cage/test/input/multiTU/0214_combined.gtaacg new file mode 100644 index 00000000..a69d8842 --- /dev/null +++ b/tools/cage/test/input/multiTU/0214_combined.gtaacg @@ -0,0 +1,203 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@call_foo#@CALL_EXPR@@68-74": "c:@F@call_foo#" + }, + "CallInfoMap": { + "c:@F@call_foo#@CALL_EXPR@@68-74": { + "Arguments": [], + "CalledObjects": [ + "c:@g_foo" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@g_foo", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@105-114", + "c:@F@call_foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@call_foo#@CALL_EXPR@@68-74", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@call_foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8call_foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@call_foo#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@call_foo#": "c:@F@call_foo#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "_Z8call_foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8call_foov": { + "callees": [ + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8call_foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z8call_foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0240_a.cpp b/tools/cage/test/input/multiTU/0240_a.cpp new file mode 100644 index 00000000..ecf2882b --- /dev/null +++ b/tools/cage/test/input/multiTU/0240_a.cpp @@ -0,0 +1,8 @@ +// Test for handling default args/ differing definitions accross translation units +extern void some_function(); +extern void some_other_function(); +using FType = decltype(some_function); + +void f(FType n = some_function, FType arg = some_other_function); + +void work() { f(); } diff --git a/tools/cage/test/input/multiTU/0240_a.gtaacg b/tools/cage/test/input/multiTU/0240_a.gtaacg new file mode 100644 index 00000000..bfa9ccf8 --- /dev/null +++ b/tools/cage/test/input/multiTU/0240_a.gtaacg @@ -0,0 +1,186 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@work#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@work#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@some_other_function#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@some_function#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", + "c:@F@some_function#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg", + "c:@F@some_other_function#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@work#@CALL_EXPR@@268-270", + "c:@F@f#*Fv()#S0_#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@f#*Fv()#S0_#": { + "IsVariadic": false, + "MangledNames": [ + "_Z1fPFvvES0_" + ], + "Parameters": [ + "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", + "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@f#*Fv()#S0_#@SRETURN" + ] + }, + "c:@F@some_function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z13some_functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@some_function#@SRETURN" + ] + }, + "c:@F@some_other_function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z19some_other_functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@some_other_function#@SRETURN" + ] + }, + "c:@F@work#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4workv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@work#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", + "c:@F@some_function#": "c:@F@some_function#", + "c:@F@some_other_function#": "c:@F@some_other_function#", + "c:@F@work#": "c:@F@work#" + } + }, + "_CG": { + "_Z1fPFvvES0_": { + "callees": [], + "callers": [ + "_Z4workv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4workv": { + "callees": [ + "_Z1fPFvvES0_" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z1fPFvvES0_": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0240_b.cpp b/tools/cage/test/input/multiTU/0240_b.cpp new file mode 100644 index 00000000..6ce5a00e --- /dev/null +++ b/tools/cage/test/input/multiTU/0240_b.cpp @@ -0,0 +1,19 @@ +extern void foo(); +extern void bar(); +using FType = decltype(foo); + +void f(FType n, FType k); +void f(FType n, FType k = bar); +void f(FType n = foo, FType k); + +void work(); + +int main() { + work(); + f(); +} + +void f(FType n, FType k) { + n(); + k(); +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0240_b.gtaacg b/tools/cage/test/input/multiTU/0240_b.gtaacg new file mode 100644 index 00000000..e87473af --- /dev/null +++ b/tools/cage/test/input/multiTU/0240_b.gtaacg @@ -0,0 +1,335 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": "c:@F@f#*Fv()#S0_#", + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": "c:@F@f#*Fv()#S0_#" + }, + "CallInfoMap": { + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": { + "Arguments": [], + "CalledObjects": [ + "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n" + ] + }, + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": { + "Arguments": [], + "CalledObjects": [ + "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@work#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@188-193", + "c:@F@work#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@198-200", + "c:@F@f#*Fv()#S0_#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244", + "c:@F@bar#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_b.cpp@133@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@101@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@75@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_b.cpp@148@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@110@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@84@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k", + "c:@F@bar#" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@f#*Fv()#S0_#": { + "IsVariadic": false, + "MangledNames": [ + "_Z1fPFvvES0_" + ], + "Parameters": [ + "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@f#*Fv()#S0_#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@work#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4workv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@work#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@F@work#": "c:@F@work#" + } + }, + "_CG": { + "_Z1fPFvvES0_": { + "callees": [ + "_Z3barv", + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3barv": { + "callees": [], + "callers": [ + "_Z1fPFvvES0_" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z1fPFvvES0_" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4workv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z1fPFvvES0_", + "_Z4workv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z1fPFvvES0_": 0, + "_Z4workv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0240_combined.gtaacg b/tools/cage/test/input/multiTU/0240_combined.gtaacg new file mode 100644 index 00000000..b1c7e342 --- /dev/null +++ b/tools/cage/test/input/multiTU/0240_combined.gtaacg @@ -0,0 +1,371 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": "c:@F@f#*Fv()#S0_#", + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": "c:@F@f#*Fv()#S0_#" + }, + "CallInfoMap": { + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": { + "Arguments": [], + "CalledObjects": [ + "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n" + ] + }, + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": { + "Arguments": [], + "CalledObjects": [ + "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#@SRETURN", + "c:@F@main#@CALL_EXPR@@198-200", + "c:@F@work#@CALL_EXPR@@268-270" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@work#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@188-193", + "c:@F@work#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", + "c:@F@some_function#", + "c:0240_b.cpp@133@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@101@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@75@F@f#*Fv()#S0_#@n", + "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg", + "c:@F@some_other_function#", + "c:0240_b.cpp@148@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@110@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@84@F@f#*Fv()#S0_#@k", + "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k", + "c:@F@bar#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237", + "c:@F@foo#@SRETURN", + "c:@F@some_function#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244", + "c:@F@bar#@SRETURN", + "c:@F@some_other_function#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@f#*Fv()#S0_#": { + "IsVariadic": false, + "MangledNames": [ + "_Z1fPFvvES0_" + ], + "Parameters": [ + "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", + "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@f#*Fv()#S0_#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@some_function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z13some_functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@some_function#@SRETURN" + ] + }, + "c:@F@some_other_function#": { + "IsVariadic": false, + "MangledNames": [ + "_Z19some_other_functionv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@some_other_function#@SRETURN" + ] + }, + "c:@F@work#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4workv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@work#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@F@some_function#": "c:@F@some_function#", + "c:@F@some_other_function#": "c:@F@some_other_function#", + "c:@F@work#": "c:@F@work#" + } + }, + "_CG": { + "_Z1fPFvvES0_": { + "callees": [ + "_Z13some_functionv", + "_Z19some_other_functionv", + "_Z3barv", + "_Z3foov" + ], + "callers": [ + "_Z4workv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3barv": { + "callees": [], + "callers": [ + "_Z1fPFvvES0_" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_Z1fPFvvES0_" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4workv": { + "callees": [ + "_Z1fPFvvES0_" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z1fPFvvES0_": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z1fPFvvES0_", + "_Z4workv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z1fPFvvES0_": 0, + "_Z4workv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0241_a.cpp b/tools/cage/test/input/multiTU/0241_a.cpp new file mode 100644 index 00000000..8dba1e91 --- /dev/null +++ b/tools/cage/test/input/multiTU/0241_a.cpp @@ -0,0 +1,42 @@ +// Test for handling a combination of function pointers and virtual classes across multiple TUs +extern void f1(); +extern void f2(); + +using Ftype = void(); + +struct Base { + virtual int foo() { + f = nullptr; + return 1; + } + Ftype* f; +}; + +struct Child1 : Base { + int foo() override { + f = f1; + return 2; + } +}; + +struct Child2 : Base { + int foo() override { + f = f2; + return 3; + } +}; + +void calc(Base* arg); + +int main() { + Base* b = new Base(); + bool test1 = true; + bool test2 = true; + if (test1) { + b = new Child1(); + } + if (test2) { + b = new Child2(); + } + calc(b); +} diff --git a/tools/cage/test/input/multiTU/0241_a.gtaacg b/tools/cage/test/input/multiTU/0241_a.gtaacg new file mode 100644 index 00000000..a8a649ae --- /dev/null +++ b/tools/cage/test/input/multiTU/0241_a.gtaacg @@ -0,0 +1,1352 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@S@Child2@F@~Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@~Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@~Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@486@F@main#@test2" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@465@F@main#@test1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@589-595", + "c:@F@calc#*$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@foo#@THIS", + "c:@S@Child1@F@foo#@THIS", + "c:@S@Base@F@foo#@THIS" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@Child2@F@foo#@THIS" + } + ] + }, + { + "Objects": [ + "*c:@S@Base@F@foo#@THIS", + "*c:@S@Child1@F@foo#@THIS", + "*c:@S@Child2@F@foo#@THIS" + ], + "Prefixes": [ + { + "Member": "c:@S@Base@FI@f", + "Object": "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f" + } + ] + }, + { + "Objects": [ + "c:@S@Child2@F@foo#@SRETURN", + "c:@S@Child1@F@foo#@SRETURN", + "c:@S@Base@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:@S@Child2@F@foo#@THIS).c:@S@Base@FI@f", + "(*c:@S@Child1@F@foo#@THIS).c:@S@Base@FI@f", + "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f", + "c:@S@Base@FI@f", + "c:@F@f1#", + "c:@F@f2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg", + "c:0241_a.cpp@441@F@main#@b", + "&c:@F@main#@NEW@451-460", + "&c:@F@main#@NEW@528-539", + "&c:@F@main#@NEW@569-580" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@NEW@451-460" + } + ] + }, + { + "Objects": [ + "c:@F@main#@NEW@569-580", + "c:@F@main#@NEW@528-539", + "c:@F@main#@NEW@451-460", + "c:@F@main#@CALL_EXPR@@455-460", + "c:@F@main#@CALL_EXPR@@532-539", + "c:@F@main#@CALL_EXPR@@573-580", + "c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", + "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#@THIS", + "c:@S@Child1@F@Child1#@THIS", + "c:@S@Base@F@Base#@THIS", + "&c:@S@Child1@F@Child1#@CALL_EXPR@@250-250", + "&c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", + "&c:@F@main#@CALL_EXPR@@455-460", + "&c:@F@main#@CALL_EXPR@@532-539", + "&c:@F@main#@CALL_EXPR@@573-580" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@calc#*$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4calcP4Base" + ], + "Parameters": [ + "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@calc#*$@S@Base#@SRETURN" + ] + }, + "c:@F@f1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@f1#@SRETURN" + ] + }, + "c:@F@f2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@f2#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@operator delete#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdlPv" + ], + "Parameters": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete#*v#@SRETURN" + ] + }, + "c:@F@operator delete[]#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdaPv" + ], + "Parameters": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete[]#*v#@SRETURN" + ] + }, + "c:@F@operator new#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znwm" + ], + "Parameters": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new#l#@SRETURN" + ] + }, + "c:@F@operator new[]#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znam" + ], + "Parameters": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new[]#l#@SRETURN" + ] + }, + "c:@S@Base@F@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2Ev", + "_ZN4BaseC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@Base#&&$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2EOS_", + "_ZN4BaseC1EOS_" + ], + "Parameters": [ + "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@Base#&1$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2ERKS_", + "_ZN4BaseC1ERKS_" + ], + "Parameters": [ + "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4Base3fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@foo#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&&$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSEOS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&1$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSERKS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@~Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseD2Ev", + "_ZN4BaseD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2Ev", + "_ZN6Child1C1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#&&$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2EOS_", + "_ZN6Child1C1EOS_" + ], + "Parameters": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#&1$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2ERKS_", + "_ZN6Child1C1ERKS_" + ], + "Parameters": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child13fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@foo#@SRETURN" + ] + }, + "c:@S@Child1@F@operator=#&&$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1aSEOS_" + ], + "Parameters": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" + ] + }, + "c:@S@Child1@F@operator=#&1$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1aSERKS_" + ], + "Parameters": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" + ] + }, + "c:@S@Child1@F@~Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1D2Ev", + "_ZN6Child1D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2Ev", + "_ZN6Child2C1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#&&$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2EOS_", + "_ZN6Child2C1EOS_" + ], + "Parameters": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#&1$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2ERKS_", + "_ZN6Child2C1ERKS_" + ], + "Parameters": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child23fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@foo#@SRETURN" + ] + }, + "c:@S@Child2@F@operator=#&&$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2aSEOS_" + ], + "Parameters": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" + ] + }, + "c:@S@Child2@F@operator=#&1$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2aSERKS_" + ], + "Parameters": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" + ] + }, + "c:@S@Child2@F@~Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2D2Ev", + "_ZN6Child2D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", + "c:@F@f1#": "c:@F@f1#", + "c:@F@f2#": "c:@F@f2#", + "c:@F@main#": "c:@F@main#", + "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", + "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", + "c:@F@operator new#l#": "c:@F@operator new#l#", + "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", + "c:@S@Base@F@Base#": "c:@S@Base@F@Base#", + "c:@S@Base@F@Base#&&$@S@Base#": "c:@S@Base@F@Base#&&$@S@Base#", + "c:@S@Base@F@Base#&1$@S@Base#": "c:@S@Base@F@Base#&1$@S@Base#", + "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", + "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", + "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", + "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#", + "c:@S@Child1@F@Child1#": "c:@S@Child1@F@Child1#", + "c:@S@Child1@F@Child1#&&$@S@Child1#": "c:@S@Child1@F@Child1#&&$@S@Child1#", + "c:@S@Child1@F@Child1#&1$@S@Child1#": "c:@S@Child1@F@Child1#&1$@S@Child1#", + "c:@S@Child1@F@foo#": "c:@S@Child1@F@foo#", + "c:@S@Child1@F@operator=#&&$@S@Child1#": "c:@S@Child1@F@operator=#&&$@S@Child1#", + "c:@S@Child1@F@operator=#&1$@S@Child1#": "c:@S@Child1@F@operator=#&1$@S@Child1#", + "c:@S@Child1@F@~Child1#": "c:@S@Child1@F@~Child1#", + "c:@S@Child2@F@Child2#": "c:@S@Child2@F@Child2#", + "c:@S@Child2@F@Child2#&&$@S@Child2#": "c:@S@Child2@F@Child2#&&$@S@Child2#", + "c:@S@Child2@F@Child2#&1$@S@Child2#": "c:@S@Child2@F@Child2#&1$@S@Child2#", + "c:@S@Child2@F@foo#": "c:@S@Child2@F@foo#", + "c:@S@Child2@F@operator=#&&$@S@Child2#": "c:@S@Child2@F@operator=#&&$@S@Child2#", + "c:@S@Child2@F@operator=#&1$@S@Child2#": "c:@S@Child2@F@operator=#&1$@S@Child2#", + "c:@S@Child2@F@~Child2#": "c:@S@Child2@F@~Child2#" + } + }, + "_CG": { + "_Z4calcP4Base": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4Base3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [ + "_ZN6Child13fooEv", + "_ZN6Child23fooEv" + ], + "overrides": [] + }, + "_ZN4BaseC1Ev": { + "callees": [], + "callers": [ + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseC2Ev": { + "callees": [], + "callers": [ + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child13fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [ + "_ZN4Base3fooEv" + ] + }, + "_ZN6Child1C1Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child1C2Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child23fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [ + "_ZN4Base3fooEv" + ] + }, + "_ZN6Child2C1Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child2C2Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4calcP4Base", + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev", + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4calcP4Base": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 12, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0241_b.cpp b/tools/cage/test/input/multiTU/0241_b.cpp new file mode 100644 index 00000000..d2a53a58 --- /dev/null +++ b/tools/cage/test/input/multiTU/0241_b.cpp @@ -0,0 +1,12 @@ +using Ftype = void(); + +struct Base { + virtual int foo(); + Ftype* f; +}; + +void calc(Base* arg) { + //(*arg).foo(); + arg->foo(); + arg->f(); +} diff --git a/tools/cage/test/input/multiTU/0241_b.gtaacg b/tools/cage/test/input/multiTU/0241_b.gtaacg new file mode 100644 index 00000000..d43f6b1d --- /dev/null +++ b/tools/cage/test/input/multiTU/0241_b.gtaacg @@ -0,0 +1,289 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": "c:@F@calc#*$@S@Base#" + }, + "CallInfoMap": { + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": { + "Arguments": [], + "CalledObjects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@Base@F@~Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" + ], + "Prefixes": [ + { + "Member": "c:@S@Base@F@foo#", + "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#" + }, + { + "Member": "c:@S@Base@FI@f", + "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" + } + ] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#@CALL_EXPR@@117-126", + "c:@S@Base@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#", + "c:@S@Base@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f", + "c:@S@Base@FI@f" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@foo#@THIS", + "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@calc#*$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4calcP4Base" + ], + "Parameters": [ + "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@calc#*$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4Base3fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@foo#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&&$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSEOS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&1$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSERKS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@~Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseD2Ev", + "_ZN4BaseD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", + "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", + "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", + "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", + "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#" + } + }, + "_CG": { + "_Z4calcP4Base": { + "callees": [ + "_ZN4Base3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN4Base3fooEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4Base3fooEv": { + "callees": [], + "callers": [ + "_Z4calcP4Base" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/multiTU/0241_combined.gtaacg b/tools/cage/test/input/multiTU/0241_combined.gtaacg new file mode 100644 index 00000000..c62e0f99 --- /dev/null +++ b/tools/cage/test/input/multiTU/0241_combined.gtaacg @@ -0,0 +1,1359 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": "c:@F@calc#*$@S@Base#" + }, + "CallInfoMap": { + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": { + "Arguments": [], + "CalledObjects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@Child2@F@Child2#@THIS", + "c:@S@Child1@F@Child1#@THIS", + "c:@S@Base@F@Base#@THIS", + "&c:@S@Child1@F@Child1#@CALL_EXPR@@250-250", + "&c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", + "&c:@F@main#@CALL_EXPR@@455-460", + "&c:@F@main#@CALL_EXPR@@532-539", + "&c:@F@main#@CALL_EXPR@@573-580" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" + } + ] + }, + { + "Objects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f", + "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f", + "(*c:@S@Child1@F@foo#@THIS).c:@S@Base@FI@f", + "(*c:@S@Child2@F@foo#@THIS).c:@S@Base@FI@f", + "c:@F@f1#", + "c:@F@f2#", + "c:@S@Base@FI@f" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#@CALL_EXPR@@117-126", + "c:@S@Base@F@foo#@SRETURN", + "c:@S@Child1@F@foo#@SRETURN", + "c:@S@Child2@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@589-595", + "c:@F@calc#*$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@465@F@main#@test1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@486@F@main#@test2" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#", + "c:@S@Base@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Base@F@~Base#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child1@F@~Child1#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@~Child2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@~Child2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@Child2@F@~Child2#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg", + "c:0241_a.cpp@441@F@main#@b", + "&c:@F@main#@NEW@451-460", + "&c:@F@main#@NEW@528-539", + "&c:@F@main#@NEW@569-580", + "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg", + "c:@S@Base@F@foo#@THIS", + "c:@S@Child1@F@foo#@THIS", + "c:@S@Child2@F@foo#@THIS" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@NEW@451-460" + } + ] + }, + { + "Objects": [ + "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg", + "*c:@S@Base@F@foo#@THIS", + "*c:@S@Child1@F@foo#@THIS", + "*c:@S@Child2@F@foo#@THIS", + "c:@F@main#@NEW@569-580", + "c:@F@main#@NEW@528-539", + "c:@F@main#@NEW@451-460", + "c:@F@main#@CALL_EXPR@@455-460", + "c:@F@main#@CALL_EXPR@@532-539", + "c:@F@main#@CALL_EXPR@@573-580", + "c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", + "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" + ], + "Prefixes": [ + { + "Member": "c:@S@Base@F@foo#", + "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#" + }, + { + "Member": "c:@S@Base@FI@f", + "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" + } + ] + }, + { + "Objects": [ + "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138", + "c:@F@f1#@SRETURN", + "c:@F@f2#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@calc#*$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4calcP4Base" + ], + "Parameters": [ + "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@calc#*$@S@Base#@SRETURN" + ] + }, + "c:@F@f1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@f1#@SRETURN" + ] + }, + "c:@F@f2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z2f2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@f2#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@operator delete#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdlPv" + ], + "Parameters": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete#*v#@SRETURN" + ] + }, + "c:@F@operator delete[]#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdaPv" + ], + "Parameters": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete[]#*v#@SRETURN" + ] + }, + "c:@F@operator new#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znwm" + ], + "Parameters": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new#l#@SRETURN" + ] + }, + "c:@F@operator new[]#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znam" + ], + "Parameters": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new[]#l#@SRETURN" + ] + }, + "c:@S@Base@F@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2Ev", + "_ZN4BaseC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@Base#&&$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2EOS_", + "_ZN4BaseC1EOS_" + ], + "Parameters": [ + "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@Base#&1$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseC2ERKS_", + "_ZN4BaseC1ERKS_" + ], + "Parameters": [ + "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Base@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4Base3fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@foo#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&&$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSEOS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@operator=#&1$@S@Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseaSERKS_" + ], + "Parameters": [ + "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" + ] + }, + "c:@S@Base@F@~Base#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN4BaseD2Ev", + "_ZN4BaseD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2Ev", + "_ZN6Child1C1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#&&$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2EOS_", + "_ZN6Child1C1EOS_" + ], + "Parameters": [ + "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@Child1#&1$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1C2ERKS_", + "_ZN6Child1C1ERKS_" + ], + "Parameters": [ + "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child1@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child13fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@foo#@SRETURN" + ] + }, + "c:@S@Child1@F@operator=#&&$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1aSEOS_" + ], + "Parameters": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" + ] + }, + "c:@S@Child1@F@operator=#&1$@S@Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1aSERKS_" + ], + "Parameters": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" + ] + }, + "c:@S@Child1@F@~Child1#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child1D2Ev", + "_ZN6Child1D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2Ev", + "_ZN6Child2C1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#&&$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2EOS_", + "_ZN6Child2C1EOS_" + ], + "Parameters": [ + "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@Child2#&1$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2C2ERKS_", + "_ZN6Child2C1ERKS_" + ], + "Parameters": [ + "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@Child2@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child23fooEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@foo#@SRETURN" + ] + }, + "c:@S@Child2@F@operator=#&&$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2aSEOS_" + ], + "Parameters": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" + ] + }, + "c:@S@Child2@F@operator=#&1$@S@Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2aSERKS_" + ], + "Parameters": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" + ] + }, + "c:@S@Child2@F@~Child2#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN6Child2D2Ev", + "_ZN6Child2D1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", + "c:@F@f1#": "c:@F@f1#", + "c:@F@f2#": "c:@F@f2#", + "c:@F@main#": "c:@F@main#", + "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", + "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", + "c:@F@operator new#l#": "c:@F@operator new#l#", + "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", + "c:@S@Base@F@Base#": "c:@S@Base@F@Base#", + "c:@S@Base@F@Base#&&$@S@Base#": "c:@S@Base@F@Base#&&$@S@Base#", + "c:@S@Base@F@Base#&1$@S@Base#": "c:@S@Base@F@Base#&1$@S@Base#", + "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", + "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", + "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", + "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#", + "c:@S@Child1@F@Child1#": "c:@S@Child1@F@Child1#", + "c:@S@Child1@F@Child1#&&$@S@Child1#": "c:@S@Child1@F@Child1#&&$@S@Child1#", + "c:@S@Child1@F@Child1#&1$@S@Child1#": "c:@S@Child1@F@Child1#&1$@S@Child1#", + "c:@S@Child1@F@foo#": "c:@S@Child1@F@foo#", + "c:@S@Child1@F@operator=#&&$@S@Child1#": "c:@S@Child1@F@operator=#&&$@S@Child1#", + "c:@S@Child1@F@operator=#&1$@S@Child1#": "c:@S@Child1@F@operator=#&1$@S@Child1#", + "c:@S@Child1@F@~Child1#": "c:@S@Child1@F@~Child1#", + "c:@S@Child2@F@Child2#": "c:@S@Child2@F@Child2#", + "c:@S@Child2@F@Child2#&&$@S@Child2#": "c:@S@Child2@F@Child2#&&$@S@Child2#", + "c:@S@Child2@F@Child2#&1$@S@Child2#": "c:@S@Child2@F@Child2#&1$@S@Child2#", + "c:@S@Child2@F@foo#": "c:@S@Child2@F@foo#", + "c:@S@Child2@F@operator=#&&$@S@Child2#": "c:@S@Child2@F@operator=#&&$@S@Child2#", + "c:@S@Child2@F@operator=#&1$@S@Child2#": "c:@S@Child2@F@operator=#&1$@S@Child2#", + "c:@S@Child2@F@~Child2#": "c:@S@Child2@F@~Child2#" + } + }, + "_CG": { + "_Z4calcP4Base": { + "callees": [ + "_Z2f1v", + "_Z2f2v", + "_ZN4Base3fooEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN4Base3fooEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4Base3fooEv": { + "callees": [], + "callers": [ + "_Z4calcP4Base" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [ + "_ZN6Child13fooEv", + "_ZN6Child23fooEv" + ], + "overrides": [] + }, + "_ZN4BaseC1Ev": { + "callees": [], + "callers": [ + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN4BaseC2Ev": { + "callees": [], + "callers": [ + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child13fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [ + "_ZN4Base3fooEv" + ] + }, + "_ZN6Child1C1Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child1C2Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child23fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [ + "_ZN4Base3fooEv" + ] + }, + "_ZN6Child2C1Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN6Child2C2Ev": { + "callees": [ + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4calcP4Base", + "_ZN4BaseC1Ev", + "_ZN4BaseC2Ev", + "_ZN6Child1C1Ev", + "_ZN6Child1C2Ev", + "_ZN6Child2C1Ev", + "_ZN6Child2C2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z4calcP4Base": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 12, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0001.cpp b/tools/cage/test/input/singleTU/0001.cpp new file mode 100644 index 00000000..8e13b917 --- /dev/null +++ b/tools/cage/test/input/singleTU/0001.cpp @@ -0,0 +1,3 @@ +// no calls at all + +int main(int argc, char* argv[]) { return 0; } diff --git a/tools/cage/test/input/singleTU/0001.gtaacg b/tools/cage/test/input/singleTU/0001.gtaacg new file mode 100644 index 00000000..7f3010a8 --- /dev/null +++ b/tools/cage/test/input/singleTU/0001.gtaacg @@ -0,0 +1,90 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0001.cpp@39@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0001.cpp@29@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0001.cpp@29@F@main#I#**C#@argc", + "c:0001.cpp@39@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0001.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0001.gtipcg b/tools/cage/test/input/singleTU/0001.gtipcg new file mode 100644 index 00000000..eac296b2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0001.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0001.gtmcg b/tools/cage/test/input/singleTU/0001.gtmcg new file mode 100644 index 00000000..aaaa518f --- /dev/null +++ b/tools/cage/test/input/singleTU/0001.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0001.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0002.cpp b/tools/cage/test/input/singleTU/0002.cpp new file mode 100644 index 00000000..6ad0a08d --- /dev/null +++ b/tools/cage/test/input/singleTU/0002.cpp @@ -0,0 +1,8 @@ +// one call to foo + +void foo() {} + +int main(int argc, char* argv[]) { + foo(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0002.gtaacg b/tools/cage/test/input/singleTU/0002.gtaacg new file mode 100644 index 00000000..4c494421 --- /dev/null +++ b/tools/cage/test/input/singleTU/0002.gtaacg @@ -0,0 +1,150 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0002.cpp@54@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0002.cpp@44@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@72-76", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0002.cpp@44@F@main#I#**C#@argc", + "c:0002.cpp@54@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0002.gtipcg b/tools/cage/test/input/singleTU/0002.gtipcg new file mode 100644 index 00000000..d03fe785 --- /dev/null +++ b/tools/cage/test/input/singleTU/0002.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0002.gtmcg b/tools/cage/test/input/singleTU/0002.gtmcg new file mode 100644 index 00000000..e054fd42 --- /dev/null +++ b/tools/cage/test/input/singleTU/0002.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0003.cpp b/tools/cage/test/input/singleTU/0003.cpp new file mode 100644 index 00000000..c226eab9 --- /dev/null +++ b/tools/cage/test/input/singleTU/0003.cpp @@ -0,0 +1,10 @@ +// main -> foo -> bar + +int bar() { return 42; } + +int foo() { return bar(); } + +int main(int argc, char* argv[]) { + foo(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0003.gtaacg b/tools/cage/test/input/singleTU/0003.gtaacg new file mode 100644 index 00000000..fe6222ef --- /dev/null +++ b/tools/cage/test/input/singleTU/0003.gtaacg @@ -0,0 +1,206 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@bar#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0003.cpp@97@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0003.cpp@87@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@115-119", + "c:@F@foo#@CALL_EXPR@@68-72", + "c:@F@bar#@SRETURN", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@bar#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3barv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@bar#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@CALL_EXPR@@68-72", + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0003.cpp@87@F@main#I#**C#@argc", + "c:0003.cpp@97@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@bar#": "c:@F@bar#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [ + "_Z3barv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3barv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0003.gtipcg b/tools/cage/test/input/singleTU/0003.gtipcg new file mode 100644 index 00000000..9a92c025 --- /dev/null +++ b/tools/cage/test/input/singleTU/0003.gtipcg @@ -0,0 +1,40 @@ +{ + "_Z3barv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z3foov" + ] + }, + "_Z3foov": { + "callees": [ + "_Z3barv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0003.gtmcg b/tools/cage/test/input/singleTU/0003.gtmcg new file mode 100644 index 00000000..a8c50890 --- /dev/null +++ b/tools/cage/test/input/singleTU/0003.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_Z3barv": { + "callees": [], + "callers": [ + "_Z3foov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [ + "_Z3barv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0004.cpp b/tools/cage/test/input/singleTU/0004.cpp new file mode 100644 index 00000000..772eeeb3 --- /dev/null +++ b/tools/cage/test/input/singleTU/0004.cpp @@ -0,0 +1,12 @@ +// no call +// but a second function + +int foo() { + int a = 0; + for (int i = 0; i < 5; ++i) { + a += 2; + } + return a; +} + +int main(int argc, char* argv[]) { return 0; } diff --git a/tools/cage/test/input/singleTU/0004.gtaacg b/tools/cage/test/input/singleTU/0004.gtaacg new file mode 100644 index 00000000..44cfc3ad --- /dev/null +++ b/tools/cage/test/input/singleTU/0004.gtaacg @@ -0,0 +1,156 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0004.cpp@69@F@foo#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0004.cpp@51@F@foo#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0004.cpp@144@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0004.cpp@134@F@main#I#**C#@argc" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:0004.cpp@51@F@foo#@a", + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0004.cpp@134@F@main#I#**C#@argc", + "c:0004.cpp@144@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 7, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0004.gtipcg b/tools/cage/test/input/singleTU/0004.gtipcg new file mode 100644 index 00000000..3cec1ddc --- /dev/null +++ b/tools/cage/test/input/singleTU/0004.gtipcg @@ -0,0 +1,22 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0004.gtmcg b/tools/cage/test/input/singleTU/0004.gtmcg new file mode 100644 index 00000000..b1bb139f --- /dev/null +++ b/tools/cage/test/input/singleTU/0004.gtmcg @@ -0,0 +1,44 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0005.cpp b/tools/cage/test/input/singleTU/0005.cpp new file mode 100644 index 00000000..0b96b936 --- /dev/null +++ b/tools/cage/test/input/singleTU/0005.cpp @@ -0,0 +1,11 @@ +// two functions called independently from main + +void childOne() {} +void childTwo() {} + +int main(int argc, char* argv[]) { + childOne(); + childTwo(); + + return 0; +} diff --git a/tools/cage/test/input/singleTU/0005.gtaacg b/tools/cage/test/input/singleTU/0005.gtaacg new file mode 100644 index 00000000..91bd13d0 --- /dev/null +++ b/tools/cage/test/input/singleTU/0005.gtaacg @@ -0,0 +1,208 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@childTwo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@childOne#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0005.cpp@97@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0005.cpp@107@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@125-134", + "c:@F@childOne#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@139-148", + "c:@F@childTwo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@childOne#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8childOnev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@childOne#@SRETURN" + ] + }, + "c:@F@childTwo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z8childTwov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@childTwo#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0005.cpp@97@F@main#I#**C#@argc", + "c:0005.cpp@107@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@childOne#": "c:@F@childOne#", + "c:@F@childTwo#": "c:@F@childTwo#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z8childOnev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8childTwov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8childOnev", + "_Z8childTwov" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z8childOnev": 0, + "_Z8childTwov": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0005.gtipcg b/tools/cage/test/input/singleTU/0005.gtipcg new file mode 100644 index 00000000..74604dad --- /dev/null +++ b/tools/cage/test/input/singleTU/0005.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z8childOnev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z8childTwov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z8childOnev", + "_Z8childTwov" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0005.gtmcg b/tools/cage/test/input/singleTU/0005.gtmcg new file mode 100644 index 00000000..50bad406 --- /dev/null +++ b/tools/cage/test/input/singleTU/0005.gtmcg @@ -0,0 +1,67 @@ +{ + "_CG": { + "_Z8childOnev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z8childTwov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8childTwov", + "_Z8childOnev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0013.cpp b/tools/cage/test/input/singleTU/0013.cpp new file mode 100644 index 00000000..4edfb4bc --- /dev/null +++ b/tools/cage/test/input/singleTU/0013.cpp @@ -0,0 +1,12 @@ +// call to multiple functions + +int lastChild() { return 1; } + +int middle() { return lastChild(); } + +int middle2() { return lastChild(); } + +int main(int argc, char* argv[]) { + middle(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0013.gtaacg b/tools/cage/test/input/singleTU/0013.gtaacg new file mode 100644 index 00000000..80d2380b --- /dev/null +++ b/tools/cage/test/input/singleTU/0013.gtaacg @@ -0,0 +1,266 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@middle2#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@middle2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@middle#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@lastChild#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0013.cpp@158@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0013.cpp@148@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@176-183", + "c:@F@middle2#@CALL_EXPR@@123-133", + "c:@F@middle#@CALL_EXPR@@84-94", + "c:@F@lastChild#@SRETURN", + "c:@F@middle#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@lastChild#": { + "IsVariadic": false, + "MangledNames": [ + "_Z9lastChildv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@lastChild#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0013.cpp@148@F@main#I#**C#@argc", + "c:0013.cpp@158@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + }, + "c:@F@middle#": { + "IsVariadic": false, + "MangledNames": [ + "_Z6middlev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@middle#@CALL_EXPR@@84-94", + "c:@F@middle#@SRETURN" + ] + }, + "c:@F@middle2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z7middle2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@middle2#@CALL_EXPR@@123-133", + "c:@F@middle2#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@lastChild#": "c:@F@lastChild#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#", + "c:@F@middle#": "c:@F@middle#", + "c:@F@middle2#": "c:@F@middle2#" + } + }, + "_CG": { + "_Z6middlev": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z9lastChildv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z9lastChildv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9lastChildv": { + "callees": [], + "callers": [ + "_Z6middlev", + "_Z7middle2v" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z6middlev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z6middlev": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0013.gtipcg b/tools/cage/test/input/singleTU/0013.gtipcg new file mode 100644 index 00000000..860a536d --- /dev/null +++ b/tools/cage/test/input/singleTU/0013.gtipcg @@ -0,0 +1,53 @@ +{ + "_Z6middlev": { + "callees": [ + "_Z9lastChildv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z9lastChildv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z6middlev", + "_Z7middle2v" + ] + }, + "main": { + "callees": [ + "_Z6middlev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0013.gtmcg b/tools/cage/test/input/singleTU/0013.gtmcg new file mode 100644 index 00000000..6ab88d0a --- /dev/null +++ b/tools/cage/test/input/singleTU/0013.gtmcg @@ -0,0 +1,87 @@ +{ + "_CG": { + "_Z6middlev": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9lastChildv": { + "callees": [], + "callers": [ + "_Z7middle2v", + "_Z6middlev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z6middlev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0014.cpp b/tools/cage/test/input/singleTU/0014.cpp new file mode 100644 index 00000000..f62de2b2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0014.cpp @@ -0,0 +1,13 @@ +// call to multiple functions + +int lastChild() { return 1; } + +int middle2() { return lastChild(); } + +int middle() { return middle2(); } + +int main(int argc, char* argv[]) { + middle(); + lastChild(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0014.gtaacg b/tools/cage/test/input/singleTU/0014.gtaacg new file mode 100644 index 00000000..fea1ab80 --- /dev/null +++ b/tools/cage/test/input/singleTU/0014.gtaacg @@ -0,0 +1,266 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@middle2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@middle#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@lastChild#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0014.cpp@156@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0014.cpp@146@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@186-196", + "c:@F@main#I#**C#@CALL_EXPR@@174-181", + "c:@F@middle#@CALL_EXPR@@123-131", + "c:@F@middle2#@CALL_EXPR@@85-95", + "c:@F@lastChild#@SRETURN", + "c:@F@middle2#@SRETURN", + "c:@F@middle#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@lastChild#": { + "IsVariadic": false, + "MangledNames": [ + "_Z9lastChildv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@lastChild#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0014.cpp@146@F@main#I#**C#@argc", + "c:0014.cpp@156@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + }, + "c:@F@middle#": { + "IsVariadic": false, + "MangledNames": [ + "_Z6middlev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@middle#@CALL_EXPR@@123-131", + "c:@F@middle#@SRETURN" + ] + }, + "c:@F@middle2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z7middle2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@middle2#@CALL_EXPR@@85-95", + "c:@F@middle2#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@lastChild#": "c:@F@lastChild#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#", + "c:@F@middle#": "c:@F@middle#", + "c:@F@middle2#": "c:@F@middle2#" + } + }, + "_CG": { + "_Z6middlev": { + "callees": [ + "_Z7middle2v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z7middle2v": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [ + "_Z6middlev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z9lastChildv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9lastChildv": { + "callees": [], + "callers": [ + "_Z7middle2v", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z6middlev", + "_Z9lastChildv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z6middlev": 0, + "_Z9lastChildv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0014.gtipcg b/tools/cage/test/input/singleTU/0014.gtipcg new file mode 100644 index 00000000..24087f4b --- /dev/null +++ b/tools/cage/test/input/singleTU/0014.gtipcg @@ -0,0 +1,56 @@ +{ + "_Z6middlev": { + "callees": [ + "_Z7middle2v" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z6middlev" + ] + }, + "_Z9lastChildv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z7middle2v", + "main" + ] + }, + "main": { + "callees": [ + "_Z6middlev", + "_Z9lastChildv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0014.gtmcg b/tools/cage/test/input/singleTU/0014.gtmcg new file mode 100644 index 00000000..1fac27ec --- /dev/null +++ b/tools/cage/test/input/singleTU/0014.gtmcg @@ -0,0 +1,90 @@ +{ + "_CG": { + "_Z6middlev": { + "callees": [ + "_Z7middle2v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z7middle2v": { + "callees": [ + "_Z9lastChildv" + ], + "callers": [ + "_Z6middlev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z9lastChildv": { + "callees": [], + "callers": [ + "main", + "_Z7middle2v" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z9lastChildv", + "_Z6middlev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0022.cpp b/tools/cage/test/input/singleTU/0022.cpp new file mode 100644 index 00000000..961ef2ef --- /dev/null +++ b/tools/cage/test/input/singleTU/0022.cpp @@ -0,0 +1,10 @@ + + +int main(int argc, char** argv) { + int a = 2; + int b = 2; + + int k = a * b; + + return 0; +} diff --git a/tools/cage/test/input/singleTU/0022.gtaacg b/tools/cage/test/input/singleTU/0022.gtaacg new file mode 100644 index 00000000..cd899b15 --- /dev/null +++ b/tools/cage/test/input/singleTU/0022.gtaacg @@ -0,0 +1,103 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0022.cpp@51@F@main#I#**C#@b" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0022.cpp@21@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0022.cpp@11@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0022.cpp@65@F@main#I#**C#@k", + "c:0022.cpp@38@F@main#I#**C#@a" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0022.cpp@11@F@main#I#**C#@argc", + "c:0022.cpp@21@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 5 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0022.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0022.gtipcg b/tools/cage/test/input/singleTU/0022.gtipcg new file mode 100644 index 00000000..f055fa7b --- /dev/null +++ b/tools/cage/test/input/singleTU/0022.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0022.gtmcg b/tools/cage/test/input/singleTU/0022.gtmcg new file mode 100644 index 00000000..6cd9a3cc --- /dev/null +++ b/tools/cage/test/input/singleTU/0022.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0022.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0063.cpp b/tools/cage/test/input/singleTU/0063.cpp new file mode 100644 index 00000000..b391d8e8 --- /dev/null +++ b/tools/cage/test/input/singleTU/0063.cpp @@ -0,0 +1,3 @@ +// This test is for checking that the Alias Analysis does not assume that __status and __arg are parameters to on_exit +// Tests function types in a parameter +extern int on_exit(void (*__func)(int __status, void* __arg), void* __arg); \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0063.gtaacg b/tools/cage/test/input/singleTU/0063.gtaacg new file mode 100644 index 00000000..c774a245 --- /dev/null +++ b/tools/cage/test/input/singleTU/0063.gtaacg @@ -0,0 +1,59 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@on_exit#*Fv(#I#*v)#S2_#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@on_exit#*Fv(#I#*v)#S2_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0063.cpp@220@F@on_exit#*Fv(#I#*v)#S2_#@__arg" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0063.cpp@177@F@on_exit#*Fv(#I#*v)#S2_#@__func" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@on_exit#*Fv(#I#*v)#S2_#": { + "IsVariadic": false, + "MangledNames": [ + "_Z7on_exitPFviPvES_" + ], + "Parameters": [ + "c:0063.cpp@177@F@on_exit#*Fv(#I#*v)#S2_#@__func", + "c:0063.cpp@220@F@on_exit#*Fv(#I#*v)#S2_#@__arg" + ], + "ReferencedInReturnStmts": [ + "c:@F@on_exit#*Fv(#I#*v)#S2_#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@on_exit#*Fv(#I#*v)#S2_#": "c:@F@on_exit#*Fv(#I#*v)#S2_#" + } + }, + "_CG": null, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0063.gtipcg b/tools/cage/test/input/singleTU/0063.gtipcg new file mode 100644 index 00000000..19765bd5 --- /dev/null +++ b/tools/cage/test/input/singleTU/0063.gtipcg @@ -0,0 +1 @@ +null diff --git a/tools/cage/test/input/singleTU/0063.gtmcg b/tools/cage/test/input/singleTU/0063.gtmcg new file mode 100644 index 00000000..d67afea2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0063.gtmcg @@ -0,0 +1,11 @@ +{ + "_CG": null, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "9a42ed575dd43d75255b74cbfccb686af3e70e8b", + "version": "0.3" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0065.cpp b/tools/cage/test/input/singleTU/0065.cpp new file mode 100644 index 00000000..cd4a508d --- /dev/null +++ b/tools/cage/test/input/singleTU/0065.cpp @@ -0,0 +1,27 @@ +/** + * Testcase for a missing call in the load imbalance integration test + */ + +typedef void (*Fn)(); + +void func1() {} + +void func2() {} + +Fn get_func_ptr(int i) { + if (i == 0) { + return func1; + } else { + return func2; + } +} + +/** + * Main function + */ +int main(int argc, char** argv) { + // function pointer test + Fn func = get_func_ptr(0); + func(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0065.gtaacg b/tools/cage/test/input/singleTU/0065.gtaacg new file mode 100644 index 00000000..4399889f --- /dev/null +++ b/tools/cage/test/input/singleTU/0065.gtaacg @@ -0,0 +1,269 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#I#**C#@CALL_EXPR@@348-353": "c:@F@main#I#**C#" + }, + "CallInfoMap": { + "c:@F@main#I#**C#@CALL_EXPR@@348-353": { + "Arguments": [], + "CalledObjects": [ + "c:0065.cpp@319@F@main#I#**C#@func" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#I#**C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@get_func_ptr#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0065.cpp@275@F@main#I#**C#@argv" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0065.cpp@265@F@main#I#**C#@argc" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0065.cpp@152@F@get_func_ptr#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0065.cpp@319@F@main#I#**C#@func", + "c:@F@main#I#**C#@CALL_EXPR@@329-343", + "c:@F@func1#", + "c:@F@func2#", + "c:@F@get_func_ptr#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#I#**C#@CALL_EXPR@@348-353", + "c:@F@func1#@SRETURN", + "c:@F@func2#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@func1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func1#@SRETURN" + ] + }, + "c:@F@func2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func2#@SRETURN" + ] + }, + "c:@F@get_func_ptr#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z12get_func_ptri" + ], + "Parameters": [ + "c:0065.cpp@152@F@get_func_ptr#I#@i" + ], + "ReferencedInReturnStmts": [ + "c:@F@func1#", + "c:@F@func2#", + "c:@F@get_func_ptr#I#@SRETURN" + ] + }, + "c:@F@main#I#**C#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [ + "c:0065.cpp@265@F@main#I#**C#@argc", + "c:0065.cpp@275@F@main#I#**C#@argv" + ], + "ReferencedInReturnStmts": [ + "c:@F@main#I#**C#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@func1#": "c:@F@func1#", + "c:@F@func2#": "c:@F@func2#", + "c:@F@get_func_ptr#I#": "c:@F@get_func_ptr#I#", + "c:@F@main#I#**C#": "c:@F@main#I#**C#" + } + }, + "_CG": { + "_Z12get_func_ptri": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func1v": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func2v": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z12get_func_ptri", + "_Z5func1v", + "_Z5func2v" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z12get_func_ptri": 0, + "_Z5func1v": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0065.gtipcg b/tools/cage/test/input/singleTU/0065.gtipcg new file mode 100644 index 00000000..a7a35830 --- /dev/null +++ b/tools/cage/test/input/singleTU/0065.gtipcg @@ -0,0 +1,52 @@ +{ + "_Z12get_func_ptri": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5func1v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5func2v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z12get_func_ptri", + "_Z5func1v", + "_Z5func2v" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0065.gtmcg b/tools/cage/test/input/singleTU/0065.gtmcg new file mode 100644 index 00000000..1a87509a --- /dev/null +++ b/tools/cage/test/input/singleTU/0065.gtmcg @@ -0,0 +1,145 @@ +{ + "_CG": { + "_Z12get_func_ptri": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func1v": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5func2v": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z12get_func_ptri", + "_Z5func1v", + "_Z5func2v" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z12get_func_ptri": 0, + "_Z5func1v": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0066.cpp b/tools/cage/test/input/singleTU/0066.cpp new file mode 100644 index 00000000..2101dd61 --- /dev/null +++ b/tools/cage/test/input/singleTU/0066.cpp @@ -0,0 +1,9 @@ +// Tests the handling of builtin functions +extern void foo(); + +int main() { + int x = 0; + if (__builtin_expect(x, 0)) + foo(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0066.gtaacg b/tools/cage/test/input/singleTU/0066.gtaacg new file mode 100644 index 00000000..b0c661c9 --- /dev/null +++ b/tools/cage/test/input/singleTU/0066.gtaacg @@ -0,0 +1,209 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@__builtin_expect@UNNAMED_PARAM@1" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@__builtin_expect" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@__builtin_expect@UNNAMED_PARAM@0", + "c:0066.cpp@78@F@main#@x" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@95-116", + "c:@F@__builtin_expect@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@123-127", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@__builtin_expect": { + "IsVariadic": false, + "MangledNames": [ + "__builtin_expect" + ], + "Parameters": [ + "c:@F@__builtin_expect@UNNAMED_PARAM@0", + "c:@F@__builtin_expect@UNNAMED_PARAM@1" + ], + "ReferencedInReturnStmts": [ + "c:@F@__builtin_expect@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@__builtin_expect": "c:@F@__builtin_expect", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "__builtin_expect": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "__builtin_expect" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "__builtin_expect": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0066.gtipcg b/tools/cage/test/input/singleTU/0066.gtipcg new file mode 100644 index 00000000..722468d0 --- /dev/null +++ b/tools/cage/test/input/singleTU/0066.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "__builtin_expect": { + "callees": [], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z3foov", + "__builtin_expect" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 4, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0066.gtmcg b/tools/cage/test/input/singleTU/0066.gtmcg new file mode 100644 index 00000000..187cea4f --- /dev/null +++ b/tools/cage/test/input/singleTU/0066.gtmcg @@ -0,0 +1,112 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "__builtin_expect": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "__builtin_expect" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3foov": 0, + "__builtin_expect": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0215.cpp b/tools/cage/test/input/singleTU/0215.cpp new file mode 100644 index 00000000..7fb3da3e --- /dev/null +++ b/tools/cage/test/input/singleTU/0215.cpp @@ -0,0 +1,14 @@ + +int* k; + +int foo(int k) { + if (k == 42) { + return 0; + } + return foo(k); +} + +int main() { + foo(42); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0215.gtaacg b/tools/cage/test/input/singleTU/0215.gtaacg new file mode 100644 index 00000000..2dfd23dc --- /dev/null +++ b/tools/cage/test/input/singleTU/0215.gtaacg @@ -0,0 +1,156 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0215.cpp@18@F@foo#I#@k" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@97-103", + "c:@F@foo#I#@CALL_EXPR@@71-76", + "c:@F@foo#I#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@foo#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooi" + ], + "Parameters": [ + "c:0215.cpp@18@F@foo#I#@k" + ], + "ReferencedInReturnStmts": [ + "c:@F@foo#I#@CALL_EXPR@@71-76", + "c:@F@foo#I#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@foo#I#": "c:@F@foo#I#", + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "_Z3fooi": { + "callees": [ + "_Z3fooi" + ], + "callers": [ + "_Z3fooi", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_Z3fooi": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0215.gtipcg b/tools/cage/test/input/singleTU/0215.gtipcg new file mode 100644 index 00000000..54845ef2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0215.gtipcg @@ -0,0 +1,29 @@ +{ + "_Z3fooi": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z3fooi", + "main" + ] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0215.gtmcg b/tools/cage/test/input/singleTU/0215.gtmcg new file mode 100644 index 00000000..d18f404d --- /dev/null +++ b/tools/cage/test/input/singleTU/0215.gtmcg @@ -0,0 +1,59 @@ +{ + "_CG": { + "_Z3fooi": { + "callees": [ + "_Z3fooi" + ], + "callers": [ + "main", + "_Z3fooi" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3fooi" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", + "systemInclude": false + }, + "mallocCollector": [], + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "3f6097119927b7bf04c0507f0bd75c65ae9f5088", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0221.cpp b/tools/cage/test/input/singleTU/0221.cpp new file mode 100644 index 00000000..81ebaa0a --- /dev/null +++ b/tools/cage/test/input/singleTU/0221.cpp @@ -0,0 +1,19 @@ +// Test branch + +int main() { + bool a = 5 ? false : true; + int b = 7; + if (a) { + switch (b) { + default: + break; + } + } else if (b) { + bool f = true; + while (f) { + f = false; + } + } + + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0221.gtaacg b/tools/cage/test/input/singleTU/0221.gtaacg new file mode 100644 index 00000000..0df8b13c --- /dev/null +++ b/tools/cage/test/input/singleTU/0221.gtaacg @@ -0,0 +1,93 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0221.cpp@60@F@main#@b" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0221.cpp@31@F@main#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0221.cpp@157@F@main#@f" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0221.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 5, + "numOperations": { + "numberOfControlFlowOps": 9, + "numberOfFloatOps": 0, + "numberOfIntOps": 9, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0221.gtipcg b/tools/cage/test/input/singleTU/0221.gtipcg new file mode 100644 index 00000000..4d298c58 --- /dev/null +++ b/tools/cage/test/input/singleTU/0221.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 10, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0221.gtmcg b/tools/cage/test/input/singleTU/0221.gtmcg new file mode 100644 index 00000000..1698edbb --- /dev/null +++ b/tools/cage/test/input/singleTU/0221.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0221.cpp", + "systemInclude": false + }, + "numStatements": 10 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0222.cpp b/tools/cage/test/input/singleTU/0222.cpp new file mode 100644 index 00000000..aa902f19 --- /dev/null +++ b/tools/cage/test/input/singleTU/0222.cpp @@ -0,0 +1,11 @@ +int x; + +int main() { + int f = 5; + f = 7; + + if (4) { + return 0; + } + return 1 + 2 + x; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0222.gtaacg b/tools/cage/test/input/singleTU/0222.gtaacg new file mode 100644 index 00000000..820d8e2d --- /dev/null +++ b/tools/cage/test/input/singleTU/0222.gtaacg @@ -0,0 +1,87 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@x" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0222.cpp@23@F@main#@f" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0222.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0222.gtipcg b/tools/cage/test/input/singleTU/0222.gtipcg new file mode 100644 index 00000000..f465226c --- /dev/null +++ b/tools/cage/test/input/singleTU/0222.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0222.gtmcg b/tools/cage/test/input/singleTU/0222.gtmcg new file mode 100644 index 00000000..cdce2677 --- /dev/null +++ b/tools/cage/test/input/singleTU/0222.gtmcg @@ -0,0 +1,28 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0222.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0223.cpp b/tools/cage/test/input/singleTU/0223.cpp new file mode 100644 index 00000000..9688ccad --- /dev/null +++ b/tools/cage/test/input/singleTU/0223.cpp @@ -0,0 +1,20 @@ +int x; + +int test() { + do { + return 1; + } while (true); +}; + +int main() { + while (true) { + int a; + while (true) { + break; + } + a = 0; + break; + } + test(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0223.gtaacg b/tools/cage/test/input/singleTU/0223.gtaacg new file mode 100644 index 00000000..f86b26ec --- /dev/null +++ b/tools/cage/test/input/singleTU/0223.gtaacg @@ -0,0 +1,147 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@x" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@test#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0223.cpp@98@F@main#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@171-176", + "c:@F@test#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@test#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4testv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@test#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#", + "c:@F@test#": "c:@F@test#" + } + }, + "_CG": { + "_Z4testv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", + "systemInclude": false + }, + "globalLoopDepth": 2, + "loopCallDepth": { + "_Z4testv": 0 + }, + "loopDepth": 2, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0223.gtipcg b/tools/cage/test/input/singleTU/0223.gtipcg new file mode 100644 index 00000000..828e2a88 --- /dev/null +++ b/tools/cage/test/input/singleTU/0223.gtipcg @@ -0,0 +1,26 @@ +{ + "_Z4testv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 8, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0223.gtmcg b/tools/cage/test/input/singleTU/0223.gtmcg new file mode 100644 index 00000000..f5215b3f --- /dev/null +++ b/tools/cage/test/input/singleTU/0223.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_Z4testv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", + "systemInclude": false + }, + "numStatements": 8 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0224.cpp b/tools/cage/test/input/singleTU/0224.cpp new file mode 100644 index 00000000..2dd7cb87 --- /dev/null +++ b/tools/cage/test/input/singleTU/0224.cpp @@ -0,0 +1,21 @@ +int test2() { return 0; } + +int test() { + do { + return test2(); + } while (true); +}; + +int main() { + while (true) { + int a; + while (true) { + test(); + break; + } + a = 0; + break; + } + test(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0224.gtaacg b/tools/cage/test/input/singleTU/0224.gtaacg new file mode 100644 index 00000000..a74ebc46 --- /dev/null +++ b/tools/cage/test/input/singleTU/0224.gtaacg @@ -0,0 +1,198 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@test2#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@test#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0224.cpp@123@F@main#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@210-215", + "c:@F@main#@CALL_EXPR@@155-160", + "c:@F@test#@CALL_EXPR@@58-64", + "c:@F@test2#@SRETURN", + "c:@F@test#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@test#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4testv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@test#@CALL_EXPR@@58-64", + "c:@F@test#@SRETURN" + ] + }, + "c:@F@test2#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5test2v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@test2#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#", + "c:@F@test#": "c:@F@test#", + "c:@F@test2#": "c:@F@test2#" + } + }, + "_CG": { + "_Z4testv": { + "callees": [ + "_Z5test2v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": { + "_Z5test2v": 1 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5test2v": { + "callees": [], + "callers": [ + "_Z4testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z4testv": 2 + }, + "loopDepth": 2, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 9, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0224.gtipcg b/tools/cage/test/input/singleTU/0224.gtipcg new file mode 100644 index 00000000..8ccc357a --- /dev/null +++ b/tools/cage/test/input/singleTU/0224.gtipcg @@ -0,0 +1,40 @@ +{ + "_Z4testv": { + "callees": [ + "_Z5test2v" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_Z5test2v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4testv" + ] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 9, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0224.gtmcg b/tools/cage/test/input/singleTU/0224.gtmcg new file mode 100644 index 00000000..100af60e --- /dev/null +++ b/tools/cage/test/input/singleTU/0224.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_Z4testv": { + "callees": [ + "_Z5test2v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5test2v": { + "callees": [], + "callers": [ + "_Z4testv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z4testv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", + "systemInclude": false + }, + "numStatements": 9 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0225.cpp b/tools/cage/test/input/singleTU/0225.cpp new file mode 100644 index 00000000..201378f1 --- /dev/null +++ b/tools/cage/test/input/singleTU/0225.cpp @@ -0,0 +1,57 @@ +void leaf() { + while (true) { + break; + } +} + +void loop(); + +void x() { + leaf(); + loop(); +} + +void left() { + while (true) { + x(); + break; + } +} + +void right() { + while (true) { + while (true) { + x(); + break; + } + break; + } +} + +void split() { + left(); + right(); +} + +void loop() { + while (true) { + split(); + break; + } +} + +void entry() { + while (true) { + while (true) { + left(); + entry(); + break; + } + break; + } +} + +int main() { + split(); + return 0; +} diff --git a/tools/cage/test/input/singleTU/0225.gtaacg b/tools/cage/test/input/singleTU/0225.gtaacg new file mode 100644 index 00000000..c7a3ff4f --- /dev/null +++ b/tools/cage/test/input/singleTU/0225.gtaacg @@ -0,0 +1,507 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@x#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@split#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@right#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@loop#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@left#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@leaf#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@entry#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@x#@CALL_EXPR@@76-81", + "c:@F@leaf#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@x#@CALL_EXPR@@86-91", + "c:@F@loop#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@right#@CALL_EXPR@@212-214", + "c:@F@left#@CALL_EXPR@@132-134", + "c:@F@x#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@split#@CALL_EXPR@@281-287", + "c:@F@right#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@entry#@CALL_EXPR@@412-417", + "c:@F@split#@CALL_EXPR@@271-276", + "c:@F@left#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@entry#@CALL_EXPR@@426-432", + "c:@F@entry#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@487-493", + "c:@F@loop#@CALL_EXPR@@328-334", + "c:@F@split#@SRETURN" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@entry#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5entryv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@entry#@SRETURN" + ] + }, + "c:@F@leaf#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4leafv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@leaf#@SRETURN" + ] + }, + "c:@F@left#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4leftv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@left#@SRETURN" + ] + }, + "c:@F@loop#": { + "IsVariadic": false, + "MangledNames": [ + "_Z4loopv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@loop#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@right#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5rightv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@right#@SRETURN" + ] + }, + "c:@F@split#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5splitv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@split#@SRETURN" + ] + }, + "c:@F@x#": { + "IsVariadic": false, + "MangledNames": [ + "_Z1xv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@x#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@entry#": "c:@F@entry#", + "c:@F@leaf#": "c:@F@leaf#", + "c:@F@left#": "c:@F@left#", + "c:@F@loop#": "c:@F@loop#", + "c:@F@main#": "c:@F@main#", + "c:@F@right#": "c:@F@right#", + "c:@F@split#": "c:@F@split#", + "c:@F@x#": "c:@F@x#" + } + }, + "_CG": { + "_Z1xv": { + "callees": [ + "_Z4leafv", + "_Z4loopv" + ], + "callers": [ + "_Z4leftv", + "_Z5rightv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z4leafv": 0, + "_Z4loopv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leafv": { + "callees": [], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leftv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5entryv", + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 4, + "loopCallDepth": { + "_Z1xv": 1 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4loopv": { + "callees": [ + "_Z5splitv" + ], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z5splitv": 1 + }, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5entryv": { + "callees": [ + "_Z4leftv", + "_Z5entryv" + ], + "callers": [ + "_Z5entryv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 6, + "loopCallDepth": { + "_Z4leftv": 2, + "_Z5entryv": 2 + }, + "loopDepth": 2, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 8, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5rightv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z1xv": 2 + }, + "loopDepth": 2, + "mallocCollector": [], + "numConditionalBranches": 2, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 2, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5splitv": { + "callees": [ + "_Z4leftv", + "_Z5rightv" + ], + "callers": [ + "_Z4loopv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z4leftv": 0, + "_Z5rightv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z5splitv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "globalLoopDepth": 3, + "loopCallDepth": { + "_Z5splitv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0225.gtipcg b/tools/cage/test/input/singleTU/0225.gtipcg new file mode 100644 index 00000000..ede759dc --- /dev/null +++ b/tools/cage/test/input/singleTU/0225.gtipcg @@ -0,0 +1,116 @@ +{ + "_Z1xv": { + "callees": [ + "_Z4leafv", + "_Z4loopv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4leftv", + "_Z5rightv" + ] + }, + "_Z4leafv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z1xv" + ] + }, + "_Z4leftv": { + "callees": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z5entryv", + "_Z5splitv" + ] + }, + "_Z4loopv": { + "callees": [ + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z1xv" + ] + }, + "_Z5entryv": { + "callees": [ + "_Z4leftv", + "_Z5entryv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 6, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z5entryv" + ] + }, + "_Z5rightv": { + "callees": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z5splitv" + ] + }, + "_Z5splitv": { + "callees": [ + "_Z4leftv", + "_Z5rightv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "_Z4loopv", + "main" + ] + }, + "main": { + "callees": [ + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0225.gtmcg b/tools/cage/test/input/singleTU/0225.gtmcg new file mode 100644 index 00000000..a21e5980 --- /dev/null +++ b/tools/cage/test/input/singleTU/0225.gtmcg @@ -0,0 +1,174 @@ +{ + "_CG": { + "_Z1xv": { + "callees": [ + "_Z4leafv", + "_Z4loopv" + ], + "callers": [ + "_Z4leftv", + "_Z5rightv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leafv": { + "callees": [], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4leftv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5entryv", + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z4loopv": { + "callees": [ + "_Z5splitv" + ], + "callers": [ + "_Z1xv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5entryv": { + "callees": [ + "_Z4leftv", + "_Z5entryv" + ], + "callers": [ + "_Z5entryv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5rightv": { + "callees": [ + "_Z1xv" + ], + "callers": [ + "_Z5splitv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z5splitv": { + "callees": [ + "_Z4leftv", + "_Z5rightv" + ], + "callers": [ + "_Z4loopv", + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z5splitv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", + "systemInclude": false + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0226.cpp b/tools/cage/test/input/singleTU/0226.cpp new file mode 100644 index 00000000..c2891ae3 --- /dev/null +++ b/tools/cage/test/input/singleTU/0226.cpp @@ -0,0 +1,8 @@ +int foo(int arg[], int offset) { return arg[offset]; } + +struct A { + int a; + int b; +}; + +int boo(struct A a) { return a.b; } \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0226.gtaacg b/tools/cage/test/input/singleTU/0226.gtaacg new file mode 100644 index 00000000..65304333 --- /dev/null +++ b/tools/cage/test/input/singleTU/0226.gtaacg @@ -0,0 +1,181 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@FI@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#*I#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#*I#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@boo#$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@boo#$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0226.cpp@97@F@boo#$@S@A#@a" + ], + "Prefixes": [ + { + "Member": "c:@S@A@FI@a", + "Object": "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@a" + }, + { + "Member": "c:@S@A@FI@b", + "Object": "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b" + } + ] + }, + { + "Objects": [ + "c:0226.cpp@8@F@foo#*I#I#@arg" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0226.cpp@19@F@foo#*I#I#@offset" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b", + "c:@S@A@FI@b" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@boo#$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3boo1A" + ], + "Parameters": [ + "c:0226.cpp@97@F@boo#$@S@A#@a" + ], + "ReferencedInReturnStmts": [ + "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b", + "c:@F@boo#$@S@A#@SRETURN" + ] + }, + "c:@F@foo#*I#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3fooPii" + ], + "Parameters": [ + "c:0226.cpp@8@F@foo#*I#I#@arg", + "c:0226.cpp@19@F@foo#*I#I#@offset" + ], + "ReferencedInReturnStmts": [ + "c:0226.cpp@8@F@foo#*I#I#@arg", + "c:@F@foo#*I#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@boo#$@S@A#": "c:@F@boo#$@S@A#", + "c:@F@foo#*I#I#": "c:@F@foo#*I#I#" + } + }, + "_CG": { + "_Z3boo1A": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 3 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooPii": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0226.gtipcg b/tools/cage/test/input/singleTU/0226.gtipcg new file mode 100644 index 00000000..b7348d76 --- /dev/null +++ b/tools/cage/test/input/singleTU/0226.gtipcg @@ -0,0 +1,22 @@ +{ + "_Z3boo1A": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z3fooPii": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0226.gtmcg b/tools/cage/test/input/singleTU/0226.gtmcg new file mode 100644 index 00000000..76d95cf6 --- /dev/null +++ b/tools/cage/test/input/singleTU/0226.gtmcg @@ -0,0 +1,44 @@ +{ + "_CG": { + "_Z3boo1A": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3fooPii": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0227.cpp b/tools/cage/test/input/singleTU/0227.cpp new file mode 100644 index 00000000..fbb52699 --- /dev/null +++ b/tools/cage/test/input/singleTU/0227.cpp @@ -0,0 +1,11 @@ +float foo(float a, int b) { return a * b; } + +float g; +double h; + +void baa(float* arr, int count) { + for (int i = 0; i < count; ++i) { + g *= arr[i]; + } + h++; +} diff --git a/tools/cage/test/input/singleTU/0227.gtaacg b/tools/cage/test/input/singleTU/0227.gtaacg new file mode 100644 index 00000000..70fb2ccd --- /dev/null +++ b/tools/cage/test/input/singleTU/0227.gtaacg @@ -0,0 +1,172 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@h" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#f#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@baa#*f#I#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@baa#*f#I#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0227.cpp@86@F@baa#*f#I#@count" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0227.cpp@19@F@foo#f#I#@b" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0227.cpp@10@F@foo#f#I#@a" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0227.cpp@106@F@baa#*f#I#@i" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@g", + "c:0227.cpp@74@F@baa#*f#I#@arr" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@baa#*f#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3baaPfi" + ], + "Parameters": [ + "c:0227.cpp@74@F@baa#*f#I#@arr", + "c:0227.cpp@86@F@baa#*f#I#@count" + ], + "ReferencedInReturnStmts": [ + "c:@F@baa#*f#I#@SRETURN" + ] + }, + "c:@F@foo#f#I#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foofi" + ], + "Parameters": [ + "c:0227.cpp@10@F@foo#f#I#@a", + "c:0227.cpp@19@F@foo#f#I#@b" + ], + "ReferencedInReturnStmts": [ + "c:0227.cpp@10@F@foo#f#I#@a", + "c:@F@foo#f#I#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@baa#*f#I#": "c:@F@baa#*f#I#", + "c:@F@foo#f#I#": "c:@F@foo#f#I#" + } + }, + "_CG": { + "_Z3baaPfi": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", + "systemInclude": false + }, + "globalLoopDepth": 1, + "loopCallDepth": {}, + "loopDepth": 1, + "mallocCollector": [], + "numConditionalBranches": 1, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 4, + "numberOfIntOps": 5, + "numberOfMemoryAccesses": 5 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foofi": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 2, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0227.gtipcg b/tools/cage/test/input/singleTU/0227.gtipcg new file mode 100644 index 00000000..582907db --- /dev/null +++ b/tools/cage/test/input/singleTU/0227.gtipcg @@ -0,0 +1,22 @@ +{ + "_Z3baaPfi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_Z3foofi": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0227.gtmcg b/tools/cage/test/input/singleTU/0227.gtmcg new file mode 100644 index 00000000..1c3e6343 --- /dev/null +++ b/tools/cage/test/input/singleTU/0227.gtmcg @@ -0,0 +1,44 @@ +{ + "_CG": { + "_Z3baaPfi": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foofi": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0228.cpp b/tools/cage/test/input/singleTU/0228.cpp new file mode 100644 index 00000000..43f0b804 --- /dev/null +++ b/tools/cage/test/input/singleTU/0228.cpp @@ -0,0 +1,7 @@ +// Test to make sure we do not mangle the name of this function wrong again +// According to the LLVM discourse, this has internal linkage and as such both manglings +// GCC's and Clang's are permissable. +extern "C" { +typedef unsigned short int __uint16_t; +static __inline __uint16_t __uint16_identity(__uint16_t __x) { return __x; } +} diff --git a/tools/cage/test/input/singleTU/0228.gtaacg b/tools/cage/test/input/singleTU/0228.gtaacg new file mode 100644 index 00000000..3c355773 --- /dev/null +++ b/tools/cage/test/input/singleTU/0228.gtaacg @@ -0,0 +1,84 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:0228.cpp@F@__uint16_identity#s#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0228.cpp@F@__uint16_identity#s#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0228.cpp@300@F@__uint16_identity#s#@__x" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:0228.cpp@F@__uint16_identity#s#": { + "IsVariadic": false, + "MangledNames": [ + "_ZL17__uint16_identityt" + ], + "Parameters": [ + "c:0228.cpp@300@F@__uint16_identity#s#@__x" + ], + "ReferencedInReturnStmts": [ + "c:0228.cpp@300@F@__uint16_identity#s#@__x", + "c:0228.cpp@F@__uint16_identity#s#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:0228.cpp@F@__uint16_identity#s#": "c:0228.cpp@F@__uint16_identity#s#" + } + }, + "_CG": { + "_ZL17__uint16_identityt": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0228.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0228.gtipcg b/tools/cage/test/input/singleTU/0228.gtipcg new file mode 100644 index 00000000..2c2aab99 --- /dev/null +++ b/tools/cage/test/input/singleTU/0228.gtipcg @@ -0,0 +1,12 @@ +{ + "_ZL17__uint16_identityt": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0228.gtmcg b/tools/cage/test/input/singleTU/0228.gtmcg new file mode 100644 index 00000000..05cedd7f --- /dev/null +++ b/tools/cage/test/input/singleTU/0228.gtmcg @@ -0,0 +1,42 @@ +{ + "_CG": { + "_ZL17__uint16_identityt": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0228.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7d2df9e14d98eaafadbec1e53b2f7c6aed5bf41b", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0230.cpp b/tools/cage/test/input/singleTU/0230.cpp new file mode 100644 index 00000000..3b74e49f --- /dev/null +++ b/tools/cage/test/input/singleTU/0230.cpp @@ -0,0 +1,20 @@ +// Test for the handling of member functions and members that hold function pointers +class A { + public: + void* member; + void* memberFunction() { + auto p = this; + return member; + } +}; + +void f() {} +typedef void (*Fn)(); + +int main() { + A a; + a.member = (void*)&f; + Fn b = (Fn)a.memberFunction(); + b(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0230.gtaacg b/tools/cage/test/input/singleTU/0230.gtaacg new file mode 100644 index 00000000..f5b0ad25 --- /dev/null +++ b/tools/cage/test/input/singleTU/0230.gtaacg @@ -0,0 +1,416 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@308-310": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@308-310": { + "Arguments": [], + "CalledObjects": [ + "c:0230.cpp@275@F@main#@b" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@A@F@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&1$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#&&$@S@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@f#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0230.cpp@243@F@main#@a).c:@S@A@F@memberFunction#", + "c:@S@A@F@memberFunction#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0230.cpp@275@F@main#@b", + "(c:0230.cpp@243@F@main#@a).c:@S@A@FI@member", + "c:@F@main#@CALL_EXPR@@286-303", + "(*c:@S@A@F@memberFunction#@THIS).c:@S@A@FI@member", + "c:@S@A@F@memberFunction#@SRETURN", + "c:@S@A@FI@member", + "&c:@F@f#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@f#" + } + ] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@308-310", + "c:@F@f#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@A@F@A#@THIS", + "&c:@F@main#@CALL_EXPR@@245-245" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@245-245" + } + ] + }, + { + "Objects": [ + "c:0230.cpp@151@S@A@F@memberFunction#@p", + "c:@S@A@F@memberFunction#@THIS", + "&c:0230.cpp@243@F@main#@a" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@A@F@memberFunction#@THIS" + } + ] + }, + { + "Objects": [ + "c:0230.cpp@243@F@main#@a", + "c:@F@main#@CALL_EXPR@@245-245", + "*c:@S@A@F@memberFunction#@THIS" + ], + "Prefixes": [ + { + "Member": "c:@S@A@F@memberFunction#", + "Object": "(c:0230.cpp@243@F@main#@a).c:@S@A@F@memberFunction#" + }, + { + "Member": "c:@S@A@FI@member", + "Object": "(c:0230.cpp@243@F@main#@a).c:@S@A@FI@member" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@f#": { + "IsVariadic": false, + "MangledNames": [ + "_Z1fv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@f#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@A@F@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2Ev", + "_ZN1AC1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&&$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2EOS_", + "_ZN1AC1EOS_" + ], + "Parameters": [ + "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@A#&1$@S@A#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1AC2ERKS_", + "_ZN1AC1ERKS_" + ], + "Parameters": [ + "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@A@F@memberFunction#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1A14memberFunctionEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "(*c:@S@A@F@memberFunction#@THIS).c:@S@A@FI@member", + "c:@S@A@F@memberFunction#@SRETURN" + ] + } + }, + "FunctionMap": { + "&c:@F@f#": "c:@F@f#", + "c:@F@f#": "c:@F@f#", + "c:@F@main#": "c:@F@main#", + "c:@S@A@F@A#": "c:@S@A@F@A#", + "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", + "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", + "c:@S@A@F@memberFunction#": "c:@S@A@F@memberFunction#" + } + }, + "_CG": { + "_Z1fv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A14memberFunctionEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1AC2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z1fv", + "_ZN1A14memberFunctionEv", + "_ZN1AC1Ev", + "_ZN1AC2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1A14memberFunctionEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0230.gtipcg b/tools/cage/test/input/singleTU/0230.gtipcg new file mode 100644 index 00000000..6076ce75 --- /dev/null +++ b/tools/cage/test/input/singleTU/0230.gtipcg @@ -0,0 +1,39 @@ +{ + "_Z1fv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1A14memberFunctionEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_Z1fv", + "_ZN1A14memberFunctionEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 5, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0230.gtmcg b/tools/cage/test/input/singleTU/0230.gtmcg new file mode 100644 index 00000000..81f9fad2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0230.gtmcg @@ -0,0 +1,111 @@ +{ + "_CG": { + "_Z1fv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1A14memberFunctionEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z1fv", + "_ZN1A14memberFunctionEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1A14memberFunctionEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 6, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", + "version": "0.3" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0232.cpp b/tools/cage/test/input/singleTU/0232.cpp new file mode 100644 index 00000000..c538f180 --- /dev/null +++ b/tools/cage/test/input/singleTU/0232.cpp @@ -0,0 +1,16 @@ +// Test for the handling of new and delete and calling function pointers within them +typedef void (*Fn)(); + +void func1() {} + +class X { + public: + Fn function; + X(Fn arg) { function = arg; } + ~X() { function(); } +}; + +int main() { + const auto f = new X(func1); + delete f; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0232.gtaacg b/tools/cage/test/input/singleTU/0232.gtaacg new file mode 100644 index 00000000..4b259cdb --- /dev/null +++ b/tools/cage/test/input/singleTU/0232.gtaacg @@ -0,0 +1,542 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@S@X@F@~X#@CALL_EXPR@@200-209": "c:@S@X@F@~X#" + }, + "CallInfoMap": { + "c:@S@X@F@~X#@CALL_EXPR@@200-209": { + "Arguments": [], + "CalledObjects": [ + "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@X@F@~X#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@~X#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function", + "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function", + "c:@S@X@FI@function", + "c:0232.cpp@163@S@X@F@X#*Fv()#@arg", + "c:@F@func1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@~X#@CALL_EXPR@@200-209", + "c:@F@func1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#@THIS", + "&c:@F@main#@CALL_EXPR@@252-259" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@X@F@X#*Fv()#@THIS" + } + ] + }, + { + "Objects": [ + "c:@F@main#@NEW@248-259", + "c:@F@main#@CALL_EXPR@@252-259", + "*c:@S@X@F@X#*Fv()#@THIS" + ], + "Prefixes": [ + { + "Member": "c:@S@X@FI@function", + "Object": "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function" + } + ] + }, + { + "Objects": [ + "c:@S@X@F@~X#@THIS", + "&c:0232.cpp@233@F@main#@f" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@X@F@~X#@THIS" + } + ] + }, + { + "Objects": [ + "c:0232.cpp@233@F@main#@f", + "&c:@F@main#@NEW@248-259", + "*c:@S@X@F@~X#@THIS" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@NEW@248-259" + }, + { + "Member": "c:@S@X@FI@function", + "Object": "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@func1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func1#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@operator delete#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdlPv" + ], + "Parameters": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete#*v#@SRETURN" + ] + }, + "c:@F@operator delete[]#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdaPv" + ], + "Parameters": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete[]#*v#@SRETURN" + ] + }, + "c:@F@operator new#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znwm" + ], + "Parameters": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new#l#@SRETURN" + ] + }, + "c:@F@operator new[]#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znam" + ], + "Parameters": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new[]#l#@SRETURN" + ] + }, + "c:@S@X@F@X#&1$@S@X#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XC2ERKS_", + "_ZN1XC1ERKS_" + ], + "Parameters": [ + "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@X@F@X#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XC2EPFvvE", + "_ZN1XC1EPFvvE" + ], + "Parameters": [ + "c:0232.cpp@163@S@X@F@X#*Fv()#@arg" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@X@F@~X#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XD2Ev", + "_ZN1XD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@func1#": "c:@F@func1#", + "c:@F@main#": "c:@F@main#", + "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", + "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", + "c:@F@operator new#l#": "c:@F@operator new#l#", + "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", + "c:@S@X@F@X#&1$@S@X#": "c:@S@X@F@X#&1$@S@X#", + "c:@S@X@F@X#*Fv()#": "c:@S@X@F@X#*Fv()#", + "c:@S@X@F@~X#": "c:@S@X@F@~X#" + } + }, + "_CG": { + "_Z5func1v": { + "callees": [], + "callers": [ + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD1Ev": { + "callees": [ + "_Z5func1v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD2Ev": { + "callees": [ + "_Z5func1v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1XC1EPFvvE", + "_ZN1XC2EPFvvE", + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0232.gtipcg b/tools/cage/test/input/singleTU/0232.gtipcg new file mode 100644 index 00000000..bbfd9cfd --- /dev/null +++ b/tools/cage/test/input/singleTU/0232.gtipcg @@ -0,0 +1,62 @@ +{ + "_Z5func1v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XD1Ev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XD2Ev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0232.gtmcg b/tools/cage/test/input/singleTU/0232.gtmcg new file mode 100644 index 00000000..88fde759 --- /dev/null +++ b/tools/cage/test/input/singleTU/0232.gtmcg @@ -0,0 +1,192 @@ +{ + "_CG": { + "_Z5func1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0233.cpp b/tools/cage/test/input/singleTU/0233.cpp new file mode 100644 index 00000000..2d0969d9 --- /dev/null +++ b/tools/cage/test/input/singleTU/0233.cpp @@ -0,0 +1,6 @@ +// Test for a new call invoving a builtin type +int main() { + int a = 1; + int* bp = new int(a); + int c = *bp; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0233.gtaacg b/tools/cage/test/input/singleTU/0233.gtaacg new file mode 100644 index 00000000..16b1ea43 --- /dev/null +++ b/tools/cage/test/input/singleTU/0233.gtaacg @@ -0,0 +1,220 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": {}, + "CallInfoMap": {}, + "EquivClasses": [ + { + "Objects": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0233.cpp@75@F@main#@bp", + "&c:@F@main#@NEW@85-94" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:0233.cpp@75@F@main#@bp" + } + ] + }, + { + "Objects": [ + "c:0233.cpp@99@F@main#@c", + "c:@F@main#@NEW@85-94", + "*c:0233.cpp@75@F@main#@bp", + "c:0233.cpp@62@F@main#@a" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@operator delete#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdlPv" + ], + "Parameters": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete#*v#@SRETURN" + ] + }, + "c:@F@operator delete[]#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdaPv" + ], + "Parameters": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete[]#*v#@SRETURN" + ] + }, + "c:@F@operator new#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znwm" + ], + "Parameters": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new#l#@SRETURN" + ] + }, + "c:@F@operator new[]#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znam" + ], + "Parameters": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new[]#l#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@main#": "c:@F@main#", + "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", + "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", + "c:@F@operator new#l#": "c:@F@operator new#l#", + "c:@F@operator new[]#l#": "c:@F@operator new[]#l#" + } + }, + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0233.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0233.gtipcg b/tools/cage/test/input/singleTU/0233.gtipcg new file mode 100644 index 00000000..e243b733 --- /dev/null +++ b/tools/cage/test/input/singleTU/0233.gtipcg @@ -0,0 +1,12 @@ +{ + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0233.gtmcg b/tools/cage/test/input/singleTU/0233.gtmcg new file mode 100644 index 00000000..aa010221 --- /dev/null +++ b/tools/cage/test/input/singleTU/0233.gtmcg @@ -0,0 +1,42 @@ +{ + "_CG": { + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 3 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0233.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 4, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", + "version": "0.3" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0234.cpp b/tools/cage/test/input/singleTU/0234.cpp new file mode 100644 index 00000000..72b67391 --- /dev/null +++ b/tools/cage/test/input/singleTU/0234.cpp @@ -0,0 +1,16 @@ +// Tests an explicit destructor call +typedef void (*Fn)(); + +void func1() {} + +class X { + public: + Fn function; + X(Fn arg) { function = arg; } + ~X() { function(); } +}; + +int main() { + const auto f = new X(func1); + f->~X(); +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0234.gtaacg b/tools/cage/test/input/singleTU/0234.gtaacg new file mode 100644 index 00000000..262f7a0a --- /dev/null +++ b/tools/cage/test/input/singleTU/0234.gtaacg @@ -0,0 +1,542 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@S@X@F@~X#@CALL_EXPR@@152-161": "c:@S@X@F@~X#" + }, + "CallInfoMap": { + "c:@S@X@F@~X#@CALL_EXPR@@152-161": { + "Arguments": [], + "CalledObjects": [ + "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@X@F@~X#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#&1$@S@X#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new[]#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator new#l#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete[]#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@operator delete#*v#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@216-222" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:0234.cpp@185@F@main#@f).c:@S@X@F@~X#", + "c:@S@X@F@~X#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function", + "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function", + "c:@S@X@FI@function", + "c:0234.cpp@115@S@X@F@X#*Fv()#@arg", + "c:@F@func1#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@~X#@CALL_EXPR@@152-161", + "c:@F@func1#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@X@F@X#*Fv()#@THIS", + "&c:@F@main#@CALL_EXPR@@204-211" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@X@F@X#*Fv()#@THIS" + } + ] + }, + { + "Objects": [ + "c:@S@X@F@~X#@THIS", + "c:0234.cpp@185@F@main#@f", + "&c:@F@main#@NEW@200-211" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@X@F@~X#@THIS" + } + ] + }, + { + "Objects": [ + "c:@F@main#@NEW@200-211", + "*c:0234.cpp@185@F@main#@f", + "c:@F@main#@CALL_EXPR@@204-211", + "*c:@S@X@F@X#*Fv()#@THIS", + "*c:@S@X@F@~X#@THIS" + ], + "Prefixes": [ + { + "Member": "c:@S@X@F@~X#", + "Object": "(*c:0234.cpp@185@F@main#@f).c:@S@X@F@~X#" + }, + { + "Member": "c:@S@X@FI@function", + "Object": "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@func1#": { + "IsVariadic": false, + "MangledNames": [ + "_Z5func1v" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@func1#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@F@operator delete#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdlPv" + ], + "Parameters": [ + "c:@F@operator delete#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete#*v#@SRETURN" + ] + }, + "c:@F@operator delete[]#*v#": { + "IsVariadic": false, + "MangledNames": [ + "_ZdaPv" + ], + "Parameters": [ + "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator delete[]#*v#@SRETURN" + ] + }, + "c:@F@operator new#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znwm" + ], + "Parameters": [ + "c:@F@operator new#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new#l#@SRETURN" + ] + }, + "c:@F@operator new[]#l#": { + "IsVariadic": false, + "MangledNames": [ + "_Znam" + ], + "Parameters": [ + "c:@F@operator new[]#l#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [ + "c:@F@operator new[]#l#@SRETURN" + ] + }, + "c:@S@X@F@X#&1$@S@X#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XC2ERKS_", + "_ZN1XC1ERKS_" + ], + "Parameters": [ + "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@X@F@X#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XC2EPFvvE", + "_ZN1XC1EPFvvE" + ], + "Parameters": [ + "c:0234.cpp@115@S@X@F@X#*Fv()#@arg" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@X@F@~X#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1XD2Ev", + "_ZN1XD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "c:@F@func1#": "c:@F@func1#", + "c:@F@main#": "c:@F@main#", + "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", + "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", + "c:@F@operator new#l#": "c:@F@operator new#l#", + "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", + "c:@S@X@F@X#&1$@S@X#": "c:@S@X@F@X#&1$@S@X#", + "c:@S@X@F@X#*Fv()#": "c:@S@X@F@X#*Fv()#", + "c:@S@X@F@~X#": "c:@S@X@F@~X#" + } + }, + "_CG": { + "_Z5func1v": { + "callees": [], + "callers": [ + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD1Ev": { + "callees": [ + "_Z5func1v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD2Ev": { + "callees": [ + "_Z5func1v" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1XC1EPFvvE", + "_ZN1XC2EPFvvE", + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1XD1Ev": 0, + "_ZN1XD2Ev": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0234.gtipcg b/tools/cage/test/input/singleTU/0234.gtipcg new file mode 100644 index 00000000..a851efb4 --- /dev/null +++ b/tools/cage/test/input/singleTU/0234.gtipcg @@ -0,0 +1,69 @@ +{ + "_Z5func1v": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1XD1Ev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1XD2Ev": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "main": { + "callees": [ + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0234.gtmcg b/tools/cage/test/input/singleTU/0234.gtmcg new file mode 100644 index 00000000..cdb45e6b --- /dev/null +++ b/tools/cage/test/input/singleTU/0234.gtmcg @@ -0,0 +1,202 @@ +{ + "_CG": { + "_Z5func1v": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC1EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XC2EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1XD2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 1, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1XD1Ev", + "_ZN1XD2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1XD1Ev": 0, + "_ZN1XD2Ev": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 5, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0235.cpp b/tools/cage/test/input/singleTU/0235.cpp new file mode 100644 index 00000000..f59da652 --- /dev/null +++ b/tools/cage/test/input/singleTU/0235.cpp @@ -0,0 +1,18 @@ +// Tests passing function pointers as C++ style constructor init + +typedef void (*Function)(); + +void foo() {} + +class C { + public: + C(Function F) : member(F) {}; + + Function member; +}; + +int main() { + C a(&foo); + Function b = a.member; + b(); +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0235.gtaacg b/tools/cage/test/input/singleTU/0235.gtaacg new file mode 100644 index 00000000..663ccd54 --- /dev/null +++ b/tools/cage/test/input/singleTU/0235.gtaacg @@ -0,0 +1,344 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@F@main#@CALL_EXPR@@237-239": "c:@F@main#" + }, + "CallInfoMap": { + "c:@F@main#@CALL_EXPR@@237-239": { + "Arguments": [], + "CalledObjects": [ + "c:0235.cpp@212@F@main#@b" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@C@F@C#*Fv()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#*Fv()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0235.cpp@212@F@main#@b", + "(c:0235.cpp@199@F@main#@a).c:@S@C@FI@member", + "c:@S@C@FI@member", + "c:0235.cpp@133@S@C@F@C#*Fv()#@F", + "&c:@F@foo#" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@foo#" + } + ] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@237-239", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:0235.cpp@199@F@main#@a", + "c:@F@main#@CALL_EXPR@@201-207" + ], + "Prefixes": [ + { + "Member": "c:@S@C@FI@member", + "Object": "(c:0235.cpp@199@F@main#@a).c:@S@C@FI@member" + } + ] + }, + { + "Objects": [ + "c:@S@C@F@C#*Fv()#@THIS", + "&c:@F@main#@CALL_EXPR@@201-207" + ], + "Prefixes": [ + { + "Member": "", + "Object": "c:@F@main#@CALL_EXPR@@201-207" + } + ] + } + ], + "FunctionInfoMap": { + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@C@F@C#&&$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2EOS_", + "_ZN1CC1EOS_" + ], + "Parameters": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#&1$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2ERKS_", + "_ZN1CC1ERKS_" + ], + "Parameters": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#*Fv()#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2EPFvvE", + "_ZN1CC1EPFvvE" + ], + "Parameters": [ + "c:0235.cpp@133@S@C@F@C#*Fv()#@F" + ], + "ReferencedInReturnStmts": [] + } + }, + "FunctionMap": { + "&c:@F@foo#": "c:@F@foo#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", + "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", + "c:@S@C@F@C#*Fv()#": "c:@S@C@F@C#*Fv()#" + } + }, + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC1EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC2EPFvvE": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_Z3foov", + "_ZN1CC1EPFvvE", + "_ZN1CC2EPFvvE" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0235.gtipcg b/tools/cage/test/input/singleTU/0235.gtipcg new file mode 100644 index 00000000..32c9ff45 --- /dev/null +++ b/tools/cage/test/input/singleTU/0235.gtipcg @@ -0,0 +1,42 @@ +{ + "_Z3foov": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1CC1EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1CC2EPFvvE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 3, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0235.gtmcg b/tools/cage/test/input/singleTU/0235.gtmcg new file mode 100644 index 00000000..ea97a814 --- /dev/null +++ b/tools/cage/test/input/singleTU/0235.gtmcg @@ -0,0 +1,132 @@ +{ + "_CG": { + "_Z3foov": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC1EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC2EPFvvE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 3, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0237.cpp b/tools/cage/test/input/singleTU/0237.cpp new file mode 100644 index 00000000..49ced569 --- /dev/null +++ b/tools/cage/test/input/singleTU/0237.cpp @@ -0,0 +1,25 @@ +// Tests for c++ style constructor init +int foo(); +int boo(); +using FType = decltype(foo); + +class B { + public: + B(FType* arg) { f1 = arg; }; + FType* f1; +}; + +class C : B { + public: + C(FType* arg1, FType* arg2) : B(arg1), f2(arg2) {} + FType* f2; + void work() { + f1(); + f2(); + } +}; + +int main() { + C c(foo, boo); + c.work(); +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0237.gtaacg b/tools/cage/test/input/singleTU/0237.gtaacg new file mode 100644 index 00000000..ca53e506 --- /dev/null +++ b/tools/cage/test/input/singleTU/0237.gtaacg @@ -0,0 +1,684 @@ +{ + "PointerEquivalenceData": { + "CallExprParentMap": { + "c:@S@C@F@work#@CALL_EXPR@@268-271": "c:@S@C@F@work#", + "c:@S@C@F@work#@CALL_EXPR@@278-281": "c:@S@C@F@work#" + }, + "CallInfoMap": { + "c:@S@C@F@work#@CALL_EXPR@@268-271": { + "Arguments": [], + "CalledObjects": [ + "(*c:@S@C@F@work#@THIS).c:@S@B@FI@f1" + ] + }, + "c:@S@C@F@work#@CALL_EXPR@@278-281": { + "Arguments": [], + "CalledObjects": [ + "(*c:@S@C@F@work#@THIS).c:@S@C@FI@f2" + ] + } + }, + "EquivClasses": [ + { + "Objects": [ + "c:@S@C@F@C#*FI()#S0_#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#*FI()#S0_#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&1$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#&&$@S@C#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@~B#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@~B#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@~B#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#*FI()#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#*FI()#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&1$@S@B#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&1$@S@B#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&1$@S@B#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&1$@S@B#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&&$@S@B#@UNNAMED_PARAM@0" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&&$@S@B#@THIS" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&&$@S@B#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@B@F@B#&&$@S@B#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@F@main#@CALL_EXPR@@324-331", + "c:@S@C@F@work#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(c:0237.cpp@307@F@main#@c).c:@S@C@F@work#", + "c:@S@C@F@work#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@work#@CALL_EXPR@@278-281", + "c:@F@boo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "(*c:@S@C@F@work#@THIS).c:@S@B@FI@f1", + "(*c:@S@B@F@B#*FI()#@THIS).c:@S@B@FI@f1", + "c:@S@B@FI@f1", + "c:0237.cpp@115@S@B@F@B#*FI()#@arg", + "c:0237.cpp@186@S@C@F@C#*FI()#S0_#@arg1", + "c:@F@foo#" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@work#@CALL_EXPR@@268-271", + "c:@F@foo#@SRETURN" + ], + "Prefixes": [] + }, + { + "Objects": [ + "c:@S@C@F@C#*FI()#S0_#@THIS", + "c:@S@B@F@B#*FI()#@THIS", + "&c:@S@C@F@C#*FI()#S0_#@CALL_EXPR@@214-220", + "&c:@F@main#@CALL_EXPR@@309-319" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@B@F@B#*FI()#@THIS" + } + ] + }, + { + "Objects": [ + "c:@S@C@F@work#@THIS", + "&c:0237.cpp@307@F@main#@c" + ], + "Prefixes": [ + { + "Member": "", + "Object": "*c:@S@C@F@work#@THIS" + } + ] + }, + { + "Objects": [ + "c:0237.cpp@307@F@main#@c", + "c:@F@main#@CALL_EXPR@@309-319", + "c:@S@C@F@C#*FI()#S0_#@CALL_EXPR@@214-220", + "*c:@S@B@F@B#*FI()#@THIS", + "*c:@S@C@F@work#@THIS" + ], + "Prefixes": [ + { + "Member": "c:@S@C@F@work#", + "Object": "(c:0237.cpp@307@F@main#@c).c:@S@C@F@work#" + }, + { + "Member": "c:@S@C@FI@f2", + "Object": "(c:0237.cpp@307@F@main#@c).c:@S@C@FI@f2" + }, + { + "Member": "c:@S@B@FI@f1", + "Object": "(*c:@S@B@F@B#*FI()#@THIS).c:@S@B@FI@f1" + } + ] + }, + { + "Objects": [ + "(*c:@S@C@F@work#@THIS).c:@S@C@FI@f2", + "c:@S@C@FI@f2", + "c:0237.cpp@199@S@C@F@C#*FI()#S0_#@arg2", + "c:@F@boo#", + "(c:0237.cpp@307@F@main#@c).c:@S@C@FI@f2" + ], + "Prefixes": [] + } + ], + "FunctionInfoMap": { + "c:@F@boo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3boov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@boo#@SRETURN" + ] + }, + "c:@F@foo#": { + "IsVariadic": false, + "MangledNames": [ + "_Z3foov" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@foo#@SRETURN" + ] + }, + "c:@F@main#": { + "IsVariadic": false, + "MangledNames": [ + "main" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@F@main#@SRETURN" + ] + }, + "c:@S@B@F@B#&&$@S@B#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1BC2EOS_", + "_ZN1BC1EOS_" + ], + "Parameters": [ + "c:@S@B@F@B#&&$@S@B#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@B@F@B#&1$@S@B#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1BC2ERKS_", + "_ZN1BC1ERKS_" + ], + "Parameters": [ + "c:@S@B@F@B#&1$@S@B#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@B@F@B#*FI()#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1BC2EPFivE", + "_ZN1BC1EPFivE" + ], + "Parameters": [ + "c:0237.cpp@115@S@B@F@B#*FI()#@arg" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@B@F@~B#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1BD2Ev", + "_ZN1BD1Ev" + ], + "Parameters": [], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#&&$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2EOS_", + "_ZN1CC1EOS_" + ], + "Parameters": [ + "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#&1$@S@C#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2ERKS_", + "_ZN1CC1ERKS_" + ], + "Parameters": [ + "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@C#*FI()#S0_#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1CC2EPFivES1_", + "_ZN1CC1EPFivES1_" + ], + "Parameters": [ + "c:0237.cpp@186@S@C@F@C#*FI()#S0_#@arg1", + "c:0237.cpp@199@S@C@F@C#*FI()#S0_#@arg2" + ], + "ReferencedInReturnStmts": [] + }, + "c:@S@C@F@work#": { + "IsVariadic": false, + "MangledNames": [ + "_ZN1C4workEv" + ], + "Parameters": [], + "ReferencedInReturnStmts": [ + "c:@S@C@F@work#@SRETURN" + ] + } + }, + "FunctionMap": { + "c:@F@boo#": "c:@F@boo#", + "c:@F@foo#": "c:@F@foo#", + "c:@F@main#": "c:@F@main#", + "c:@S@B@F@B#&&$@S@B#": "c:@S@B@F@B#&&$@S@B#", + "c:@S@B@F@B#&1$@S@B#": "c:@S@B@F@B#&1$@S@B#", + "c:@S@B@F@B#*FI()#": "c:@S@B@F@B#*FI()#", + "c:@S@B@F@~B#": "c:@S@B@F@~B#", + "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", + "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", + "c:@S@C@F@C#*FI()#S0_#": "c:@S@C@F@C#*FI()#S0_#", + "c:@S@C@F@work#": "c:@S@C@F@work#" + } + }, + "_CG": { + "_Z3boov": { + "callees": [], + "callers": [ + "_ZN1C4workEv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_Z3foov": { + "callees": [], + "callers": [ + "_ZN1C4workEv" + ], + "doesOverride": false, + "hasBody": false, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC1EPFivE": { + "callees": [], + "callers": [ + "_ZN1CC1EPFivES1_", + "_ZN1CC2EPFivES1_" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2EPFivE": { + "callees": [], + "callers": [ + "_ZN1CC1EPFivES1_", + "_ZN1CC2EPFivES1_" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1C4workEv": { + "callees": [ + "_Z3boov", + "_Z3foov" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC1EPFivES1_": { + "callees": [ + "_ZN1BC1EPFivE", + "_ZN1BC2EPFivE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC2EPFivES1_": { + "callees": [ + "_ZN1BC1EPFivE", + "_ZN1BC2EPFivE" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1C4workEv", + "_ZN1CC1EPFivES1_", + "_ZN1CC2EPFivES1_" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1C4workEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/singleTU/0237.gtipcg b/tools/cage/test/input/singleTU/0237.gtipcg new file mode 100644 index 00000000..cae911b1 --- /dev/null +++ b/tools/cage/test/input/singleTU/0237.gtipcg @@ -0,0 +1,66 @@ +{ + "_ZN1BC1EPFivE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1BC2EPFivE": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 1, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1C4workEv": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [ + "main" + ] + }, + "_ZN1CC1EPFivES1_": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "_ZN1CC2EPFivES1_": { + "callees": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 0, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + }, + "main": { + "callees": [ + "_ZN1C4workEv" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "numStatements": 2, + "overriddenBy": [], + "overriddenFunctions": [], + "parents": [] + } +} diff --git a/tools/cage/test/input/singleTU/0237.gtmcg b/tools/cage/test/input/singleTU/0237.gtmcg new file mode 100644 index 00000000..38c3add2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0237.gtmcg @@ -0,0 +1,198 @@ +{ + "_CG": { + "_ZN1BC1EPFivE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1BC2EPFivE": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1C4workEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 2, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC1EPFivES1_": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN1CC2EPFivES1_": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN1C4workEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN1C4workEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 4, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 2 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0006.cpp b/tools/cage/test/input/virtualCalls/0006.cpp new file mode 100644 index 00000000..4d012934 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0006.cpp @@ -0,0 +1,13 @@ +// call to constructor and member function + +class MyClass { + public: + void foo() {} +}; + +int main(int argc, char* argv[]) { + MyClass mc; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0006.gtmcg b/tools/cage/test/input/virtualCalls/0006.gtmcg new file mode 100644 index 00000000..8262f670 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0006.gtmcg @@ -0,0 +1,48 @@ +{ + "_CG": { + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0006.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0006.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0007.cpp b/tools/cage/test/input/virtualCalls/0007.cpp new file mode 100644 index 00000000..ae7c8b17 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0007.cpp @@ -0,0 +1,14 @@ +// call to constructor and virtual destructor + +class MyClass { + public: + MyClass(int b) { int c = b; } + virtual ~MyClass() {} +}; + +int main(int argc, char* argv[]) { + int a = 42; + MyClass mc(a); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0007.gtmcg b/tools/cage/test/input/virtualCalls/0007.gtmcg new file mode 100644 index 00000000..b6699c3f --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0007.gtmcg @@ -0,0 +1,192 @@ +{ + "_CG": { + "_ZN7MyClassC1Ei": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassC2Ei": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 2 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD0Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD1Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN7MyClassD2Ev": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 3, + "numberOfFloatOps": 0, + "numberOfIntOps": 1, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0008.cpp b/tools/cage/test/input/virtualCalls/0008.cpp new file mode 100644 index 00000000..8ea1c0d9 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0008.cpp @@ -0,0 +1,21 @@ +// call to overriding function + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mcd.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0008.gtmcg b/tools/cage/test/input/virtualCalls/0008.gtmcg new file mode 100644 index 00000000..6d696272 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0008.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN13MyClassDerive3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0009.cpp b/tools/cage/test/input/virtualCalls/0009.cpp new file mode 100644 index 00000000..fefdc13b --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0009.cpp @@ -0,0 +1,21 @@ +// call to overwritten function + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0009.gtmcg b/tools/cage/test/input/virtualCalls/0009.gtmcg new file mode 100644 index 00000000..64dc23e1 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0009.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0010.cpp b/tools/cage/test/input/virtualCalls/0010.cpp new file mode 100644 index 00000000..e0c46a2f --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0010.cpp @@ -0,0 +1,29 @@ +// call to overriding and overwritten functions + +class MyClass { + public: + virtual void foo() {} + virtual int bar() { return 0; } +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; + int bar() final; +}; + +void MyClassDerive::foo() {} +int MyClassDerive::bar() { return 1; } + +void callsBar(MyClassDerive& mcd) { mcd.bar(); } + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + mc.bar(); + + callsBar(mcd); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0010.gtmcg b/tools/cage/test/input/virtualCalls/0010.gtmcg new file mode 100644 index 00000000..390a8507 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0010.gtmcg @@ -0,0 +1,130 @@ +{ + "_CG": { + "_Z8callsBarR13MyClassDerive": { + "callees": [ + "_ZN13MyClassDerive3barEv" + ], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN13MyClassDerive3barEv": { + "callees": [], + "callers": [ + "_Z8callsBarR13MyClassDerive" + ], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3barEv" + ] + }, + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN7MyClass3barEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3barEv" + ], + "overrides": [] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_Z8callsBarR13MyClassDerive", + "_ZN7MyClass3barEv", + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", + "systemInclude": false + }, + "numStatements": 6 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0011.cpp b/tools/cage/test/input/virtualCalls/0011.cpp new file mode 100644 index 00000000..5cd8ba4d --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0011.cpp @@ -0,0 +1,20 @@ +// call to redefined function + +class MyClass {}; + +class MyClassDerive : public MyClass { + public: + int foo() { return 0; } +}; + +class MyClassDeriveD : public MyClassDerive { + public: + int foo() { return 1; } +}; + +int main(int argc, char* argv[]) { + MyClassDerive mcd; + mcd.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0011.gtmcg b/tools/cage/test/input/virtualCalls/0011.gtmcg new file mode 100644 index 00000000..1685f4c5 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0011.gtmcg @@ -0,0 +1,64 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN14MyClassDeriveD3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN13MyClassDerive3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0012.cpp b/tools/cage/test/input/virtualCalls/0012.cpp new file mode 100644 index 00000000..2e7bccb9 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0012.cpp @@ -0,0 +1,20 @@ +// call to redefining function + +class MyClass {}; + +class MyClassDerive : public MyClass { + public: + int foo() { return 0; } +}; + +class MyClassDeriveD : public MyClassDerive { + public: + int foo() { return 1; } +}; + +int main(int argc, char* argv[]) { + MyClassDeriveD mcdd; + mcdd.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0012.gtmcg b/tools/cage/test/input/virtualCalls/0012.gtmcg new file mode 100644 index 00000000..91b6d347 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0012.gtmcg @@ -0,0 +1,64 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN14MyClassDeriveD3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", + "systemInclude": false + }, + "numStatements": 1 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN14MyClassDeriveD3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", + "systemInclude": false + }, + "numStatements": 3 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0015.cpp b/tools/cage/test/input/virtualCalls/0015.cpp new file mode 100644 index 00000000..6762940c --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0015.cpp @@ -0,0 +1,27 @@ +// 2 overrides in a row +// but no multiple inheritanc + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClass2 : public MyClass { + public: + virtual void foo() override {} +}; + +class MyClassDerive : public MyClass2 { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0015.gtmcg b/tools/cage/test/input/virtualCalls/0015.gtmcg new file mode 100644 index 00000000..89307926 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0015.gtmcg @@ -0,0 +1,88 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN8MyClass23fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN8MyClass23fooEv" + ], + "overrides": [] + }, + "_ZN8MyClass23fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", + "systemInclude": false + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0016.cpp b/tools/cage/test/input/virtualCalls/0016.cpp new file mode 100644 index 00000000..5c901ccf --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0016.cpp @@ -0,0 +1,26 @@ +// override multiple functions + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClass2 { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass, public MyClass2 { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0016.gtmcg b/tools/cage/test/input/virtualCalls/0016.gtmcg new file mode 100644 index 00000000..3970b748 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0016.gtmcg @@ -0,0 +1,180 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "_ZN8MyClass23fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN7MyClass3fooEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0017.cpp b/tools/cage/test/input/virtualCalls/0017.cpp new file mode 100644 index 00000000..3f9d27d0 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0017.cpp @@ -0,0 +1,29 @@ +// override multiple functions +// override function of super super class + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClass2 { + public: + virtual void foo() {} +}; + +class MyClassStep : public MyClass2 {}; + +class MyClassDerive : public MyClass, public MyClassStep { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0017.gtmcg b/tools/cage/test/input/virtualCalls/0017.gtmcg new file mode 100644 index 00000000..54896f69 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0017.gtmcg @@ -0,0 +1,180 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "_ZN8MyClass23fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN7MyClass3fooEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0018.cpp b/tools/cage/test/input/virtualCalls/0018.cpp new file mode 100644 index 00000000..26e372c5 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0018.cpp @@ -0,0 +1,26 @@ +// inheritance circle + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClass2 : public MyClass { + public: + virtual void foo() override {} // TODO core cump if override is missing +}; + +class MyClassDerive : public MyClass, public MyClass2 { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass mc; + MyClassDerive mcd; + mc.foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0018.gtmcg b/tools/cage/test/input/virtualCalls/0018.gtmcg new file mode 100644 index 00000000..193766e8 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0018.gtmcg @@ -0,0 +1,183 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZN8MyClass23fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "_ZN8MyClass23fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv", + "_ZThn8_N13MyClassDerive3fooEv" + ], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv", + "_ZN8MyClass23fooEv" + ] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 4 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN7MyClass3fooEv": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 1 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0019.cpp b/tools/cage/test/input/virtualCalls/0019.cpp new file mode 100644 index 00000000..2b207414 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0019.cpp @@ -0,0 +1,22 @@ +// call to overwritten function by pointer of base class + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClass* mc; + MyClassDerive mcd; + mc = &mcd; + mc->foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0019.gtmcg b/tools/cage/test/input/virtualCalls/0019.gtmcg new file mode 100644 index 00000000..3059d694 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0019.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN7MyClass3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0020.cpp b/tools/cage/test/input/virtualCalls/0020.cpp new file mode 100644 index 00000000..f7a69ee6 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0020.cpp @@ -0,0 +1,22 @@ +// call to overwritten function by pointer of current class + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClassDerive* mc; + MyClassDerive mcd; + mc = &mcd; + mc->foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0020.gtmcg b/tools/cage/test/input/virtualCalls/0020.gtmcg new file mode 100644 index 00000000..be2bd5cf --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0020.gtmcg @@ -0,0 +1,68 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN13MyClassDerive3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0021.cpp b/tools/cage/test/input/virtualCalls/0021.cpp new file mode 100644 index 00000000..20162760 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0021.cpp @@ -0,0 +1,27 @@ +// call to overwritten function by pointer of middle class + +class MyClass { + public: + virtual void foo() {} +}; + +class MyClassDerive : public MyClass { + public: + void foo() override; +}; + +class MyClassDeriveDerive : public MyClassDerive { + public: + void foo() override {}; +}; + +void MyClassDerive::foo() {} + +int main(int argc, char* argv[]) { + MyClassDerive* mc; + MyClassDeriveDerive mcd; + mc = &mcd; + mc->foo(); + + return 0; +} diff --git a/tools/cage/test/input/virtualCalls/0021.gtmcg b/tools/cage/test/input/virtualCalls/0021.gtmcg new file mode 100644 index 00000000..4668bd60 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0021.gtmcg @@ -0,0 +1,88 @@ +{ + "_CG": { + "_ZN13MyClassDerive3fooEv": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN19MyClassDeriveDerive3fooEv" + ], + "overrides": [ + "_ZN7MyClass3fooEv" + ] + }, + "_ZN19MyClassDeriveDerive3fooEv": { + "callees": [], + "callers": [], + "doesOverride": true, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [ + "_ZN13MyClassDerive3fooEv" + ] + }, + "_ZN7MyClass3fooEv": { + "callees": [], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", + "systemInclude": false + }, + "numStatements": 0 + }, + "overriddenBy": [ + "_ZN13MyClassDerive3fooEv" + ], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN13MyClassDerive3fooEv" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", + "systemInclude": false + }, + "numStatements": 5 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", + "version": "0.2" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/input/virtualCalls/0022.cpp b/tools/cage/test/input/virtualCalls/0022.cpp new file mode 100644 index 00000000..e3bcd764 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0022.cpp @@ -0,0 +1,32 @@ +// Test for checking that functions in uninstantiated templates do not get included into the callgraph and to check the +// name mangling of virtual functions in classes that depend on template parameters. +template +class BaseUnused { + public: + virtual void bad1() {} +}; + +template +class ChildUnused : public BaseUnused { + public: + virtual void bad2() {} +}; + +template +class BaseUsed { + public: + virtual void good1() {} +}; + +template +class ChildUsed : public BaseUsed { + public: + virtual void good2() {} +}; + +int main() { + ChildUsed var; + var.good1(); + var.good2(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0022.gtmcg b/tools/cage/test/input/virtualCalls/0022.gtmcg new file mode 100644 index 00000000..30a3ff30 --- /dev/null +++ b/tools/cage/test/input/virtualCalls/0022.gtmcg @@ -0,0 +1,112 @@ +{ + "_CG": { + "_ZN8BaseUsedIiE5good1Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "_ZN9ChildUsedIiE5good2Ev": { + "callees": [], + "callers": [ + "main" + ], + "doesOverride": false, + "hasBody": true, + "isVirtual": true, + "meta": { + "codeStatistics": { + "numVars": 0 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": {}, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 0, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 0 + }, + "numStatements": 0 + }, + "overriddenBy": [], + "overrides": [] + }, + "main": { + "callees": [ + "_ZN8BaseUsedIiE5good1Ev", + "_ZN9ChildUsedIiE5good2Ev" + ], + "callers": [], + "doesOverride": false, + "hasBody": true, + "isVirtual": false, + "meta": { + "codeStatistics": { + "numVars": 1 + }, + "fileProperties": { + "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", + "systemInclude": false + }, + "globalLoopDepth": 0, + "loopCallDepth": { + "_ZN8BaseUsedIiE5good1Ev": 0, + "_ZN9ChildUsedIiE5good2Ev": 0 + }, + "loopDepth": 0, + "mallocCollector": [], + "numConditionalBranches": 0, + "numOperations": { + "numberOfControlFlowOps": 7, + "numberOfFloatOps": 0, + "numberOfIntOps": 0, + "numberOfMemoryAccesses": 2 + }, + "numStatements": 4 + }, + "overriddenBy": [], + "overrides": [] + } + }, + "_MetaCG": { + "generator": { + "name": "CGCollector", + "sha": "0087ee2b3f0bb856239a64cb407a4c6e81699b8b", + "version": "0.4" + }, + "version": "2.0" + } +} diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in new file mode 100755 index 00000000..e55848b6 --- /dev/null +++ b/tools/cage/test/runCaGeTests.sh.in @@ -0,0 +1,234 @@ +!/usr/bin/env bash + +test_src_dir="@TEST_SRC_DIR@" +mcgconfig="@METACG_CONFIG@" +build_dir="@CMAKE_BINARY_DIR@" +cgdiff="$build_dir/tools/cgdiff/cgdiff" +cgmerge="$build_dir/tools/cgmerge2/cgmerge2" + +mkdir -p log + +# Run single source test case. +# Param 1: Path to the test case. +# Param 2: Extra compile flags. +function runSingleTUTest { + testCaseFile=$1 + addFlags=$2 + fail=0 + + # Set up the different data files, we need: + # - The test case + # - The groundtruth data for reconciling the CG constructed by MetaCG + tfile=$testCaseFile + tfilename=$(basename "$tfile") + + run_dir=$(dirname $(realpath --relative-to="$test_src_dir" "$tfile")) + mkdir -p $run_dir + + cg_outfilename=${tfilename/cpp/mcg} + cg_outfile="$run_dir/$cg_outfilename" + + cg_gtfile=${tfile/cpp/gtmcg} + + CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -- >>log/testrun.log 2>&1 + + "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -- >>log/testrun.log 2>&1 + fail=$? + + return $fail +} + +#function applyFileFormatTwoToMultiTU { +# fail=0 +# tc=$1 +# taFile=${tc}_a.cpp +# tbFile=${tc}_b.cpp +# +# # Result files +# ipcgTaFile="${taFile/cpp/ipcg}" +# ipcgTbFile="${tbFile/cpp/ipcg}" +# +# # Groundtruth files +# gtaFile="${taFile/cpp/gtmcg}" +# gtbFile="${tbFile/cpp/gtmcg}" +# gtCombFile="${tc}_combined.gtmcg" +# +# # Translation-unit-local +# # TODO: Ground truths currently only include numStatements metadata. Tests for old cgcollector also have fileProperties. +# # What should be the general MD set tested here? +# # +# $cgcollectorExe --NumStatements --OverrideMD --whole-program ./input/multiTU/$taFile -- >>log/testrun.log 2>&1 +# $cgcollectorExe --NumStatements --OverrideMD --whole-program ./input/multiTU/$tbFile -- >>log/testrun.log 2>&1 +# +# cat ./input/multiTU/${ipcgTaFile} | python3 -m json.tool >./input/multiTU/${ipcgTaFile}_ +# mv ./input/multiTU/${ipcgTaFile}_ ./input/multiTU/${ipcgTaFile} +# cat ./input/multiTU/${ipcgTbFile} | python3 -m json.tool >./input/multiTU/${ipcgTbFile}_ +# mv ./input/multiTU/${ipcgTbFile}_ ./input/multiTU/${ipcgTbFile} +# +# $testerExe ./input/multiTU/${ipcgTaFile} ./input/multiTU/${gtaFile} >>log/testrun.log 2>&1 +# aErr=$? +# $testerExe ./input/multiTU/${ipcgTbFile} ./input/multiTU/${gtbFile} >>log/testrun.log 2>&1 +# bErr=$? +# +# combFile=${tc}_combined.ipcg +# echo "null" >./input/multiTU/${combFile} +# +# ${cgmergeExe} ./input/multiTU/${combFile} ./input/multiTU/${ipcgTaFile} ./input/multiTU/${ipcgTbFile} >>log/testrun.log 2>&1 +# mErr=$? +# +# cat ./input/multiTU/${combFile} | python3 -m json.tool >./input/multiTU/${combFile}_ +# mv ./input/multiTU/${combFile}_ ./input/multiTU/${combFile} +# +# ${testerExe} ./input/multiTU/${combFile} ./input/multiTU/${gtCombFile} >>log/testrun.log 2>&1 +# cErr=$? +# +# echo "$aErr or $bErr or $mErr or $cErr" +# +# if [[ ${aErr} -ne 0 || ${bErr} -ne 0 || ${mErr} -ne 0 || ${cErr} -ne 0 ]]; then +# echo "Failure for file: $combFile. Keeping generated file for inspection" +# fail=$((fail + 1)) +# else +# #echo "Success for file: $combFile. Deleting generated file" +# rm ./input/multiTU/$combFile ./input/multiTU/${ipcgTaFile} ./input/multiTU/${ipcgTbFile} +# fi +# return $fail +#} + +while getopts ":h" opt; do + case $opt in + h) + echo "use -h to print this help" + exit 0 + ;; + \?) + echo "Invalid option -$OPTARG" + exit 1 + ;; + esac +done + +#type -P $testerExe > /dev/null 2>&1 +#if [[ $? -eq 1 ]]; then +# echo "The CGSimpleTester2 binary (cgsimpletester2) could not be found in path, testing with relative path." +# stat ${PWD}/../../../${build_dir}/tools/cgcollector2/test/cgsimpletester2 >> log/testrun.log 2>&1 +# if [ $? -eq 1 ]; then +# echo "The file cgsimpletester2 seems also non-present in ../../../${build_dir}/tools/cgcollector2/test. Aborting test. Failure! Please build the tester first." +# exit 1 +# else +# testerExe=${PWD}/../../../${build_dir}/tools/cgcollector2/test/cgsimpletester2 +# fi +#fi + + +type -P $cgmerge > /dev/null 2>&1 +if [[ $? -eq 1 ]]; then + echo "No cgmerge2 in directory $(dirname $cgmerge)" + exit 1 +fi + +echo " --- Running single file tests ---" +echo " --- Running basic tests ---" +testGlob="$test_src_dir/input/singleTU/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + runSingleTUTest ${tc} "" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + +exit 0 + + +# Multi-file tests +multiTests=(0042 0043 0044 0050 0053 0060) + +fails=0 + +echo " --- Running single file tests [file format version 2.0]---" +echo " --- Running basic tests ---" +testGlob="./input/singleTU/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + +# Single File and full Ctor/Dtor coverage +echo -e "\n --- Running single file full ctor/dtor tests ---" +testGlob="./input/allCtorDtor/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + #we need to capture implicits here, as some calls are to implicit constructors/destructors + applyFileFormatTwoToSingleTU ${tc} "--capture-ctors-dtors --capture-new-delete-calls --capture-implicits --infer-ctors-dtors --whole-program --prune --NumStatements" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + +# Single File and for CXXRecordCalls +echo -e "\n --- Running single file CXXRecord call tests ---" +testGlob="./input/cxxRecordCalls/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + #we need to capture implicits here, as some calls are to implicit constructors/destructors + applyFileFormatTwoToSingleTU ${tc} "--capture-ctors-dtors --capture-new-delete-calls --capture-implicits --infer-ctors-dtors --whole-program --prune --NumStatements" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + + +# Single File and functionPointers +echo -e "\n --- Running single file functionPointers tests ---" +testGlob="./input/functionPointers/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + + + +# Single File metaCollectors +echo -e "\n --- Running single file metaCollectors tests ---" +testGlob="./input/metaCollectors/numStatements/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" + fail=$? + fails=$((fails + fail)) +done + +echo "Single file test failures: $fails" + +# Single File virtualCalls +echo -e "\n --- Running single file virtualCalls tests ---" +testGlob="./input/virtualCalls/*.cpp" +for tc in ${testGlob}; do + echo "Running test ${tc}" + applyFileFormatTwoToSingleTU ${tc} "--whole-program --capture-ctors-dtors --NumStatements --OverrideMD" + fail=$? + fails=$((fails + fail)) +done +echo "Single file test failures: $fails" + + +# Multi File +fails=0 +echo -e "\n --- Running multi file tests ---" +for tc in "${multiTests[@]}"; do + echo "Running test ${tc}" + # Input files + applyFileFormatTwoToMultiTU ${tc} "" + fail=$? + fails=$((fails + fail)) +done +echo "Multi file test failures: $fails" + +echo -e "$fails failures occured when running tests" +exit $fails diff --git a/tools/cage/test/runCageTests.sh b/tools/cage/test/runCageTests.sh deleted file mode 100644 index e24aec88..00000000 --- a/tools/cage/test/runCageTests.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -for testdir in ./*; do - -done \ No newline at end of file From dd7b37e6e4470d30604bf039682dce008d67dd18 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Tue, 16 Dec 2025 15:00:27 +0100 Subject: [PATCH 05/25] [WIP] Cage test cases --- tools/CMakeLists.txt | 2 +- .../cage/src/generator/CallGraphGenerator.cpp | 26 +- tools/cage/test/input/singleTU/0001.gtaacg | 90 --- tools/cage/test/input/singleTU/0001.gtipcg | 12 - tools/cage/test/input/singleTU/0002.gtaacg | 150 ---- tools/cage/test/input/singleTU/0002.gtipcg | 26 - tools/cage/test/input/singleTU/0003.gtaacg | 206 ------ tools/cage/test/input/singleTU/0003.gtipcg | 40 - tools/cage/test/input/singleTU/0004.cpp | 1 + tools/cage/test/input/singleTU/0004.gtaacg | 156 ---- tools/cage/test/input/singleTU/0004.gtipcg | 22 - tools/cage/test/input/singleTU/0005.gtaacg | 208 ------ tools/cage/test/input/singleTU/0005.gtipcg | 39 - tools/cage/test/input/singleTU/0013.cpp | 1 + tools/cage/test/input/singleTU/0013.gtaacg | 266 ------- tools/cage/test/input/singleTU/0013.gtipcg | 53 -- tools/cage/test/input/singleTU/0014.gtaacg | 266 ------- tools/cage/test/input/singleTU/0014.gtipcg | 56 -- tools/cage/test/input/singleTU/0022.gtaacg | 103 --- tools/cage/test/input/singleTU/0022.gtipcg | 12 - tools/cage/test/input/singleTU/0063.gtaacg | 59 -- tools/cage/test/input/singleTU/0063.gtipcg | 1 - tools/cage/test/input/singleTU/0063.gtmcg | 2 +- tools/cage/test/input/singleTU/0065.gtaacg | 269 ------- tools/cage/test/input/singleTU/0065.gtipcg | 52 -- tools/cage/test/input/singleTU/0066.gtaacg | 209 ------ tools/cage/test/input/singleTU/0066.gtipcg | 39 - tools/cage/test/input/singleTU/0066.gtmcg | 35 +- tools/cage/test/input/singleTU/0215.gtaacg | 156 ---- tools/cage/test/input/singleTU/0215.gtipcg | 29 - tools/cage/test/input/singleTU/0221.gtaacg | 93 --- tools/cage/test/input/singleTU/0221.gtipcg | 12 - tools/cage/test/input/singleTU/0222.gtaacg | 87 --- tools/cage/test/input/singleTU/0222.gtipcg | 12 - tools/cage/test/input/singleTU/0223.gtaacg | 147 ---- tools/cage/test/input/singleTU/0223.gtipcg | 26 - tools/cage/test/input/singleTU/0224.gtaacg | 198 ----- tools/cage/test/input/singleTU/0224.gtipcg | 40 - tools/cage/test/input/singleTU/0225.cpp | 1 + tools/cage/test/input/singleTU/0225.gtaacg | 507 ------------- tools/cage/test/input/singleTU/0225.gtipcg | 116 --- tools/cage/test/input/singleTU/0226.gtaacg | 181 ----- tools/cage/test/input/singleTU/0226.gtipcg | 22 - tools/cage/test/input/singleTU/0227.gtaacg | 172 ----- tools/cage/test/input/singleTU/0227.gtipcg | 22 - tools/cage/test/input/singleTU/0228.gtaacg | 84 --- tools/cage/test/input/singleTU/0228.gtipcg | 12 - tools/cage/test/input/singleTU/0230.gtaacg | 416 ----------- tools/cage/test/input/singleTU/0230.gtipcg | 39 - tools/cage/test/input/singleTU/0232.gtaacg | 542 -------------- tools/cage/test/input/singleTU/0232.gtipcg | 62 -- tools/cage/test/input/singleTU/0233.gtaacg | 220 ------ tools/cage/test/input/singleTU/0233.gtipcg | 12 - tools/cage/test/input/singleTU/0234.gtaacg | 542 -------------- tools/cage/test/input/singleTU/0234.gtipcg | 69 -- tools/cage/test/input/singleTU/0235.gtaacg | 344 --------- tools/cage/test/input/singleTU/0235.gtipcg | 42 -- tools/cage/test/input/singleTU/0237.gtaacg | 684 ------------------ tools/cage/test/input/singleTU/0237.gtipcg | 66 -- tools/cage/test/runCaGeTests.sh.in | 27 +- 60 files changed, 44 insertions(+), 7339 deletions(-) delete mode 100644 tools/cage/test/input/singleTU/0001.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0001.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0002.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0002.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0003.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0003.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0004.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0004.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0005.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0005.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0013.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0013.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0014.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0014.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0022.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0022.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0063.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0063.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0065.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0065.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0066.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0066.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0215.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0215.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0221.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0221.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0222.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0222.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0223.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0223.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0224.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0224.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0225.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0225.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0226.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0226.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0227.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0227.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0228.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0228.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0230.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0230.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0232.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0232.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0233.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0233.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0234.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0234.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0235.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0235.gtipcg delete mode 100644 tools/cage/test/input/singleTU/0237.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0237.gtipcg diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 42032916..cf75684d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -add_subdirectory(cgcollector2) +#add_subdirectory(cgcollector2) add_subdirectory(cgmerge2) add_subdirectory(cgconvert) add_subdirectory(cgformat) diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 16ded915..61f1af24 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -52,6 +52,11 @@ struct CallBaseVisitor : public llvm::InstVisitor { } } + ~CallBaseVisitor() { + + errs() << "CBV destroyed\n"; + } + void visitCallBase(llvm::CallBase& I) { if (I.getCalledFunction() != nullptr && I.getCalledFunction()->isIntrinsic()) return; @@ -80,6 +85,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { void visitFunction(llvm::Function& F) { if (F.isIntrinsic()) return; + llvm::outs() << "Processing function " << F.getName() << "\n"; const std::string& funcName = F.getName().str(); metacg::CgNode& currentNode = (metaDataAvail && functionInfoMap[&F] != nullptr ? mcg->getOrInsertNode(funcName, functionInfoMap[&F]->getFilename().str()) @@ -136,18 +142,20 @@ struct CallBaseVisitor : public llvm::InstVisitor { }; bool Generator::run(Module& M, ModuleAnalysisManager* MA) { - auto& cgResult = MA->getResult(M); - auto cbv = CallBaseVisitor(&cgResult); - cbv.visit(M); + { + auto& cgResult = MA->getResult(M); + auto cbv = CallBaseVisitor(&cgResult); + cbv.visit(M); - // Take resulting metacg call graph - auto mcg = cbv.takeResult(); + // Take resulting metacg call graph + auto mcg = cbv.takeResult(); - // Run registered consumers - for (auto& consumer : consumers) { - consumer->consumeCallGraph(*mcg); - } + // Run registered consumers + for (auto& consumer : consumers) { + consumer->consumeCallGraph(*mcg); + } + } return false; } } // namespace cage diff --git a/tools/cage/test/input/singleTU/0001.gtaacg b/tools/cage/test/input/singleTU/0001.gtaacg deleted file mode 100644 index 7f3010a8..00000000 --- a/tools/cage/test/input/singleTU/0001.gtaacg +++ /dev/null @@ -1,90 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0001.cpp@39@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0001.cpp@29@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0001.cpp@29@F@main#I#**C#@argc", - "c:0001.cpp@39@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0001.gtipcg b/tools/cage/test/input/singleTU/0001.gtipcg deleted file mode 100644 index eac296b2..00000000 --- a/tools/cage/test/input/singleTU/0001.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0002.gtaacg b/tools/cage/test/input/singleTU/0002.gtaacg deleted file mode 100644 index 4c494421..00000000 --- a/tools/cage/test/input/singleTU/0002.gtaacg +++ /dev/null @@ -1,150 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0002.cpp@54@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0002.cpp@44@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@72-76", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0002.cpp@44@F@main#I#**C#@argc", - "c:0002.cpp@54@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0002.gtipcg b/tools/cage/test/input/singleTU/0002.gtipcg deleted file mode 100644 index d03fe785..00000000 --- a/tools/cage/test/input/singleTU/0002.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0003.gtaacg b/tools/cage/test/input/singleTU/0003.gtaacg deleted file mode 100644 index fe6222ef..00000000 --- a/tools/cage/test/input/singleTU/0003.gtaacg +++ /dev/null @@ -1,206 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0003.cpp@97@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0003.cpp@87@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@115-119", - "c:@F@foo#@CALL_EXPR@@68-72", - "c:@F@bar#@SRETURN", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@CALL_EXPR@@68-72", - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0003.cpp@87@F@main#I#**C#@argc", - "c:0003.cpp@97@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [ - "_Z3barv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3barv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0003.gtipcg b/tools/cage/test/input/singleTU/0003.gtipcg deleted file mode 100644 index 9a92c025..00000000 --- a/tools/cage/test/input/singleTU/0003.gtipcg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_Z3barv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z3foov" - ] - }, - "_Z3foov": { - "callees": [ - "_Z3barv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0004.cpp b/tools/cage/test/input/singleTU/0004.cpp index 772eeeb3..16f30fce 100644 --- a/tools/cage/test/input/singleTU/0004.cpp +++ b/tools/cage/test/input/singleTU/0004.cpp @@ -1,6 +1,7 @@ // no call // but a second function +__attribute__((retain)) int foo() { int a = 0; for (int i = 0; i < 5; ++i) { diff --git a/tools/cage/test/input/singleTU/0004.gtaacg b/tools/cage/test/input/singleTU/0004.gtaacg deleted file mode 100644 index 44cfc3ad..00000000 --- a/tools/cage/test/input/singleTU/0004.gtaacg +++ /dev/null @@ -1,156 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0004.cpp@69@F@foo#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0004.cpp@51@F@foo#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0004.cpp@144@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0004.cpp@134@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0004.cpp@51@F@foo#@a", - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0004.cpp@134@F@main#I#**C#@argc", - "c:0004.cpp@144@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0004.gtipcg b/tools/cage/test/input/singleTU/0004.gtipcg deleted file mode 100644 index 3cec1ddc..00000000 --- a/tools/cage/test/input/singleTU/0004.gtipcg +++ /dev/null @@ -1,22 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0005.gtaacg b/tools/cage/test/input/singleTU/0005.gtaacg deleted file mode 100644 index 91bd13d0..00000000 --- a/tools/cage/test/input/singleTU/0005.gtaacg +++ /dev/null @@ -1,208 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@childTwo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@childOne#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0005.cpp@97@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0005.cpp@107@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@125-134", - "c:@F@childOne#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@139-148", - "c:@F@childTwo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@childOne#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8childOnev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@childOne#@SRETURN" - ] - }, - "c:@F@childTwo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8childTwov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@childTwo#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0005.cpp@97@F@main#I#**C#@argc", - "c:0005.cpp@107@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@childOne#": "c:@F@childOne#", - "c:@F@childTwo#": "c:@F@childTwo#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z8childOnev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8childTwov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8childOnev", - "_Z8childTwov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z8childOnev": 0, - "_Z8childTwov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0005.gtipcg b/tools/cage/test/input/singleTU/0005.gtipcg deleted file mode 100644 index 74604dad..00000000 --- a/tools/cage/test/input/singleTU/0005.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z8childOnev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z8childTwov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z8childOnev", - "_Z8childTwov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0013.cpp b/tools/cage/test/input/singleTU/0013.cpp index 4edfb4bc..eb9f6337 100644 --- a/tools/cage/test/input/singleTU/0013.cpp +++ b/tools/cage/test/input/singleTU/0013.cpp @@ -4,6 +4,7 @@ int lastChild() { return 1; } int middle() { return lastChild(); } +__attribute__((retain)) int middle2() { return lastChild(); } int main(int argc, char* argv[]) { diff --git a/tools/cage/test/input/singleTU/0013.gtaacg b/tools/cage/test/input/singleTU/0013.gtaacg deleted file mode 100644 index 80d2380b..00000000 --- a/tools/cage/test/input/singleTU/0013.gtaacg +++ /dev/null @@ -1,266 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@middle2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@middle2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@middle#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@lastChild#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0013.cpp@158@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0013.cpp@148@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@176-183", - "c:@F@middle2#@CALL_EXPR@@123-133", - "c:@F@middle#@CALL_EXPR@@84-94", - "c:@F@lastChild#@SRETURN", - "c:@F@middle#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@lastChild#": { - "IsVariadic": false, - "MangledNames": [ - "_Z9lastChildv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@lastChild#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0013.cpp@148@F@main#I#**C#@argc", - "c:0013.cpp@158@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - }, - "c:@F@middle#": { - "IsVariadic": false, - "MangledNames": [ - "_Z6middlev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@middle#@CALL_EXPR@@84-94", - "c:@F@middle#@SRETURN" - ] - }, - "c:@F@middle2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z7middle2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@middle2#@CALL_EXPR@@123-133", - "c:@F@middle2#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@lastChild#": "c:@F@lastChild#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#", - "c:@F@middle#": "c:@F@middle#", - "c:@F@middle2#": "c:@F@middle2#" - } - }, - "_CG": { - "_Z6middlev": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z9lastChildv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z9lastChildv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9lastChildv": { - "callees": [], - "callers": [ - "_Z6middlev", - "_Z7middle2v" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z6middlev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z6middlev": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0013.gtipcg b/tools/cage/test/input/singleTU/0013.gtipcg deleted file mode 100644 index 860a536d..00000000 --- a/tools/cage/test/input/singleTU/0013.gtipcg +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_Z6middlev": { - "callees": [ - "_Z9lastChildv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z9lastChildv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z6middlev", - "_Z7middle2v" - ] - }, - "main": { - "callees": [ - "_Z6middlev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0014.gtaacg b/tools/cage/test/input/singleTU/0014.gtaacg deleted file mode 100644 index fea1ab80..00000000 --- a/tools/cage/test/input/singleTU/0014.gtaacg +++ /dev/null @@ -1,266 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@middle2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@middle#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@lastChild#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0014.cpp@156@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0014.cpp@146@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@186-196", - "c:@F@main#I#**C#@CALL_EXPR@@174-181", - "c:@F@middle#@CALL_EXPR@@123-131", - "c:@F@middle2#@CALL_EXPR@@85-95", - "c:@F@lastChild#@SRETURN", - "c:@F@middle2#@SRETURN", - "c:@F@middle#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@lastChild#": { - "IsVariadic": false, - "MangledNames": [ - "_Z9lastChildv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@lastChild#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0014.cpp@146@F@main#I#**C#@argc", - "c:0014.cpp@156@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - }, - "c:@F@middle#": { - "IsVariadic": false, - "MangledNames": [ - "_Z6middlev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@middle#@CALL_EXPR@@123-131", - "c:@F@middle#@SRETURN" - ] - }, - "c:@F@middle2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z7middle2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@middle2#@CALL_EXPR@@85-95", - "c:@F@middle2#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@lastChild#": "c:@F@lastChild#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#", - "c:@F@middle#": "c:@F@middle#", - "c:@F@middle2#": "c:@F@middle2#" - } - }, - "_CG": { - "_Z6middlev": { - "callees": [ - "_Z7middle2v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z7middle2v": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [ - "_Z6middlev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z9lastChildv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9lastChildv": { - "callees": [], - "callers": [ - "_Z7middle2v", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z6middlev", - "_Z9lastChildv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z6middlev": 0, - "_Z9lastChildv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0014.gtipcg b/tools/cage/test/input/singleTU/0014.gtipcg deleted file mode 100644 index 24087f4b..00000000 --- a/tools/cage/test/input/singleTU/0014.gtipcg +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_Z6middlev": { - "callees": [ - "_Z7middle2v" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z6middlev" - ] - }, - "_Z9lastChildv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z7middle2v", - "main" - ] - }, - "main": { - "callees": [ - "_Z6middlev", - "_Z9lastChildv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0022.gtaacg b/tools/cage/test/input/singleTU/0022.gtaacg deleted file mode 100644 index cd899b15..00000000 --- a/tools/cage/test/input/singleTU/0022.gtaacg +++ /dev/null @@ -1,103 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0022.cpp@51@F@main#I#**C#@b" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0022.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0022.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0022.cpp@65@F@main#I#**C#@k", - "c:0022.cpp@38@F@main#I#**C#@a" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0022.cpp@11@F@main#I#**C#@argc", - "c:0022.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0022.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0022.gtipcg b/tools/cage/test/input/singleTU/0022.gtipcg deleted file mode 100644 index f055fa7b..00000000 --- a/tools/cage/test/input/singleTU/0022.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0063.gtaacg b/tools/cage/test/input/singleTU/0063.gtaacg deleted file mode 100644 index c774a245..00000000 --- a/tools/cage/test/input/singleTU/0063.gtaacg +++ /dev/null @@ -1,59 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@on_exit#*Fv(#I#*v)#S2_#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@on_exit#*Fv(#I#*v)#S2_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0063.cpp@220@F@on_exit#*Fv(#I#*v)#S2_#@__arg" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0063.cpp@177@F@on_exit#*Fv(#I#*v)#S2_#@__func" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@on_exit#*Fv(#I#*v)#S2_#": { - "IsVariadic": false, - "MangledNames": [ - "_Z7on_exitPFviPvES_" - ], - "Parameters": [ - "c:0063.cpp@177@F@on_exit#*Fv(#I#*v)#S2_#@__func", - "c:0063.cpp@220@F@on_exit#*Fv(#I#*v)#S2_#@__arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@on_exit#*Fv(#I#*v)#S2_#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@on_exit#*Fv(#I#*v)#S2_#": "c:@F@on_exit#*Fv(#I#*v)#S2_#" - } - }, - "_CG": null, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0063.gtipcg b/tools/cage/test/input/singleTU/0063.gtipcg deleted file mode 100644 index 19765bd5..00000000 --- a/tools/cage/test/input/singleTU/0063.gtipcg +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/tools/cage/test/input/singleTU/0063.gtmcg b/tools/cage/test/input/singleTU/0063.gtmcg index d67afea2..ab557002 100644 --- a/tools/cage/test/input/singleTU/0063.gtmcg +++ b/tools/cage/test/input/singleTU/0063.gtmcg @@ -1,5 +1,5 @@ { - "_CG": null, + "_CG": {}, "_MetaCG": { "generator": { "name": "CGCollector", diff --git a/tools/cage/test/input/singleTU/0065.gtaacg b/tools/cage/test/input/singleTU/0065.gtaacg deleted file mode 100644 index 4399889f..00000000 --- a/tools/cage/test/input/singleTU/0065.gtaacg +++ /dev/null @@ -1,269 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#I#**C#@CALL_EXPR@@348-353": "c:@F@main#I#**C#" - }, - "CallInfoMap": { - "c:@F@main#I#**C#@CALL_EXPR@@348-353": { - "Arguments": [], - "CalledObjects": [ - "c:0065.cpp@319@F@main#I#**C#@func" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func_ptr#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0065.cpp@275@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0065.cpp@265@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0065.cpp@152@F@get_func_ptr#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0065.cpp@319@F@main#I#**C#@func", - "c:@F@main#I#**C#@CALL_EXPR@@329-343", - "c:@F@func1#", - "c:@F@func2#", - "c:@F@get_func_ptr#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@348-353", - "c:@F@func1#@SRETURN", - "c:@F@func2#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@func1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func1#@SRETURN" - ] - }, - "c:@F@func2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func2#@SRETURN" - ] - }, - "c:@F@get_func_ptr#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z12get_func_ptri" - ], - "Parameters": [ - "c:0065.cpp@152@F@get_func_ptr#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@func1#", - "c:@F@func2#", - "c:@F@get_func_ptr#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0065.cpp@265@F@main#I#**C#@argc", - "c:0065.cpp@275@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@func1#": "c:@F@func1#", - "c:@F@func2#": "c:@F@func2#", - "c:@F@get_func_ptr#I#": "c:@F@get_func_ptr#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z12get_func_ptri": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func1v": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func2v": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z12get_func_ptri", - "_Z5func1v", - "_Z5func2v" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z12get_func_ptri": 0, - "_Z5func1v": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0065.gtipcg b/tools/cage/test/input/singleTU/0065.gtipcg deleted file mode 100644 index a7a35830..00000000 --- a/tools/cage/test/input/singleTU/0065.gtipcg +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_Z12get_func_ptri": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5func1v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5func2v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z12get_func_ptri", - "_Z5func1v", - "_Z5func2v" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0066.gtaacg b/tools/cage/test/input/singleTU/0066.gtaacg deleted file mode 100644 index b0c661c9..00000000 --- a/tools/cage/test/input/singleTU/0066.gtaacg +++ /dev/null @@ -1,209 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@__builtin_expect@UNNAMED_PARAM@1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@__builtin_expect" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@__builtin_expect@UNNAMED_PARAM@0", - "c:0066.cpp@78@F@main#@x" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@95-116", - "c:@F@__builtin_expect@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@123-127", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@__builtin_expect": { - "IsVariadic": false, - "MangledNames": [ - "__builtin_expect" - ], - "Parameters": [ - "c:@F@__builtin_expect@UNNAMED_PARAM@0", - "c:@F@__builtin_expect@UNNAMED_PARAM@1" - ], - "ReferencedInReturnStmts": [ - "c:@F@__builtin_expect@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@__builtin_expect": "c:@F@__builtin_expect", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "__builtin_expect": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "__builtin_expect" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "__builtin_expect": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0066.gtipcg b/tools/cage/test/input/singleTU/0066.gtipcg deleted file mode 100644 index 722468d0..00000000 --- a/tools/cage/test/input/singleTU/0066.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "__builtin_expect": { - "callees": [], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov", - "__builtin_expect" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0066.gtmcg b/tools/cage/test/input/singleTU/0066.gtmcg index 187cea4f..554aa353 100644 --- a/tools/cage/test/input/singleTU/0066.gtmcg +++ b/tools/cage/test/input/singleTU/0066.gtmcg @@ -32,42 +32,9 @@ "overriddenBy": [], "overrides": [] }, - "__builtin_expect": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, "main": { "callees": [ - "_Z3foov", - "__builtin_expect" + "_Z3foov" ], "callers": [], "doesOverride": false, diff --git a/tools/cage/test/input/singleTU/0215.gtaacg b/tools/cage/test/input/singleTU/0215.gtaacg deleted file mode 100644 index 2dfd23dc..00000000 --- a/tools/cage/test/input/singleTU/0215.gtaacg +++ /dev/null @@ -1,156 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0215.cpp@18@F@foo#I#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@97-103", - "c:@F@foo#I#@CALL_EXPR@@71-76", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0215.cpp@18@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@CALL_EXPR@@71-76", - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [ - "_Z3fooi" - ], - "callers": [ - "_Z3fooi", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0215.gtipcg b/tools/cage/test/input/singleTU/0215.gtipcg deleted file mode 100644 index 54845ef2..00000000 --- a/tools/cage/test/input/singleTU/0215.gtipcg +++ /dev/null @@ -1,29 +0,0 @@ -{ - "_Z3fooi": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z3fooi", - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0221.gtaacg b/tools/cage/test/input/singleTU/0221.gtaacg deleted file mode 100644 index 0df8b13c..00000000 --- a/tools/cage/test/input/singleTU/0221.gtaacg +++ /dev/null @@ -1,93 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0221.cpp@60@F@main#@b" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0221.cpp@31@F@main#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0221.cpp@157@F@main#@f" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0221.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 5, - "numOperations": { - "numberOfControlFlowOps": 9, - "numberOfFloatOps": 0, - "numberOfIntOps": 9, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0221.gtipcg b/tools/cage/test/input/singleTU/0221.gtipcg deleted file mode 100644 index 4d298c58..00000000 --- a/tools/cage/test/input/singleTU/0221.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 10, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0222.gtaacg b/tools/cage/test/input/singleTU/0222.gtaacg deleted file mode 100644 index 820d8e2d..00000000 --- a/tools/cage/test/input/singleTU/0222.gtaacg +++ /dev/null @@ -1,87 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@x" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0222.cpp@23@F@main#@f" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0222.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0222.gtipcg b/tools/cage/test/input/singleTU/0222.gtipcg deleted file mode 100644 index f465226c..00000000 --- a/tools/cage/test/input/singleTU/0222.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0223.gtaacg b/tools/cage/test/input/singleTU/0223.gtaacg deleted file mode 100644 index f86b26ec..00000000 --- a/tools/cage/test/input/singleTU/0223.gtaacg +++ /dev/null @@ -1,147 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@x" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@test#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0223.cpp@98@F@main#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@171-176", - "c:@F@test#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@test#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4testv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@test#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#", - "c:@F@test#": "c:@F@test#" - } - }, - "_CG": { - "_Z4testv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", - "systemInclude": false - }, - "globalLoopDepth": 2, - "loopCallDepth": { - "_Z4testv": 0 - }, - "loopDepth": 2, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0223.gtipcg b/tools/cage/test/input/singleTU/0223.gtipcg deleted file mode 100644 index 828e2a88..00000000 --- a/tools/cage/test/input/singleTU/0223.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z4testv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 8, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0224.gtaacg b/tools/cage/test/input/singleTU/0224.gtaacg deleted file mode 100644 index a74ebc46..00000000 --- a/tools/cage/test/input/singleTU/0224.gtaacg +++ /dev/null @@ -1,198 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@test2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@test#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0224.cpp@123@F@main#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@210-215", - "c:@F@main#@CALL_EXPR@@155-160", - "c:@F@test#@CALL_EXPR@@58-64", - "c:@F@test2#@SRETURN", - "c:@F@test#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@test#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4testv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@test#@CALL_EXPR@@58-64", - "c:@F@test#@SRETURN" - ] - }, - "c:@F@test2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5test2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@test2#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#", - "c:@F@test#": "c:@F@test#", - "c:@F@test2#": "c:@F@test2#" - } - }, - "_CG": { - "_Z4testv": { - "callees": [ - "_Z5test2v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z5test2v": 1 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5test2v": { - "callees": [], - "callers": [ - "_Z4testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z4testv": 2 - }, - "loopDepth": 2, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 9, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0224.gtipcg b/tools/cage/test/input/singleTU/0224.gtipcg deleted file mode 100644 index 8ccc357a..00000000 --- a/tools/cage/test/input/singleTU/0224.gtipcg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_Z4testv": { - "callees": [ - "_Z5test2v" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5test2v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4testv" - ] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 9, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0225.cpp b/tools/cage/test/input/singleTU/0225.cpp index 201378f1..e176bd5d 100644 --- a/tools/cage/test/input/singleTU/0225.cpp +++ b/tools/cage/test/input/singleTU/0225.cpp @@ -40,6 +40,7 @@ void loop() { } } +__attribute__((retain)) void entry() { while (true) { while (true) { diff --git a/tools/cage/test/input/singleTU/0225.gtaacg b/tools/cage/test/input/singleTU/0225.gtaacg deleted file mode 100644 index c7a3ff4f..00000000 --- a/tools/cage/test/input/singleTU/0225.gtaacg +++ /dev/null @@ -1,507 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@x#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@split#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@right#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@loop#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@left#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@leaf#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@entry#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@x#@CALL_EXPR@@76-81", - "c:@F@leaf#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@x#@CALL_EXPR@@86-91", - "c:@F@loop#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@right#@CALL_EXPR@@212-214", - "c:@F@left#@CALL_EXPR@@132-134", - "c:@F@x#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@split#@CALL_EXPR@@281-287", - "c:@F@right#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@entry#@CALL_EXPR@@412-417", - "c:@F@split#@CALL_EXPR@@271-276", - "c:@F@left#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@entry#@CALL_EXPR@@426-432", - "c:@F@entry#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@487-493", - "c:@F@loop#@CALL_EXPR@@328-334", - "c:@F@split#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@entry#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5entryv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@entry#@SRETURN" - ] - }, - "c:@F@leaf#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4leafv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@leaf#@SRETURN" - ] - }, - "c:@F@left#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4leftv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@left#@SRETURN" - ] - }, - "c:@F@loop#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4loopv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@loop#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@right#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5rightv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@right#@SRETURN" - ] - }, - "c:@F@split#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5splitv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@split#@SRETURN" - ] - }, - "c:@F@x#": { - "IsVariadic": false, - "MangledNames": [ - "_Z1xv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@x#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@entry#": "c:@F@entry#", - "c:@F@leaf#": "c:@F@leaf#", - "c:@F@left#": "c:@F@left#", - "c:@F@loop#": "c:@F@loop#", - "c:@F@main#": "c:@F@main#", - "c:@F@right#": "c:@F@right#", - "c:@F@split#": "c:@F@split#", - "c:@F@x#": "c:@F@x#" - } - }, - "_CG": { - "_Z1xv": { - "callees": [ - "_Z4leafv", - "_Z4loopv" - ], - "callers": [ - "_Z4leftv", - "_Z5rightv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z4leafv": 0, - "_Z4loopv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leafv": { - "callees": [], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leftv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5entryv", - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 4, - "loopCallDepth": { - "_Z1xv": 1 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4loopv": { - "callees": [ - "_Z5splitv" - ], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z5splitv": 1 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5entryv": { - "callees": [ - "_Z4leftv", - "_Z5entryv" - ], - "callers": [ - "_Z5entryv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 6, - "loopCallDepth": { - "_Z4leftv": 2, - "_Z5entryv": 2 - }, - "loopDepth": 2, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5rightv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z1xv": 2 - }, - "loopDepth": 2, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5splitv": { - "callees": [ - "_Z4leftv", - "_Z5rightv" - ], - "callers": [ - "_Z4loopv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z4leftv": 0, - "_Z5rightv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z5splitv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "globalLoopDepth": 3, - "loopCallDepth": { - "_Z5splitv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0225.gtipcg b/tools/cage/test/input/singleTU/0225.gtipcg deleted file mode 100644 index ede759dc..00000000 --- a/tools/cage/test/input/singleTU/0225.gtipcg +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_Z1xv": { - "callees": [ - "_Z4leafv", - "_Z4loopv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4leftv", - "_Z5rightv" - ] - }, - "_Z4leafv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z1xv" - ] - }, - "_Z4leftv": { - "callees": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z5entryv", - "_Z5splitv" - ] - }, - "_Z4loopv": { - "callees": [ - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z1xv" - ] - }, - "_Z5entryv": { - "callees": [ - "_Z4leftv", - "_Z5entryv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z5entryv" - ] - }, - "_Z5rightv": { - "callees": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z5splitv" - ] - }, - "_Z5splitv": { - "callees": [ - "_Z4leftv", - "_Z5rightv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4loopv", - "main" - ] - }, - "main": { - "callees": [ - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0226.gtaacg b/tools/cage/test/input/singleTU/0226.gtaacg deleted file mode 100644 index 65304333..00000000 --- a/tools/cage/test/input/singleTU/0226.gtaacg +++ /dev/null @@ -1,181 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@FI@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#*I#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#*I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@boo#$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@boo#$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0226.cpp@97@F@boo#$@S@A#@a" - ], - "Prefixes": [ - { - "Member": "c:@S@A@FI@a", - "Object": "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@a" - }, - { - "Member": "c:@S@A@FI@b", - "Object": "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b" - } - ] - }, - { - "Objects": [ - "c:0226.cpp@8@F@foo#*I#I#@arg" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0226.cpp@19@F@foo#*I#I#@offset" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b", - "c:@S@A@FI@b" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@boo#$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3boo1A" - ], - "Parameters": [ - "c:0226.cpp@97@F@boo#$@S@A#@a" - ], - "ReferencedInReturnStmts": [ - "(c:0226.cpp@97@F@boo#$@S@A#@a).c:@S@A@FI@b", - "c:@F@boo#$@S@A#@SRETURN" - ] - }, - "c:@F@foo#*I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooPii" - ], - "Parameters": [ - "c:0226.cpp@8@F@foo#*I#I#@arg", - "c:0226.cpp@19@F@foo#*I#I#@offset" - ], - "ReferencedInReturnStmts": [ - "c:0226.cpp@8@F@foo#*I#I#@arg", - "c:@F@foo#*I#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@boo#$@S@A#": "c:@F@boo#$@S@A#", - "c:@F@foo#*I#I#": "c:@F@foo#*I#I#" - } - }, - "_CG": { - "_Z3boo1A": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 3 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooPii": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0226.gtipcg b/tools/cage/test/input/singleTU/0226.gtipcg deleted file mode 100644 index b7348d76..00000000 --- a/tools/cage/test/input/singleTU/0226.gtipcg +++ /dev/null @@ -1,22 +0,0 @@ -{ - "_Z3boo1A": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z3fooPii": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0227.gtaacg b/tools/cage/test/input/singleTU/0227.gtaacg deleted file mode 100644 index 70fb2ccd..00000000 --- a/tools/cage/test/input/singleTU/0227.gtaacg +++ /dev/null @@ -1,172 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@h" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@baa#*f#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@baa#*f#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0227.cpp@86@F@baa#*f#I#@count" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0227.cpp@19@F@foo#f#I#@b" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0227.cpp@10@F@foo#f#I#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0227.cpp@106@F@baa#*f#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@g", - "c:0227.cpp@74@F@baa#*f#I#@arr" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@baa#*f#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3baaPfi" - ], - "Parameters": [ - "c:0227.cpp@74@F@baa#*f#I#@arr", - "c:0227.cpp@86@F@baa#*f#I#@count" - ], - "ReferencedInReturnStmts": [ - "c:@F@baa#*f#I#@SRETURN" - ] - }, - "c:@F@foo#f#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foofi" - ], - "Parameters": [ - "c:0227.cpp@10@F@foo#f#I#@a", - "c:0227.cpp@19@F@foo#f#I#@b" - ], - "ReferencedInReturnStmts": [ - "c:0227.cpp@10@F@foo#f#I#@a", - "c:@F@foo#f#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@baa#*f#I#": "c:@F@baa#*f#I#", - "c:@F@foo#f#I#": "c:@F@foo#f#I#" - } - }, - "_CG": { - "_Z3baaPfi": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 4, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 5 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foofi": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 2, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0227.gtipcg b/tools/cage/test/input/singleTU/0227.gtipcg deleted file mode 100644 index 582907db..00000000 --- a/tools/cage/test/input/singleTU/0227.gtipcg +++ /dev/null @@ -1,22 +0,0 @@ -{ - "_Z3baaPfi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z3foofi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0228.gtaacg b/tools/cage/test/input/singleTU/0228.gtaacg deleted file mode 100644 index 3c355773..00000000 --- a/tools/cage/test/input/singleTU/0228.gtaacg +++ /dev/null @@ -1,84 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:0228.cpp@F@__uint16_identity#s#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0228.cpp@F@__uint16_identity#s#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0228.cpp@300@F@__uint16_identity#s#@__x" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:0228.cpp@F@__uint16_identity#s#": { - "IsVariadic": false, - "MangledNames": [ - "_ZL17__uint16_identityt" - ], - "Parameters": [ - "c:0228.cpp@300@F@__uint16_identity#s#@__x" - ], - "ReferencedInReturnStmts": [ - "c:0228.cpp@300@F@__uint16_identity#s#@__x", - "c:0228.cpp@F@__uint16_identity#s#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0228.cpp@F@__uint16_identity#s#": "c:0228.cpp@F@__uint16_identity#s#" - } - }, - "_CG": { - "_ZL17__uint16_identityt": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0228.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0228.gtipcg b/tools/cage/test/input/singleTU/0228.gtipcg deleted file mode 100644 index 2c2aab99..00000000 --- a/tools/cage/test/input/singleTU/0228.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "_ZL17__uint16_identityt": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0230.gtaacg b/tools/cage/test/input/singleTU/0230.gtaacg deleted file mode 100644 index f5b0ad25..00000000 --- a/tools/cage/test/input/singleTU/0230.gtaacg +++ /dev/null @@ -1,416 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@308-310": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@308-310": { - "Arguments": [], - "CalledObjects": [ - "c:0230.cpp@275@F@main#@b" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0230.cpp@243@F@main#@a).c:@S@A@F@memberFunction#", - "c:@S@A@F@memberFunction#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0230.cpp@275@F@main#@b", - "(c:0230.cpp@243@F@main#@a).c:@S@A@FI@member", - "c:@F@main#@CALL_EXPR@@286-303", - "(*c:@S@A@F@memberFunction#@THIS).c:@S@A@FI@member", - "c:@S@A@F@memberFunction#@SRETURN", - "c:@S@A@FI@member", - "&c:@F@f#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@f#" - } - ] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@308-310", - "c:@F@f#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@245-245" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@245-245" - } - ] - }, - { - "Objects": [ - "c:0230.cpp@151@S@A@F@memberFunction#@p", - "c:@S@A@F@memberFunction#@THIS", - "&c:0230.cpp@243@F@main#@a" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@A@F@memberFunction#@THIS" - } - ] - }, - { - "Objects": [ - "c:0230.cpp@243@F@main#@a", - "c:@F@main#@CALL_EXPR@@245-245", - "*c:@S@A@F@memberFunction#@THIS" - ], - "Prefixes": [ - { - "Member": "c:@S@A@F@memberFunction#", - "Object": "(c:0230.cpp@243@F@main#@a).c:@S@A@F@memberFunction#" - }, - { - "Member": "c:@S@A@FI@member", - "Object": "(c:0230.cpp@243@F@main#@a).c:@S@A@FI@member" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@f#": { - "IsVariadic": false, - "MangledNames": [ - "_Z1fv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@f#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@memberFunction#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1A14memberFunctionEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "(*c:@S@A@F@memberFunction#@THIS).c:@S@A@FI@member", - "c:@S@A@F@memberFunction#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@F@f#": "c:@F@f#", - "c:@F@f#": "c:@F@f#", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", - "c:@S@A@F@memberFunction#": "c:@S@A@F@memberFunction#" - } - }, - "_CG": { - "_Z1fv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A14memberFunctionEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z1fv", - "_ZN1A14memberFunctionEv", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1A14memberFunctionEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0230.gtipcg b/tools/cage/test/input/singleTU/0230.gtipcg deleted file mode 100644 index 6076ce75..00000000 --- a/tools/cage/test/input/singleTU/0230.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z1fv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1A14memberFunctionEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z1fv", - "_ZN1A14memberFunctionEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0232.gtaacg b/tools/cage/test/input/singleTU/0232.gtaacg deleted file mode 100644 index 4b259cdb..00000000 --- a/tools/cage/test/input/singleTU/0232.gtaacg +++ /dev/null @@ -1,542 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@S@X@F@~X#@CALL_EXPR@@200-209": "c:@S@X@F@~X#" - }, - "CallInfoMap": { - "c:@S@X@F@~X#@CALL_EXPR@@200-209": { - "Arguments": [], - "CalledObjects": [ - "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@X@F@~X#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@~X#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function", - "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function", - "c:@S@X@FI@function", - "c:0232.cpp@163@S@X@F@X#*Fv()#@arg", - "c:@F@func1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@~X#@CALL_EXPR@@200-209", - "c:@F@func1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#@THIS", - "&c:@F@main#@CALL_EXPR@@252-259" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@X@F@X#*Fv()#@THIS" - } - ] - }, - { - "Objects": [ - "c:@F@main#@NEW@248-259", - "c:@F@main#@CALL_EXPR@@252-259", - "*c:@S@X@F@X#*Fv()#@THIS" - ], - "Prefixes": [ - { - "Member": "c:@S@X@FI@function", - "Object": "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function" - } - ] - }, - { - "Objects": [ - "c:@S@X@F@~X#@THIS", - "&c:0232.cpp@233@F@main#@f" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@X@F@~X#@THIS" - } - ] - }, - { - "Objects": [ - "c:0232.cpp@233@F@main#@f", - "&c:@F@main#@NEW@248-259", - "*c:@S@X@F@~X#@THIS" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@NEW@248-259" - }, - { - "Member": "c:@S@X@FI@function", - "Object": "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@func1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func1#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@operator delete#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdlPv" - ], - "Parameters": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete#*v#@SRETURN" - ] - }, - "c:@F@operator delete[]#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdaPv" - ], - "Parameters": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete[]#*v#@SRETURN" - ] - }, - "c:@F@operator new#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znwm" - ], - "Parameters": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new#l#@SRETURN" - ] - }, - "c:@F@operator new[]#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znam" - ], - "Parameters": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new[]#l#@SRETURN" - ] - }, - "c:@S@X@F@X#&1$@S@X#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XC2ERKS_", - "_ZN1XC1ERKS_" - ], - "Parameters": [ - "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@X@F@X#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XC2EPFvvE", - "_ZN1XC1EPFvvE" - ], - "Parameters": [ - "c:0232.cpp@163@S@X@F@X#*Fv()#@arg" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@X@F@~X#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XD2Ev", - "_ZN1XD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@func1#": "c:@F@func1#", - "c:@F@main#": "c:@F@main#", - "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", - "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", - "c:@F@operator new#l#": "c:@F@operator new#l#", - "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", - "c:@S@X@F@X#&1$@S@X#": "c:@S@X@F@X#&1$@S@X#", - "c:@S@X@F@X#*Fv()#": "c:@S@X@F@X#*Fv()#", - "c:@S@X@F@~X#": "c:@S@X@F@~X#" - } - }, - "_CG": { - "_Z5func1v": { - "callees": [], - "callers": [ - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD1Ev": { - "callees": [ - "_Z5func1v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD2Ev": { - "callees": [ - "_Z5func1v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1XC1EPFvvE", - "_ZN1XC2EPFvvE", - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0232.gtipcg b/tools/cage/test/input/singleTU/0232.gtipcg deleted file mode 100644 index bbfd9cfd..00000000 --- a/tools/cage/test/input/singleTU/0232.gtipcg +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_Z5func1v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XD1Ev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XD2Ev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0233.gtaacg b/tools/cage/test/input/singleTU/0233.gtaacg deleted file mode 100644 index 16b1ea43..00000000 --- a/tools/cage/test/input/singleTU/0233.gtaacg +++ /dev/null @@ -1,220 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0233.cpp@75@F@main#@bp", - "&c:@F@main#@NEW@85-94" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:0233.cpp@75@F@main#@bp" - } - ] - }, - { - "Objects": [ - "c:0233.cpp@99@F@main#@c", - "c:@F@main#@NEW@85-94", - "*c:0233.cpp@75@F@main#@bp", - "c:0233.cpp@62@F@main#@a" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@operator delete#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdlPv" - ], - "Parameters": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete#*v#@SRETURN" - ] - }, - "c:@F@operator delete[]#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdaPv" - ], - "Parameters": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete[]#*v#@SRETURN" - ] - }, - "c:@F@operator new#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znwm" - ], - "Parameters": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new#l#@SRETURN" - ] - }, - "c:@F@operator new[]#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znam" - ], - "Parameters": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new[]#l#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#", - "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", - "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", - "c:@F@operator new#l#": "c:@F@operator new#l#", - "c:@F@operator new[]#l#": "c:@F@operator new[]#l#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0233.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0233.gtipcg b/tools/cage/test/input/singleTU/0233.gtipcg deleted file mode 100644 index e243b733..00000000 --- a/tools/cage/test/input/singleTU/0233.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0234.gtaacg b/tools/cage/test/input/singleTU/0234.gtaacg deleted file mode 100644 index 262f7a0a..00000000 --- a/tools/cage/test/input/singleTU/0234.gtaacg +++ /dev/null @@ -1,542 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@S@X@F@~X#@CALL_EXPR@@152-161": "c:@S@X@F@~X#" - }, - "CallInfoMap": { - "c:@S@X@F@~X#@CALL_EXPR@@152-161": { - "Arguments": [], - "CalledObjects": [ - "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@X@F@~X#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#&1$@S@X#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@216-222" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:0234.cpp@185@F@main#@f).c:@S@X@F@~X#", - "c:@S@X@F@~X#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:@S@X@F@~X#@THIS).c:@S@X@FI@function", - "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function", - "c:@S@X@FI@function", - "c:0234.cpp@115@S@X@F@X#*Fv()#@arg", - "c:@F@func1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@~X#@CALL_EXPR@@152-161", - "c:@F@func1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@X@F@X#*Fv()#@THIS", - "&c:@F@main#@CALL_EXPR@@204-211" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@X@F@X#*Fv()#@THIS" - } - ] - }, - { - "Objects": [ - "c:@S@X@F@~X#@THIS", - "c:0234.cpp@185@F@main#@f", - "&c:@F@main#@NEW@200-211" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@X@F@~X#@THIS" - } - ] - }, - { - "Objects": [ - "c:@F@main#@NEW@200-211", - "*c:0234.cpp@185@F@main#@f", - "c:@F@main#@CALL_EXPR@@204-211", - "*c:@S@X@F@X#*Fv()#@THIS", - "*c:@S@X@F@~X#@THIS" - ], - "Prefixes": [ - { - "Member": "c:@S@X@F@~X#", - "Object": "(*c:0234.cpp@185@F@main#@f).c:@S@X@F@~X#" - }, - { - "Member": "c:@S@X@FI@function", - "Object": "(*c:@S@X@F@X#*Fv()#@THIS).c:@S@X@FI@function" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@func1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func1#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@operator delete#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdlPv" - ], - "Parameters": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete#*v#@SRETURN" - ] - }, - "c:@F@operator delete[]#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdaPv" - ], - "Parameters": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete[]#*v#@SRETURN" - ] - }, - "c:@F@operator new#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znwm" - ], - "Parameters": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new#l#@SRETURN" - ] - }, - "c:@F@operator new[]#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znam" - ], - "Parameters": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new[]#l#@SRETURN" - ] - }, - "c:@S@X@F@X#&1$@S@X#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XC2ERKS_", - "_ZN1XC1ERKS_" - ], - "Parameters": [ - "c:@S@X@F@X#&1$@S@X#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@X@F@X#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XC2EPFvvE", - "_ZN1XC1EPFvvE" - ], - "Parameters": [ - "c:0234.cpp@115@S@X@F@X#*Fv()#@arg" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@X@F@~X#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1XD2Ev", - "_ZN1XD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@func1#": "c:@F@func1#", - "c:@F@main#": "c:@F@main#", - "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", - "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", - "c:@F@operator new#l#": "c:@F@operator new#l#", - "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", - "c:@S@X@F@X#&1$@S@X#": "c:@S@X@F@X#&1$@S@X#", - "c:@S@X@F@X#*Fv()#": "c:@S@X@F@X#*Fv()#", - "c:@S@X@F@~X#": "c:@S@X@F@~X#" - } - }, - "_CG": { - "_Z5func1v": { - "callees": [], - "callers": [ - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD1Ev": { - "callees": [ - "_Z5func1v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD2Ev": { - "callees": [ - "_Z5func1v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1XC1EPFvvE", - "_ZN1XC2EPFvvE", - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1XD1Ev": 0, - "_ZN1XD2Ev": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0234.gtipcg b/tools/cage/test/input/singleTU/0234.gtipcg deleted file mode 100644 index a851efb4..00000000 --- a/tools/cage/test/input/singleTU/0234.gtipcg +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_Z5func1v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1XD1Ev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1XD2Ev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0235.gtaacg b/tools/cage/test/input/singleTU/0235.gtaacg deleted file mode 100644 index 663ccd54..00000000 --- a/tools/cage/test/input/singleTU/0235.gtaacg +++ /dev/null @@ -1,344 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@237-239": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@237-239": { - "Arguments": [], - "CalledObjects": [ - "c:0235.cpp@212@F@main#@b" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@C@F@C#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0235.cpp@212@F@main#@b", - "(c:0235.cpp@199@F@main#@a).c:@S@C@FI@member", - "c:@S@C@FI@member", - "c:0235.cpp@133@S@C@F@C#*Fv()#@F", - "&c:@F@foo#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@foo#" - } - ] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@237-239", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0235.cpp@199@F@main#@a", - "c:@F@main#@CALL_EXPR@@201-207" - ], - "Prefixes": [ - { - "Member": "c:@S@C@FI@member", - "Object": "(c:0235.cpp@199@F@main#@a).c:@S@C@FI@member" - } - ] - }, - { - "Objects": [ - "c:@S@C@F@C#*Fv()#@THIS", - "&c:@F@main#@CALL_EXPR@@201-207" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@201-207" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@C@F@C#&&$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2EOS_", - "_ZN1CC1EOS_" - ], - "Parameters": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#&1$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2ERKS_", - "_ZN1CC1ERKS_" - ], - "Parameters": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2EPFvvE", - "_ZN1CC1EPFvvE" - ], - "Parameters": [ - "c:0235.cpp@133@S@C@F@C#*Fv()#@F" - ], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "&c:@F@foo#": "c:@F@foo#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", - "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", - "c:@S@C@F@C#*Fv()#": "c:@S@C@F@C#*Fv()#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC1EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC2EPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_ZN1CC1EPFvvE", - "_ZN1CC2EPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0235.gtipcg b/tools/cage/test/input/singleTU/0235.gtipcg deleted file mode 100644 index 32c9ff45..00000000 --- a/tools/cage/test/input/singleTU/0235.gtipcg +++ /dev/null @@ -1,42 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1CC1EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1CC2EPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/singleTU/0237.gtaacg b/tools/cage/test/input/singleTU/0237.gtaacg deleted file mode 100644 index ca53e506..00000000 --- a/tools/cage/test/input/singleTU/0237.gtaacg +++ /dev/null @@ -1,684 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@S@C@F@work#@CALL_EXPR@@268-271": "c:@S@C@F@work#", - "c:@S@C@F@work#@CALL_EXPR@@278-281": "c:@S@C@F@work#" - }, - "CallInfoMap": { - "c:@S@C@F@work#@CALL_EXPR@@268-271": { - "Arguments": [], - "CalledObjects": [ - "(*c:@S@C@F@work#@THIS).c:@S@B@FI@f1" - ] - }, - "c:@S@C@F@work#@CALL_EXPR@@278-281": { - "Arguments": [], - "CalledObjects": [ - "(*c:@S@C@F@work#@THIS).c:@S@C@FI@f2" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@C@F@C#*FI()#S0_#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#*FI()#S0_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@~B#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@~B#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@~B#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#*FI()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#*FI()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&1$@S@B#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&1$@S@B#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&1$@S@B#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&1$@S@B#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&&$@S@B#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&&$@S@B#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&&$@S@B#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@B@F@B#&&$@S@B#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@324-331", - "c:@S@C@F@work#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0237.cpp@307@F@main#@c).c:@S@C@F@work#", - "c:@S@C@F@work#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@work#@CALL_EXPR@@278-281", - "c:@F@boo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:@S@C@F@work#@THIS).c:@S@B@FI@f1", - "(*c:@S@B@F@B#*FI()#@THIS).c:@S@B@FI@f1", - "c:@S@B@FI@f1", - "c:0237.cpp@115@S@B@F@B#*FI()#@arg", - "c:0237.cpp@186@S@C@F@C#*FI()#S0_#@arg1", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@work#@CALL_EXPR@@268-271", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#*FI()#S0_#@THIS", - "c:@S@B@F@B#*FI()#@THIS", - "&c:@S@C@F@C#*FI()#S0_#@CALL_EXPR@@214-220", - "&c:@F@main#@CALL_EXPR@@309-319" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@B@F@B#*FI()#@THIS" - } - ] - }, - { - "Objects": [ - "c:@S@C@F@work#@THIS", - "&c:0237.cpp@307@F@main#@c" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@C@F@work#@THIS" - } - ] - }, - { - "Objects": [ - "c:0237.cpp@307@F@main#@c", - "c:@F@main#@CALL_EXPR@@309-319", - "c:@S@C@F@C#*FI()#S0_#@CALL_EXPR@@214-220", - "*c:@S@B@F@B#*FI()#@THIS", - "*c:@S@C@F@work#@THIS" - ], - "Prefixes": [ - { - "Member": "c:@S@C@F@work#", - "Object": "(c:0237.cpp@307@F@main#@c).c:@S@C@F@work#" - }, - { - "Member": "c:@S@C@FI@f2", - "Object": "(c:0237.cpp@307@F@main#@c).c:@S@C@FI@f2" - }, - { - "Member": "c:@S@B@FI@f1", - "Object": "(*c:@S@B@F@B#*FI()#@THIS).c:@S@B@FI@f1" - } - ] - }, - { - "Objects": [ - "(*c:@S@C@F@work#@THIS).c:@S@C@FI@f2", - "c:@S@C@FI@f2", - "c:0237.cpp@199@S@C@F@C#*FI()#S0_#@arg2", - "c:@F@boo#", - "(c:0237.cpp@307@F@main#@c).c:@S@C@FI@f2" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@boo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3boov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@boo#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@B@F@B#&&$@S@B#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1BC2EOS_", - "_ZN1BC1EOS_" - ], - "Parameters": [ - "c:@S@B@F@B#&&$@S@B#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@B@F@B#&1$@S@B#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1BC2ERKS_", - "_ZN1BC1ERKS_" - ], - "Parameters": [ - "c:@S@B@F@B#&1$@S@B#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@B@F@B#*FI()#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1BC2EPFivE", - "_ZN1BC1EPFivE" - ], - "Parameters": [ - "c:0237.cpp@115@S@B@F@B#*FI()#@arg" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@B@F@~B#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1BD2Ev", - "_ZN1BD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#&&$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2EOS_", - "_ZN1CC1EOS_" - ], - "Parameters": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#&1$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2ERKS_", - "_ZN1CC1ERKS_" - ], - "Parameters": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#*FI()#S0_#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2EPFivES1_", - "_ZN1CC1EPFivES1_" - ], - "Parameters": [ - "c:0237.cpp@186@S@C@F@C#*FI()#S0_#@arg1", - "c:0237.cpp@199@S@C@F@C#*FI()#S0_#@arg2" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@work#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1C4workEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@C@F@work#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@boo#": "c:@F@boo#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@S@B@F@B#&&$@S@B#": "c:@S@B@F@B#&&$@S@B#", - "c:@S@B@F@B#&1$@S@B#": "c:@S@B@F@B#&1$@S@B#", - "c:@S@B@F@B#*FI()#": "c:@S@B@F@B#*FI()#", - "c:@S@B@F@~B#": "c:@S@B@F@~B#", - "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", - "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", - "c:@S@C@F@C#*FI()#S0_#": "c:@S@C@F@C#*FI()#S0_#", - "c:@S@C@F@work#": "c:@S@C@F@work#" - } - }, - "_CG": { - "_Z3boov": { - "callees": [], - "callers": [ - "_ZN1C4workEv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_ZN1C4workEv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1EPFivE": { - "callees": [], - "callers": [ - "_ZN1CC1EPFivES1_", - "_ZN1CC2EPFivES1_" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2EPFivE": { - "callees": [], - "callers": [ - "_ZN1CC1EPFivES1_", - "_ZN1CC2EPFivES1_" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1C4workEv": { - "callees": [ - "_Z3boov", - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC1EPFivES1_": { - "callees": [ - "_ZN1BC1EPFivE", - "_ZN1BC2EPFivE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC2EPFivES1_": { - "callees": [ - "_ZN1BC1EPFivE", - "_ZN1BC2EPFivE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1C4workEv", - "_ZN1CC1EPFivES1_", - "_ZN1CC2EPFivES1_" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1C4workEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0237.gtipcg b/tools/cage/test/input/singleTU/0237.gtipcg deleted file mode 100644 index cae911b1..00000000 --- a/tools/cage/test/input/singleTU/0237.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_ZN1BC1EPFivE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1BC2EPFivE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1C4workEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1CC1EPFivES1_": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1CC2EPFivES1_": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [ - "_ZN1C4workEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index e55848b6..6cc31b0f 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -1,4 +1,4 @@ -!/usr/bin/env bash +#!/usr/bin/env bash test_src_dir="@TEST_SRC_DIR@" mcgconfig="@METACG_CONFIG@" @@ -27,14 +27,29 @@ function runSingleTUTest { cg_outfilename=${tfilename/cpp/mcg} cg_outfile="$run_dir/$cg_outfilename" - cg_gtfile=${tfile/cpp/gtmcg} - - CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -- >>log/testrun.log 2>&1 - - "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -- >>log/testrun.log 2>&1 + diff_file=${cg_outfile/mcg/cgdiff} + tfile_out="$run_dir/$tfilename.o" + + rm -f "$cg_outfile" "$diff_file" "$tfile_out" + + CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -o "$tfile_out" >> log/testrun.log 2>&1 + if [[ $? -ne 0 ]]; then + echo "Compile command: CAGE_CG_NAME=$cg_outfile clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -o $tfile_out >> log/testrun.log 2>&1" + if [[ ! -f "$cg_outfile" ]]; then + echo "Compilation failed! No call graph generated." + return 1 + fi + echo "Compilation failed but call graph was generated." + fi + + "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -o "$diff_file" -- >>log/testrun.log 2>&1 fail=$? + if [[ $fail -ne 0 ]]; then + echo "Test failed! See $diff_file for diff." + fi + return $fail } From 5d99dfb998e4a274096ea15ca3d639b8b42bcf52 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 17:31:13 +0100 Subject: [PATCH 06/25] Add CaGe test suites --- tools/cage/test/input/0200/m1.cpp | 7 - tools/cage/test/input/0200/m2.cpp | 3 - tools/cage/test/input/0200/m2.h | 6 - tools/cage/test/input/0201/m1.cpp | 9 - tools/cage/test/input/0201/m2.cpp | 3 - tools/cage/test/input/0201/m2.h | 6 - tools/cage/test/input/0201/m3.cpp | 5 - tools/cage/test/input/0201/m3.h | 6 - .../test/input/allCtorDtor/0001.noinfer.gtmcg | 199 --- .../test/input/allCtorDtor/0002.noinfer.gtmcg | 175 --- .../test/input/allCtorDtor/0003.noinfer.gtmcg | 249 --- .../test/input/allCtorDtor/0004.noinfer.gtmcg | 305 ---- .../test/input/allCtorDtor/0005.noinfer.gtmcg | 299 ---- .../test/input/allCtorDtor/0006.noinfer.gtmcg | 362 ----- .../test/input/allCtorDtor/0007.noinfer.gtmcg | 304 ---- .../test/input/allCtorDtor/0008.noinfer.gtmcg | 305 ---- .../input/{allCtorDtor => ctorDtor}/0001.cpp | 0 .../{allCtorDtor => ctorDtor}/0001.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0002.cpp | 0 .../{allCtorDtor => ctorDtor}/0002.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0003.cpp | 0 .../{allCtorDtor => ctorDtor}/0003.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0004.cpp | 0 .../{allCtorDtor => ctorDtor}/0004.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0005.cpp | 0 .../{allCtorDtor => ctorDtor}/0005.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0006.cpp | 0 .../{allCtorDtor => ctorDtor}/0006.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0007.cpp | 0 .../{allCtorDtor => ctorDtor}/0007.gtmcg | 0 .../input/{allCtorDtor => ctorDtor}/0008.cpp | 0 .../{allCtorDtor => ctorDtor}/0008.gtmcg | 0 .../cage/test/input/functionPointers/0041.cpp | 17 - .../test/input/functionPointers/0041.gtaacg | 252 --- .../test/input/functionPointers/0041.gtipcg | 40 - .../test/input/functionPointers/0041.gtmcg | 68 - .../cage/test/input/functionPointers/0045.cpp | 27 - .../test/input/functionPointers/0045.gtaacg | 349 ----- .../test/input/functionPointers/0045.gtipcg | 78 - .../test/input/functionPointers/0045.gtmcg | 124 -- .../cage/test/input/functionPointers/0046.cpp | 21 - .../test/input/functionPointers/0046.gtaacg | 314 ---- .../test/input/functionPointers/0046.gtipcg | 66 - .../test/input/functionPointers/0046.gtmcg | 106 -- .../cage/test/input/functionPointers/0047.cpp | 21 - .../test/input/functionPointers/0047.gtaacg | 313 ---- .../test/input/functionPointers/0047.gtipcg | 66 - .../test/input/functionPointers/0047.gtmcg | 106 -- .../cage/test/input/functionPointers/0048.cpp | 19 - .../test/input/functionPointers/0048.gtaacg | 311 ---- .../test/input/functionPointers/0048.gtipcg | 66 - .../test/input/functionPointers/0048.gtmcg | 106 -- .../cage/test/input/functionPointers/0049.cpp | 16 - .../test/input/functionPointers/0049.gtaacg | 265 ---- .../test/input/functionPointers/0049.gtipcg | 53 - .../test/input/functionPointers/0049.gtmcg | 87 -- .../cage/test/input/functionPointers/0051.cpp | 20 - .../test/input/functionPointers/0051.gtaacg | 312 ---- .../test/input/functionPointers/0051.gtipcg | 66 - .../test/input/functionPointers/0051.gtmcg | 106 -- .../cage/test/input/functionPointers/0052.cpp | 22 - .../test/input/functionPointers/0052.gtaacg | 312 ---- .../test/input/functionPointers/0052.gtipcg | 66 - .../test/input/functionPointers/0052.gtmcg | 106 -- .../cage/test/input/functionPointers/0053.cpp | 13 - .../test/input/functionPointers/0053.gtaacg | 1 - .../test/input/functionPointers/0053.gtipcg | 26 - .../test/input/functionPointers/0053.gtmcg | 78 - .../cage/test/input/functionPointers/0100.cpp | 11 - .../test/input/functionPointers/0100.gtaacg | 172 --- .../test/input/functionPointers/0100.gtipcg | 22 - .../test/input/functionPointers/0100.gtmcg | 44 - .../cage/test/input/functionPointers/0101.cpp | 13 - .../test/input/functionPointers/0101.gtaacg | 225 --- .../test/input/functionPointers/0101.gtipcg | 32 - .../test/input/functionPointers/0101.gtmcg | 60 - .../cage/test/input/functionPointers/0102.cpp | 15 - .../test/input/functionPointers/0102.gtaacg | 278 ---- .../test/input/functionPointers/0102.gtipcg | 42 - .../test/input/functionPointers/0102.gtmcg | 76 - .../cage/test/input/functionPointers/0103.cpp | 14 - .../test/input/functionPointers/0103.gtaacg | 276 ---- .../test/input/functionPointers/0103.gtipcg | 49 - .../test/input/functionPointers/0103.gtmcg | 83 - .../cage/test/input/functionPointers/0115.cpp | 18 - .../test/input/functionPointers/0115.gtaacg | 453 ------ .../test/input/functionPointers/0115.gtipcg | 26 - .../test/input/functionPointers/0115.gtmcg | 78 - .../cage/test/input/functionPointers/0201.cpp | 11 - .../test/input/functionPointers/0201.gtaacg | 202 --- .../test/input/functionPointers/0201.gtipcg | 39 - .../test/input/functionPointers/0201.gtmcg | 67 - .../cage/test/input/functionPointers/0202.cpp | 10 - .../test/input/functionPointers/0202.gtaacg | 145 -- .../test/input/functionPointers/0202.gtipcg | 26 - .../test/input/functionPointers/0202.gtmcg | 48 - .../cage/test/input/functionPointers/0203.cpp | 17 - .../test/input/functionPointers/0203.gtaacg | 291 ---- .../test/input/functionPointers/0203.gtipcg | 56 - .../test/input/functionPointers/0203.gtmcg | 90 -- .../cage/test/input/functionPointers/0204.cpp | 16 - .../test/input/functionPointers/0204.gtaacg | 271 ---- .../test/input/functionPointers/0204.gtipcg | 54 - .../test/input/functionPointers/0204.gtmcg | 88 -- .../cage/test/input/functionPointers/0205.cpp | 11 - .../test/input/functionPointers/0205.gtaacg | 206 --- .../test/input/functionPointers/0205.gtipcg | 36 - .../test/input/functionPointers/0205.gtmcg | 64 - .../cage/test/input/functionPointers/0206.cpp | 19 - .../test/input/functionPointers/0206.gtaacg | 273 ---- .../test/input/functionPointers/0206.gtipcg | 50 - .../test/input/functionPointers/0206.gtmcg | 84 - .../cage/test/input/functionPointers/0207.cpp | 20 - .../test/input/functionPointers/0207.gtaacg | 733 --------- .../test/input/functionPointers/0207.gtipcg | 165 -- .../test/input/functionPointers/0207.gtmcg | 247 --- .../cage/test/input/functionPointers/0208.cpp | 9 - .../test/input/functionPointers/0208.gtaacg | 415 ----- .../test/input/functionPointers/0208.gtipcg | 40 - .../test/input/functionPointers/0208.gtmcg | 68 - .../cage/test/input/functionPointers/0209.cpp | 20 - .../test/input/functionPointers/0209.gtaacg | 530 ------- .../test/input/functionPointers/0209.gtipcg | 62 - .../test/input/functionPointers/0209.gtmcg | 102 -- .../cage/test/input/functionPointers/0210.cpp | 10 - .../test/input/functionPointers/0210.gtaacg | 324 ---- .../test/input/functionPointers/0210.gtipcg | 26 - .../test/input/functionPointers/0210.gtmcg | 78 - .../cage/test/input/functionPointers/0211.cpp | 14 - .../test/input/functionPointers/0211.gtaacg | 330 ---- .../test/input/functionPointers/0211.gtipcg | 26 - .../test/input/functionPointers/0211.gtmcg | 48 - .../cage/test/input/functionPointers/0212.cpp | 15 - .../test/input/functionPointers/0212.gtaacg | 392 ----- .../test/input/functionPointers/0212.gtipcg | 40 - .../test/input/functionPointers/0212.gtmcg | 68 - .../cage/test/input/functionPointers/0213.cpp | 16 - .../test/input/functionPointers/0213.gtaacg | 389 ----- .../test/input/functionPointers/0213.gtipcg | 39 - .../test/input/functionPointers/0213.gtmcg | 67 - .../cage/test/input/functionPointers/0214.cpp | 11 - .../test/input/functionPointers/0214.gtaacg | 207 --- .../test/input/functionPointers/0214.gtipcg | 36 - .../test/input/functionPointers/0214.gtmcg | 64 - .../cage/test/input/functionPointers/0216.cpp | 9 - .../test/input/functionPointers/0216.gtaacg | 316 ---- .../test/input/functionPointers/0216.gtipcg | 26 - .../test/input/functionPointers/0216.gtmcg | 78 - .../cage/test/input/functionPointers/0217.cpp | 12 - .../test/input/functionPointers/0217.gtaacg | 331 ---- .../test/input/functionPointers/0217.gtipcg | 26 - .../test/input/functionPointers/0217.gtmcg | 78 - .../metaCollectors/numStatements/0023.cpp | 10 - .../metaCollectors/numStatements/0023.gtaacg | 102 -- .../metaCollectors/numStatements/0023.gtipcg | 12 - .../metaCollectors/numStatements/0023.gtmcg | 28 - .../metaCollectors/numStatements/0024.cpp | 11 - .../metaCollectors/numStatements/0024.gtaacg | 102 -- .../metaCollectors/numStatements/0024.gtipcg | 12 - .../metaCollectors/numStatements/0024.gtmcg | 28 - .../metaCollectors/numStatements/0025.cpp | 12 - .../metaCollectors/numStatements/0025.gtaacg | 102 -- .../metaCollectors/numStatements/0025.gtipcg | 12 - .../metaCollectors/numStatements/0025.gtmcg | 28 - .../metaCollectors/numStatements/0026.cpp | 15 - .../metaCollectors/numStatements/0026.gtaacg | 102 -- .../metaCollectors/numStatements/0026.gtipcg | 12 - .../metaCollectors/numStatements/0026.gtmcg | 28 - .../metaCollectors/numStatements/0027.cpp | 16 - .../metaCollectors/numStatements/0027.gtaacg | 102 -- .../metaCollectors/numStatements/0027.gtipcg | 12 - .../metaCollectors/numStatements/0027.gtmcg | 28 - .../metaCollectors/numStatements/0028.cpp | 16 - .../metaCollectors/numStatements/0028.gtaacg | 102 -- .../metaCollectors/numStatements/0028.gtipcg | 12 - .../metaCollectors/numStatements/0028.gtmcg | 28 - .../metaCollectors/numStatements/0029.cpp | 18 - .../metaCollectors/numStatements/0029.gtaacg | 102 -- .../metaCollectors/numStatements/0029.gtipcg | 12 - .../metaCollectors/numStatements/0029.gtmcg | 28 - .../metaCollectors/numStatements/0030.cpp | 19 - .../metaCollectors/numStatements/0030.gtaacg | 157 -- .../metaCollectors/numStatements/0030.gtipcg | 26 - .../metaCollectors/numStatements/0030.gtmcg | 48 - .../metaCollectors/numStatements/0031.cpp | 22 - .../metaCollectors/numStatements/0031.gtaacg | 160 -- .../metaCollectors/numStatements/0031.gtipcg | 26 - .../metaCollectors/numStatements/0031.gtmcg | 48 - .../metaCollectors/numStatements/0032.cpp | 34 - .../metaCollectors/numStatements/0032.gtaacg | 225 --- .../metaCollectors/numStatements/0032.gtipcg | 39 - .../metaCollectors/numStatements/0032.gtmcg | 67 - .../metaCollectors/numStatements/0033.cpp | 36 - .../metaCollectors/numStatements/0033.gtaacg | 286 ---- .../metaCollectors/numStatements/0033.gtipcg | 56 - .../metaCollectors/numStatements/0033.gtmcg | 90 -- .../metaCollectors/numStatements/0034.cpp | 18 - .../metaCollectors/numStatements/0034.gtaacg | 160 -- .../metaCollectors/numStatements/0034.gtipcg | 26 - .../metaCollectors/numStatements/0034.gtmcg | 48 - .../metaCollectors/numStatements/0035.cpp | 20 - .../metaCollectors/numStatements/0035.gtaacg | 160 -- .../metaCollectors/numStatements/0035.gtipcg | 26 - .../metaCollectors/numStatements/0035.gtmcg | 48 - .../metaCollectors/numStatements/0036.cpp | 25 - .../metaCollectors/numStatements/0036.gtaacg | 160 -- .../metaCollectors/numStatements/0036.gtipcg | 26 - .../metaCollectors/numStatements/0036.gtmcg | 48 - .../metaCollectors/numStatements/0037.cpp | 17 - .../metaCollectors/numStatements/0037.gtaacg | 155 -- .../metaCollectors/numStatements/0037.gtipcg | 26 - .../metaCollectors/numStatements/0037.gtmcg | 48 - .../metaCollectors/numStatements/0038.cpp | 17 - .../metaCollectors/numStatements/0038.gtaacg | 166 -- .../metaCollectors/numStatements/0038.gtipcg | 26 - .../metaCollectors/numStatements/0038.gtmcg | 48 - .../metaCollectors/numStatements/0039.cpp | 18 - .../metaCollectors/numStatements/0039.gtaacg | 166 -- .../metaCollectors/numStatements/0039.gtipcg | 26 - .../metaCollectors/numStatements/0039.gtmcg | 48 - .../metaCollectors/numStatements/0040.cpp | 26 - .../metaCollectors/numStatements/0040.gtaacg | 160 -- .../metaCollectors/numStatements/0040.gtipcg | 26 - .../metaCollectors/numStatements/0040.gtmcg | 48 - .../metaCollectors/numStatements/0041.cpp | 6 - .../metaCollectors/numStatements/0041.gtaacg | 522 ------- .../metaCollectors/numStatements/0041.gtipcg | 26 - .../metaCollectors/numStatements/0041.gtmcg | 78 - .../metaCollectors/numStatements/0042.cpp | 12 - .../metaCollectors/numStatements/0042.gtaacg | 548 ------- .../metaCollectors/numStatements/0042.gtipcg | 26 - .../metaCollectors/numStatements/0042.gtmcg | 78 - tools/cage/test/input/multiTU/0042.gtmcg | 54 + tools/cage/test/input/multiTU/0042_a.cpp | 4 + tools/cage/test/input/multiTU/0042_b.cpp | 2 + .../test/input/multiTU/0042_combined.gtmcg | 84 - tools/cage/test/input/multiTU/0043.gtmcg | 52 + tools/cage/test/input/multiTU/0043_a.cpp | 4 + tools/cage/test/input/multiTU/0043_b.cpp | 2 + .../test/input/multiTU/0043_combined.gtmcg | 96 -- tools/cage/test/input/multiTU/0044.gtmcg | 56 + tools/cage/test/input/multiTU/0044_a.cpp | 3 + tools/cage/test/input/multiTU/0044_b.cpp | 1 + .../test/input/multiTU/0044_combined.gtmcg | 103 -- tools/cage/test/input/multiTU/0050.gtmcg | 65 + tools/cage/test/input/multiTU/0050_a.cpp | 6 + .../test/input/multiTU/0050_combined.gtmcg | 103 -- tools/cage/test/input/multiTU/0053.gtmcg | 80 + .../test/input/multiTU/0053_combined.gtmcg | 104 -- tools/cage/test/input/multiTU/0060.gtmcg | 78 + .../test/input/multiTU/0060_combined.gtmcg | 174 --- tools/cage/test/input/multiTU/0070_a.cpp | 7 - tools/cage/test/input/multiTU/0070_a.gtaacg | 150 -- tools/cage/test/input/multiTU/0070_b.cpp | 1 - tools/cage/test/input/multiTU/0070_b.gtaacg | 91 -- .../test/input/multiTU/0070_combined.gtaacg | 152 -- tools/cage/test/input/multiTU/0071_a.cpp | 10 - tools/cage/test/input/multiTU/0071_a.gtaacg | 148 -- tools/cage/test/input/multiTU/0071_b.cpp | 9 - tools/cage/test/input/multiTU/0071_b.gtaacg | 96 -- .../test/input/multiTU/0071_combined.gtaacg | 215 --- tools/cage/test/input/multiTU/0072_a.cpp | 22 - tools/cage/test/input/multiTU/0072_a.gtaacg | 252 --- tools/cage/test/input/multiTU/0072_b.cpp | 22 - tools/cage/test/input/multiTU/0072_b.gtaacg | 198 --- .../test/input/multiTU/0072_combined.gtaacg | 348 ----- tools/cage/test/input/multiTU/0214_a.cpp | 11 - tools/cage/test/input/multiTU/0214_a.gtaacg | 189 --- tools/cage/test/input/multiTU/0214_b.cpp | 5 - tools/cage/test/input/multiTU/0214_b.gtaacg | 96 -- .../test/input/multiTU/0214_combined.gtaacg | 203 --- tools/cage/test/input/multiTU/0240_a.cpp | 8 - tools/cage/test/input/multiTU/0240_a.gtaacg | 186 --- tools/cage/test/input/multiTU/0240_b.cpp | 19 - tools/cage/test/input/multiTU/0240_b.gtaacg | 335 ---- .../test/input/multiTU/0240_combined.gtaacg | 371 ----- tools/cage/test/input/multiTU/0241_a.cpp | 42 - tools/cage/test/input/multiTU/0241_a.gtaacg | 1352 ---------------- tools/cage/test/input/multiTU/0241_b.cpp | 12 - tools/cage/test/input/multiTU/0241_b.gtaacg | 289 ---- .../test/input/multiTU/0241_combined.gtaacg | 1359 ----------------- tools/cage/test/input/singleTU/0001.gtmcg | 34 +- tools/cage/test/input/singleTU/0002.gtmcg | 59 +- tools/cage/test/input/singleTU/0003.gtmcg | 84 +- tools/cage/test/input/singleTU/0004.gtmcg | 55 +- tools/cage/test/input/singleTU/0005.gtmcg | 84 +- tools/cage/test/input/singleTU/0013.gtmcg | 108 +- tools/cage/test/input/singleTU/0014.gtmcg | 112 +- tools/cage/test/input/singleTU/0022.cpp | 10 - tools/cage/test/input/singleTU/0022.gtmcg | 28 - tools/cage/test/input/singleTU/0063.cpp | 3 - tools/cage/test/input/singleTU/0063.gtmcg | 11 - tools/cage/test/input/singleTU/0065.cpp | 2 +- tools/cage/test/input/singleTU/0065.gtmcg | 170 +-- tools/cage/test/input/singleTU/0066.cpp | 2 +- tools/cage/test/input/singleTU/0066.gtmcg | 90 +- tools/cage/test/input/singleTU/0215.cpp | 14 - tools/cage/test/input/singleTU/0215.gtmcg | 59 - tools/cage/test/input/singleTU/0221.cpp | 19 - tools/cage/test/input/singleTU/0221.gtmcg | 28 - tools/cage/test/input/singleTU/0222.cpp | 11 - tools/cage/test/input/singleTU/0222.gtmcg | 28 - tools/cage/test/input/singleTU/0223.cpp | 20 - tools/cage/test/input/singleTU/0223.gtmcg | 48 - tools/cage/test/input/singleTU/0224.cpp | 21 - tools/cage/test/input/singleTU/0224.gtmcg | 68 - tools/cage/test/input/singleTU/0225.cpp | 58 - tools/cage/test/input/singleTU/0225.gtmcg | 174 --- tools/cage/test/input/singleTU/0226.cpp | 8 - tools/cage/test/input/singleTU/0226.gtmcg | 44 - tools/cage/test/input/singleTU/0227.cpp | 11 - tools/cage/test/input/singleTU/0227.gtmcg | 44 - tools/cage/test/input/singleTU/0228.cpp | 7 - tools/cage/test/input/singleTU/0228.gtmcg | 42 - tools/cage/test/input/singleTU/0230.gtmcg | 130 +- tools/cage/test/input/singleTU/0232.cpp | 3 +- tools/cage/test/input/singleTU/0232.gtmcg | 230 +-- tools/cage/test/input/singleTU/0233.gtmcg | 55 +- tools/cage/test/input/singleTU/0234.gtmcg | 234 +-- tools/cage/test/input/singleTU/0235.gtmcg | 151 +- tools/cage/test/input/singleTU/0237.cpp | 4 +- tools/cage/test/input/singleTU/0237.gtmcg | 238 +-- tools/cage/test/input/virtualCalls/0006.gtmcg | 59 +- tools/cage/test/input/virtualCalls/0007.gtmcg | 224 +-- tools/cage/test/input/virtualCalls/0008.gtmcg | 100 +- tools/cage/test/input/virtualCalls/0009.gtmcg | 100 +- tools/cage/test/input/virtualCalls/0010.gtmcg | 179 +-- tools/cage/test/input/virtualCalls/0011.gtmcg | 75 +- tools/cage/test/input/virtualCalls/0012.gtmcg | 75 +- tools/cage/test/input/virtualCalls/0015.gtmcg | 132 +- tools/cage/test/input/virtualCalls/0016.gtmcg | 234 +-- tools/cage/test/input/virtualCalls/0017.gtmcg | 243 +-- tools/cage/test/input/virtualCalls/0018.cpp | 2 +- tools/cage/test/input/virtualCalls/0018.gtmcg | 239 +-- tools/cage/test/input/virtualCalls/0019.gtmcg | 101 +- tools/cage/test/input/virtualCalls/0020.gtmcg | 99 +- tools/cage/test/input/virtualCalls/0021.gtmcg | 133 +- tools/cage/test/input/virtualCalls/0022.gtmcg | 146 +- tools/cage/test/runCaGeTests.sh.in | 246 +-- 339 files changed, 1731 insertions(+), 31949 deletions(-) delete mode 100644 tools/cage/test/input/0200/m1.cpp delete mode 100644 tools/cage/test/input/0200/m2.cpp delete mode 100644 tools/cage/test/input/0200/m2.h delete mode 100644 tools/cage/test/input/0201/m1.cpp delete mode 100644 tools/cage/test/input/0201/m2.cpp delete mode 100644 tools/cage/test/input/0201/m2.h delete mode 100644 tools/cage/test/input/0201/m3.cpp delete mode 100644 tools/cage/test/input/0201/m3.h delete mode 100644 tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg delete mode 100644 tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0001.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0001.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0002.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0002.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0003.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0003.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0004.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0004.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0005.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0005.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0006.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0006.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0007.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0007.gtmcg (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0008.cpp (100%) rename tools/cage/test/input/{allCtorDtor => ctorDtor}/0008.gtmcg (100%) delete mode 100644 tools/cage/test/input/functionPointers/0041.cpp delete mode 100644 tools/cage/test/input/functionPointers/0041.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0041.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0041.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0045.cpp delete mode 100644 tools/cage/test/input/functionPointers/0045.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0045.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0045.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0046.cpp delete mode 100644 tools/cage/test/input/functionPointers/0046.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0046.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0046.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0047.cpp delete mode 100644 tools/cage/test/input/functionPointers/0047.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0047.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0047.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0048.cpp delete mode 100644 tools/cage/test/input/functionPointers/0048.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0048.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0048.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0049.cpp delete mode 100644 tools/cage/test/input/functionPointers/0049.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0049.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0049.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0051.cpp delete mode 100644 tools/cage/test/input/functionPointers/0051.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0051.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0051.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0052.cpp delete mode 100644 tools/cage/test/input/functionPointers/0052.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0052.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0052.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0053.cpp delete mode 100644 tools/cage/test/input/functionPointers/0053.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0053.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0053.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0100.cpp delete mode 100644 tools/cage/test/input/functionPointers/0100.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0100.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0100.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0101.cpp delete mode 100644 tools/cage/test/input/functionPointers/0101.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0101.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0101.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0102.cpp delete mode 100644 tools/cage/test/input/functionPointers/0102.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0102.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0102.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0103.cpp delete mode 100644 tools/cage/test/input/functionPointers/0103.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0103.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0103.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0115.cpp delete mode 100644 tools/cage/test/input/functionPointers/0115.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0115.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0115.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0201.cpp delete mode 100644 tools/cage/test/input/functionPointers/0201.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0201.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0201.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0202.cpp delete mode 100644 tools/cage/test/input/functionPointers/0202.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0202.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0202.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0203.cpp delete mode 100644 tools/cage/test/input/functionPointers/0203.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0203.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0203.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0204.cpp delete mode 100644 tools/cage/test/input/functionPointers/0204.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0204.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0204.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0205.cpp delete mode 100644 tools/cage/test/input/functionPointers/0205.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0205.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0205.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0206.cpp delete mode 100644 tools/cage/test/input/functionPointers/0206.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0206.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0206.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0207.cpp delete mode 100644 tools/cage/test/input/functionPointers/0207.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0207.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0207.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0208.cpp delete mode 100644 tools/cage/test/input/functionPointers/0208.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0208.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0208.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0209.cpp delete mode 100644 tools/cage/test/input/functionPointers/0209.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0209.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0209.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0210.cpp delete mode 100644 tools/cage/test/input/functionPointers/0210.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0210.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0210.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0211.cpp delete mode 100644 tools/cage/test/input/functionPointers/0211.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0211.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0211.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0212.cpp delete mode 100644 tools/cage/test/input/functionPointers/0212.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0212.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0212.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0213.cpp delete mode 100644 tools/cage/test/input/functionPointers/0213.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0213.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0213.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0214.cpp delete mode 100644 tools/cage/test/input/functionPointers/0214.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0214.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0214.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0216.cpp delete mode 100644 tools/cage/test/input/functionPointers/0216.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0216.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0216.gtmcg delete mode 100644 tools/cage/test/input/functionPointers/0217.cpp delete mode 100644 tools/cage/test/input/functionPointers/0217.gtaacg delete mode 100644 tools/cage/test/input/functionPointers/0217.gtipcg delete mode 100644 tools/cage/test/input/functionPointers/0217.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.cpp delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg delete mode 100644 tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg create mode 100644 tools/cage/test/input/multiTU/0042.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0042_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0043.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0043_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0044.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0044_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0050.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0050_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0053.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0053_combined.gtmcg create mode 100644 tools/cage/test/input/multiTU/0060.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0060_combined.gtmcg delete mode 100644 tools/cage/test/input/multiTU/0070_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0070_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0070_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0070_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0070_combined.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0071_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0071_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0071_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0071_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0071_combined.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0072_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0072_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0072_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0072_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0072_combined.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0214_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0214_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0214_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0214_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0214_combined.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0240_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0240_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0240_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0240_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0240_combined.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0241_a.cpp delete mode 100644 tools/cage/test/input/multiTU/0241_a.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0241_b.cpp delete mode 100644 tools/cage/test/input/multiTU/0241_b.gtaacg delete mode 100644 tools/cage/test/input/multiTU/0241_combined.gtaacg delete mode 100644 tools/cage/test/input/singleTU/0022.cpp delete mode 100644 tools/cage/test/input/singleTU/0022.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0063.cpp delete mode 100644 tools/cage/test/input/singleTU/0063.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0215.cpp delete mode 100644 tools/cage/test/input/singleTU/0215.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0221.cpp delete mode 100644 tools/cage/test/input/singleTU/0221.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0222.cpp delete mode 100644 tools/cage/test/input/singleTU/0222.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0223.cpp delete mode 100644 tools/cage/test/input/singleTU/0223.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0224.cpp delete mode 100644 tools/cage/test/input/singleTU/0224.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0225.cpp delete mode 100644 tools/cage/test/input/singleTU/0225.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0226.cpp delete mode 100644 tools/cage/test/input/singleTU/0226.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0227.cpp delete mode 100644 tools/cage/test/input/singleTU/0227.gtmcg delete mode 100644 tools/cage/test/input/singleTU/0228.cpp delete mode 100644 tools/cage/test/input/singleTU/0228.gtmcg diff --git a/tools/cage/test/input/0200/m1.cpp b/tools/cage/test/input/0200/m1.cpp deleted file mode 100644 index dff5a9f9..00000000 --- a/tools/cage/test/input/0200/m1.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "m2.h" - -int main() { - foo(); - - return 0; -} diff --git a/tools/cage/test/input/0200/m2.cpp b/tools/cage/test/input/0200/m2.cpp deleted file mode 100644 index 51a825ab..00000000 --- a/tools/cage/test/input/0200/m2.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "m2.h" - -int foo() { return 0; } diff --git a/tools/cage/test/input/0200/m2.h b/tools/cage/test/input/0200/m2.h deleted file mode 100644 index c7b08d84..00000000 --- a/tools/cage/test/input/0200/m2.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef M2_H -#define M2_H - -int foo(); - -#endif diff --git a/tools/cage/test/input/0201/m1.cpp b/tools/cage/test/input/0201/m1.cpp deleted file mode 100644 index 9f25e330..00000000 --- a/tools/cage/test/input/0201/m1.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "m2.h" -#include "m3.h" - -int main() { - foo(); - booq(); - - return 0; -} diff --git a/tools/cage/test/input/0201/m2.cpp b/tools/cage/test/input/0201/m2.cpp deleted file mode 100644 index 51a825ab..00000000 --- a/tools/cage/test/input/0201/m2.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "m2.h" - -int foo() { return 0; } diff --git a/tools/cage/test/input/0201/m2.h b/tools/cage/test/input/0201/m2.h deleted file mode 100644 index c7b08d84..00000000 --- a/tools/cage/test/input/0201/m2.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef M2_H -#define M2_H - -int foo(); - -#endif diff --git a/tools/cage/test/input/0201/m3.cpp b/tools/cage/test/input/0201/m3.cpp deleted file mode 100644 index 9cd89226..00000000 --- a/tools/cage/test/input/0201/m3.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "m3.h" - -#include "m2.h" - -int booq() { return foo(); } diff --git a/tools/cage/test/input/0201/m3.h b/tools/cage/test/input/0201/m3.h deleted file mode 100644 index 03e75e26..00000000 --- a/tools/cage/test/input/0201/m3.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef M3_H -#define M3_H - -int booq(); - -#endif diff --git a/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg deleted file mode 100644 index c0c257d3..00000000 --- a/tools/cage/test/input/allCtorDtor/0001.noinfer.gtmcg +++ /dev/null @@ -1,199 +0,0 @@ -{ - "_CG": { - "_ZN7MyClassC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD0Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN7MyClassC1Ev", - "_ZN7MyClassC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0001.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg deleted file mode 100644 index 21668260..00000000 --- a/tools/cage/test/input/allCtorDtor/0002.noinfer.gtmcg +++ /dev/null @@ -1,175 +0,0 @@ -{ - "_CG": { - "_ZN4BaseC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4BaseC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4BaseD1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4BaseD2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev", - "_ZN4BaseD1Ev", - "_ZN4BaseD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0002.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg deleted file mode 100644 index 5b80796b..00000000 --- a/tools/cage/test/input/allCtorDtor/0003.noinfer.gtmcg +++ /dev/null @@ -1,249 +0,0 @@ -{ - "_CG": { - "_Z6hiddenv": { - "callees": [], - "callers": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [ - "_Z6hiddenv" - ], - "callers": [ - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": { - "_Z6hiddenv": [ - [ - 1.0, - "" - ] - ] - }, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": { - "_Z6hiddenv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [ - "_Z6hiddenv" - ], - "callers": [ - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": { - "_Z6hiddenv": [ - [ - 1.0, - "" - ] - ] - }, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0003.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": { - "_Z6hiddenv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "2c7e1376528c362b9223eb220b3b32ae8731dd30", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg deleted file mode 100644 index 5a135ee0..00000000 --- a/tools/cage/test/input/allCtorDtor/0004.noinfer.gtmcg +++ /dev/null @@ -1,305 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev", - "_ZN1BD1Ev", - "_ZN1BD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0004.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg deleted file mode 100644 index 47f2b8f3..00000000 --- a/tools/cage/test/input/allCtorDtor/0005.noinfer.gtmcg +++ /dev/null @@ -1,299 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0005.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg deleted file mode 100644 index cd2b0fe6..00000000 --- a/tools/cage/test/input/allCtorDtor/0006.noinfer.gtmcg +++ /dev/null @@ -1,362 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [ - "_Z5makeBv", - "_ZN1BD1Ev", - "_ZN1BD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": { - "_Z5makeBv": [ - [ - 1.0, - "" - ] - ] - }, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": { - "_Z5makeBv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5makeBv": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev", - "_ZN1BD1Ev", - "_ZN1BD2Ev" - ], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [], - "callers": [ - "_Z5makeBv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [], - "callers": [ - "_Z5makeBv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD1Ev": { - "callees": [], - "callers": [ - "_Z3foov", - "_Z5makeBv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD2Ev": { - "callees": [], - "callers": [ - "_Z3foov", - "_Z5makeBv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0006.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg deleted file mode 100644 index 8fdf55b6..00000000 --- a/tools/cage/test/input/allCtorDtor/0007.noinfer.gtmcg +++ /dev/null @@ -1,304 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [ - "_ZN1AD1Ev", - "_ZN1AD2Ev", - "_ZN1BC1Ev", - "_ZN1BC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "estimateCallCount": { - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg b/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg deleted file mode 100644 index 88732fb2..00000000 --- a/tools/cage/test/input/allCtorDtor/0008.noinfer.gtmcg +++ /dev/null @@ -1,305 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [ - "_ZN1BC1Ev", - "_ZN1BC2Ev", - "_ZN1BD1Ev", - "_ZN1BD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": false, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": true - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD1Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BD2Ev": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "estimateCallCount": { - "calls": {}, - "codeRegions": {} - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/allCtorDtor/0008.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "inlineInfo": { - "isTemplate": false, - "likelyInline": true, - "markedAlwaysInline": false, - "markedInline": false - }, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "de5748d537c1e79cf1ea786deeb1830c325a5ad3", - "version": "0.7" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/allCtorDtor/0001.cpp b/tools/cage/test/input/ctorDtor/0001.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0001.cpp rename to tools/cage/test/input/ctorDtor/0001.cpp diff --git a/tools/cage/test/input/allCtorDtor/0001.gtmcg b/tools/cage/test/input/ctorDtor/0001.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0001.gtmcg rename to tools/cage/test/input/ctorDtor/0001.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0002.cpp b/tools/cage/test/input/ctorDtor/0002.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0002.cpp rename to tools/cage/test/input/ctorDtor/0002.cpp diff --git a/tools/cage/test/input/allCtorDtor/0002.gtmcg b/tools/cage/test/input/ctorDtor/0002.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0002.gtmcg rename to tools/cage/test/input/ctorDtor/0002.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0003.cpp b/tools/cage/test/input/ctorDtor/0003.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0003.cpp rename to tools/cage/test/input/ctorDtor/0003.cpp diff --git a/tools/cage/test/input/allCtorDtor/0003.gtmcg b/tools/cage/test/input/ctorDtor/0003.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0003.gtmcg rename to tools/cage/test/input/ctorDtor/0003.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0004.cpp b/tools/cage/test/input/ctorDtor/0004.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0004.cpp rename to tools/cage/test/input/ctorDtor/0004.cpp diff --git a/tools/cage/test/input/allCtorDtor/0004.gtmcg b/tools/cage/test/input/ctorDtor/0004.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0004.gtmcg rename to tools/cage/test/input/ctorDtor/0004.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0005.cpp b/tools/cage/test/input/ctorDtor/0005.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0005.cpp rename to tools/cage/test/input/ctorDtor/0005.cpp diff --git a/tools/cage/test/input/allCtorDtor/0005.gtmcg b/tools/cage/test/input/ctorDtor/0005.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0005.gtmcg rename to tools/cage/test/input/ctorDtor/0005.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0006.cpp b/tools/cage/test/input/ctorDtor/0006.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0006.cpp rename to tools/cage/test/input/ctorDtor/0006.cpp diff --git a/tools/cage/test/input/allCtorDtor/0006.gtmcg b/tools/cage/test/input/ctorDtor/0006.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0006.gtmcg rename to tools/cage/test/input/ctorDtor/0006.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0007.cpp b/tools/cage/test/input/ctorDtor/0007.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0007.cpp rename to tools/cage/test/input/ctorDtor/0007.cpp diff --git a/tools/cage/test/input/allCtorDtor/0007.gtmcg b/tools/cage/test/input/ctorDtor/0007.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0007.gtmcg rename to tools/cage/test/input/ctorDtor/0007.gtmcg diff --git a/tools/cage/test/input/allCtorDtor/0008.cpp b/tools/cage/test/input/ctorDtor/0008.cpp similarity index 100% rename from tools/cage/test/input/allCtorDtor/0008.cpp rename to tools/cage/test/input/ctorDtor/0008.cpp diff --git a/tools/cage/test/input/allCtorDtor/0008.gtmcg b/tools/cage/test/input/ctorDtor/0008.gtmcg similarity index 100% rename from tools/cage/test/input/allCtorDtor/0008.gtmcg rename to tools/cage/test/input/ctorDtor/0008.gtmcg diff --git a/tools/cage/test/input/functionPointers/0041.cpp b/tools/cage/test/input/functionPointers/0041.cpp deleted file mode 100644 index 8ea6dbbc..00000000 --- a/tools/cage/test/input/functionPointers/0041.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -typedef void (*target_func_T)(int a, int b, int c); - -void callTarget(int a, int b, int c) { - int d = a + b; - d *= c; -} - -void pointerCaller(target_func_T f, int a, int b, int c) { f(a, b, c); } - -int main(int argc, char** argv) { - int a, b, c; - a = b = c = 42; - pointerCaller(callTarget, a, b, c); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0041.gtaacg b/tools/cage/test/input/functionPointers/0041.gtaacg deleted file mode 100644 index 5920c3b2..00000000 --- a/tools/cage/test/input/functionPointers/0041.gtaacg +++ /dev/null @@ -1,252 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191": "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" - }, - "CallInfoMap": { - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191": { - "Arguments": [ - [ - "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a" - ], - [ - "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b" - ], - [ - "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c" - ] - ], - "CalledObjects": [ - "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@216@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@206@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f", - "c:@F@callTarget#I#I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@266-299", - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@CALL_EXPR@@182-191", - "c:@F@callTarget#I#I#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@95@F@callTarget#I#I#I#@d", - "c:0041.cpp@70@F@callTarget#I#I#I#@a", - "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a", - "c:0041.cpp@233@F@main#I#**C#@a", - "c:0041.cpp@84@F@callTarget#I#I#I#@c", - "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c", - "c:0041.cpp@233@F@main#I#**C#@c", - "c:0041.cpp@77@F@callTarget#I#I#I#@b", - "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b", - "c:0041.cpp@233@F@main#I#**C#@b" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@callTarget#I#I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z10callTargetiii" - ], - "Parameters": [ - "c:0041.cpp@70@F@callTarget#I#I#I#@a", - "c:0041.cpp@77@F@callTarget#I#I#I#@b", - "c:0041.cpp@84@F@callTarget#I#I#I#@c" - ], - "ReferencedInReturnStmts": [ - "c:@F@callTarget#I#I#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0041.cpp@206@F@main#I#**C#@argc", - "c:0041.cpp@216@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - }, - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z13pointerCallerPFviiiEiii" - ], - "Parameters": [ - "c:0041.cpp@142@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@f", - "c:0041.cpp@159@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@a", - "c:0041.cpp@166@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@b", - "c:0041.cpp@173@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@c" - ], - "ReferencedInReturnStmts": [ - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@callTarget#I#I#I#": "c:@F@callTarget#I#I#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#", - "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#": "c:@F@pointerCaller#*Fv(#I#I#I)#I#I#I#" - } - }, - "_CG": { - "_Z10callTargetiii": { - "callees": [], - "callers": [ - "_Z13pointerCallerPFviiiEiii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z13pointerCallerPFviiiEiii": { - "callees": [ - "_Z10callTargetiii" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z13pointerCallerPFviiiEiii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z13pointerCallerPFviiiEiii": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0041.gtipcg b/tools/cage/test/input/functionPointers/0041.gtipcg deleted file mode 100644 index 07c0dda0..00000000 --- a/tools/cage/test/input/functionPointers/0041.gtipcg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_Z10callTargetiii": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z13pointerCallerPFviiiEiii" - ] - }, - "_Z13pointerCallerPFviiiEiii": { - "callees": [ - "_Z10callTargetiii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z13pointerCallerPFviiiEiii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0041.gtmcg b/tools/cage/test/input/functionPointers/0041.gtmcg deleted file mode 100644 index 2d4732af..00000000 --- a/tools/cage/test/input/functionPointers/0041.gtmcg +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_CG": { - "_Z10callTargetiii": { - "callees": [], - "callers": [ - "_Z13pointerCallerPFviiiEiii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z13pointerCallerPFviiiEiii": { - "callees": [ - "_Z10callTargetiii" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z13pointerCallerPFviiiEiii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0041.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0045.cpp b/tools/cage/test/input/functionPointers/0045.cpp deleted file mode 100644 index b6933910..00000000 --- a/tools/cage/test/input/functionPointers/0045.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -int one() { return 1; } - -int two() { return 2; } - -int three() { return 3; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - if (i == 1) - return one; - if (i == 2) - return two; - if (i == 3) - return three; - return dflt; -} - -int main() { - int (*f)() = get(1); - int a = f(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0045.gtaacg b/tools/cage/test/input/functionPointers/0045.gtaacg deleted file mode 100644 index 74c8a72a..00000000 --- a/tools/cage/test/input/functionPointers/0045.gtaacg +++ /dev/null @@ -1,349 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@299-301": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@299-301": { - "Arguments": [], - "CalledObjects": [ - "c:0045.cpp@268@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0045.cpp@134@F@get#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0045.cpp@268@F@main#@f", - "c:@F@main#@CALL_EXPR@@281-286", - "c:@F@dflt#", - "c:@F@one#", - "c:@F@three#", - "c:@F@two#", - "c:@F@get#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0045.cpp@291@F@main#@a", - "c:@F@main#@CALL_EXPR@@299-301", - "c:@F@dflt#@SRETURN", - "c:@F@one#@SRETURN", - "c:@F@three#@SRETURN", - "c:@F@two#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0045.cpp@134@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@dflt#", - "c:@F@one#", - "c:@F@three#", - "c:@F@two#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - }, - "c:@F@three#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5threev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@three#@SRETURN" - ] - }, - "c:@F@two#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3twov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@two#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#", - "c:@F@three#": "c:@F@three#", - "c:@F@two#": "c:@F@two#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 3, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 6, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3twov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5threev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3geti", - "_Z3onev", - "_Z3twov", - "_Z4dfltv", - "_Z5threev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0045.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0, - "_Z3onev": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0045.gtipcg b/tools/cage/test/input/functionPointers/0045.gtipcg deleted file mode 100644 index 44fe6717..00000000 --- a/tools/cage/test/input/functionPointers/0045.gtipcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 7, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3twov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5threev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3geti", - "_Z3onev", - "_Z3twov", - "_Z4dfltv", - "_Z5threev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0045.gtmcg b/tools/cage/test/input/functionPointers/0045.gtmcg deleted file mode 100644 index 32644f79..00000000 --- a/tools/cage/test/input/functionPointers/0045.gtmcg +++ /dev/null @@ -1,124 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3twov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5threev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z5threev", - "_Z4dfltv", - "_Z3twov", - "_Z3onev", - "_Z3geti" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0045.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0046.cpp b/tools/cage/test/input/functionPointers/0046.cpp deleted file mode 100644 index e56cba8c..00000000 --- a/tools/cage/test/input/functionPointers/0046.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -int one() { return 1; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - if (i == 1) - return one; - return dflt; -} - -Fn get2(int i) { return get(i); } - -int main() { - int (*f)() = get2(1); - int a = f(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0046.gtaacg b/tools/cage/test/input/functionPointers/0046.gtaacg deleted file mode 100644 index 23255311..00000000 --- a/tools/cage/test/input/functionPointers/0046.gtaacg +++ /dev/null @@ -1,314 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@221-223": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@221-223": { - "Arguments": [], - "CalledObjects": [ - "c:0046.cpp@189@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0046.cpp@82@F@get#I#@i", - "c:0046.cpp@147@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0046.cpp@189@F@main#@f", - "c:@F@main#@CALL_EXPR@@202-208", - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0046.cpp@213@F@main#@a", - "c:@F@main#@CALL_EXPR@@221-223", - "c:@F@dflt#@SRETURN", - "c:@F@one#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0046.cpp@82@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0046.cpp@147@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0046.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3onev": 0, - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0046.gtipcg b/tools/cage/test/input/functionPointers/0046.gtipcg deleted file mode 100644 index a0812c44..00000000 --- a/tools/cage/test/input/functionPointers/0046.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0046.gtmcg b/tools/cage/test/input/functionPointers/0046.gtmcg deleted file mode 100644 index cea2cdc6..00000000 --- a/tools/cage/test/input/functionPointers/0046.gtmcg +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4dfltv", - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0046.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0047.cpp b/tools/cage/test/input/functionPointers/0047.cpp deleted file mode 100644 index 0dda3709..00000000 --- a/tools/cage/test/input/functionPointers/0047.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -int one() { return 1; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - if (i == 1) - return one; - return dflt; -} - -Fn get2(int i) { return get(i); } - -int main() { - int (*f)() = get2(1); - f(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0047.gtaacg b/tools/cage/test/input/functionPointers/0047.gtaacg deleted file mode 100644 index 315f2cb3..00000000 --- a/tools/cage/test/input/functionPointers/0047.gtaacg +++ /dev/null @@ -1,313 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@213-215": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@213-215": { - "Arguments": [], - "CalledObjects": [ - "c:0047.cpp@189@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0047.cpp@82@F@get#I#@i", - "c:0047.cpp@147@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0047.cpp@189@F@main#@f", - "c:@F@main#@CALL_EXPR@@202-208", - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@213-215", - "c:@F@dflt#@SRETURN", - "c:@F@one#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0047.cpp@82@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0047.cpp@147@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0047.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3onev": 0, - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0047.gtipcg b/tools/cage/test/input/functionPointers/0047.gtipcg deleted file mode 100644 index a0812c44..00000000 --- a/tools/cage/test/input/functionPointers/0047.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0047.gtmcg b/tools/cage/test/input/functionPointers/0047.gtmcg deleted file mode 100644 index 10baa04d..00000000 --- a/tools/cage/test/input/functionPointers/0047.gtmcg +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4dfltv", - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0047.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0048.cpp b/tools/cage/test/input/functionPointers/0048.cpp deleted file mode 100644 index fd08e109..00000000 --- a/tools/cage/test/input/functionPointers/0048.cpp +++ /dev/null @@ -1,19 +0,0 @@ - -int one() { return 1; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - if (i == 1) - return one; - return dflt; -} - -Fn get2(int i) { return get(i); } - -int main() { - get2(1)(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0048.gtaacg b/tools/cage/test/input/functionPointers/0048.gtaacg deleted file mode 100644 index b0f0f6cc..00000000 --- a/tools/cage/test/input/functionPointers/0048.gtaacg +++ /dev/null @@ -1,311 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@189-197": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@189-197": { - "Arguments": [], - "CalledObjects": [ - "c:@F@main#@CALL_EXPR@@189-195" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0048.cpp@82@F@get#I#@i", - "c:0048.cpp@147@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@189-195", - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@189-197", - "c:@F@dflt#@SRETURN", - "c:@F@one#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0048.cpp@82@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@dflt#", - "c:@F@one#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0048.cpp@147@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@163-168", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0048.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0048.gtipcg b/tools/cage/test/input/functionPointers/0048.gtipcg deleted file mode 100644 index 55cee4ba..00000000 --- a/tools/cage/test/input/functionPointers/0048.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0048.gtmcg b/tools/cage/test/input/functionPointers/0048.gtmcg deleted file mode 100644 index e2900924..00000000 --- a/tools/cage/test/input/functionPointers/0048.gtmcg +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4dfltv", - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0048.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0049.cpp b/tools/cage/test/input/functionPointers/0049.cpp deleted file mode 100644 index de23ed83..00000000 --- a/tools/cage/test/input/functionPointers/0049.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -int one() { return 1; } - -typedef int (*Fn)(); - -Fn get(int i) { - Fn f = one; - return f; -} - -Fn get2(int i) { return get(i); } - -int main() { - get2(1)(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0049.gtaacg b/tools/cage/test/input/functionPointers/0049.gtaacg deleted file mode 100644 index 9919d897..00000000 --- a/tools/cage/test/input/functionPointers/0049.gtaacg +++ /dev/null @@ -1,265 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@143-151": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@143-151": { - "Arguments": [], - "CalledObjects": [ - "c:@F@main#@CALL_EXPR@@143-149" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0049.cpp@55@F@get#I#@i", - "c:0049.cpp@101@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@143-149", - "c:@F@get2#I#@CALL_EXPR@@117-122", - "c:0049.cpp@66@F@get#I#@f", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN", - "c:@F@one#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@143-151", - "c:@F@one#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0049.cpp@55@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:0049.cpp@66@F@get#I#@f", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0049.cpp@101@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@117-122", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0049.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0049.gtipcg b/tools/cage/test/input/functionPointers/0049.gtipcg deleted file mode 100644 index cb0456e7..00000000 --- a/tools/cage/test/input/functionPointers/0049.gtipcg +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0049.gtmcg b/tools/cage/test/input/functionPointers/0049.gtmcg deleted file mode 100644 index f5d5c78f..00000000 --- a/tools/cage/test/input/functionPointers/0049.gtmcg +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0049.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0051.cpp b/tools/cage/test/input/functionPointers/0051.cpp deleted file mode 100644 index 6674ddae..00000000 --- a/tools/cage/test/input/functionPointers/0051.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -int one() { return 1; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - Fn a = dflt; - if (i == 1) - return one; - return a; -} - -Fn get2(int i) { return get(i); } - -int main() { - get2(1)(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0051.gtaacg b/tools/cage/test/input/functionPointers/0051.gtaacg deleted file mode 100644 index 7fbe7851..00000000 --- a/tools/cage/test/input/functionPointers/0051.gtaacg +++ /dev/null @@ -1,312 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@201-209": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@201-209": { - "Arguments": [], - "CalledObjects": [ - "c:@F@main#@CALL_EXPR@@201-207" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0051.cpp@82@F@get#I#@i", - "c:0051.cpp@159@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@201-207", - "c:@F@get2#I#@CALL_EXPR@@175-180", - "c:0051.cpp@93@F@get#I#@a", - "c:@F@one#", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN", - "c:@F@dflt#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@201-209", - "c:@F@one#@SRETURN", - "c:@F@dflt#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0051.cpp@82@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:0051.cpp@93@F@get#I#@a", - "c:@F@one#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0051.cpp@159@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@175-180", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0051.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0051.gtipcg b/tools/cage/test/input/functionPointers/0051.gtipcg deleted file mode 100644 index 625b587a..00000000 --- a/tools/cage/test/input/functionPointers/0051.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0051.gtmcg b/tools/cage/test/input/functionPointers/0051.gtmcg deleted file mode 100644 index 2657b61b..00000000 --- a/tools/cage/test/input/functionPointers/0051.gtmcg +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4dfltv", - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0051.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0052.cpp b/tools/cage/test/input/functionPointers/0052.cpp deleted file mode 100644 index e6091b8f..00000000 --- a/tools/cage/test/input/functionPointers/0052.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -int one() { return 1; } - -int dflt() { return 42; } - -typedef int (*Fn)(); - -Fn get(int i) { - Fn a; - a = dflt; - if (i == 1) { - return one; - } - return a; -} - -Fn get2(int i) { return get(i); } - -int main() { - get2(1)(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0052.gtaacg b/tools/cage/test/input/functionPointers/0052.gtaacg deleted file mode 100644 index e87dd536..00000000 --- a/tools/cage/test/input/functionPointers/0052.gtaacg +++ /dev/null @@ -1,312 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@212-220": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@212-220": { - "Arguments": [], - "CalledObjects": [ - "c:@F@main#@CALL_EXPR@@212-218" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get2#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0052.cpp@82@F@get#I#@i", - "c:0052.cpp@170@F@get2#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@212-218", - "c:@F@get2#I#@CALL_EXPR@@186-191", - "c:0052.cpp@93@F@get#I#@a", - "c:@F@one#", - "c:@F@get#I#@SRETURN", - "c:@F@get2#I#@SRETURN", - "c:@F@dflt#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@212-220", - "c:@F@one#@SRETURN", - "c:@F@dflt#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@dflt#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4dfltv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@dflt#@SRETURN" - ] - }, - "c:@F@get#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3geti" - ], - "Parameters": [ - "c:0052.cpp@82@F@get#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:0052.cpp@93@F@get#I#@a", - "c:@F@one#", - "c:@F@get#I#@SRETURN" - ] - }, - "c:@F@get2#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4get2i" - ], - "Parameters": [ - "c:0052.cpp@170@F@get2#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get2#I#@CALL_EXPR@@186-191", - "c:@F@get2#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@one#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3onev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@one#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@dflt#": "c:@F@dflt#", - "c:@F@get#I#": "c:@F@get#I#", - "c:@F@get2#I#": "c:@F@get2#I#", - "c:@F@main#": "c:@F@main#", - "c:@F@one#": "c:@F@one#" - } - }, - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3geti": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0052.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4get2i": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0052.gtipcg b/tools/cage/test/input/functionPointers/0052.gtipcg deleted file mode 100644 index 5b7490d5..00000000 --- a/tools/cage/test/input/functionPointers/0052.gtipcg +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_Z3geti": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4get2i" - ] - }, - "_Z3onev": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4dfltv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3onev", - "_Z4dfltv", - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0052.gtmcg b/tools/cage/test/input/functionPointers/0052.gtmcg deleted file mode 100644 index 054f3e2f..00000000 --- a/tools/cage/test/input/functionPointers/0052.gtmcg +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_CG": { - "_Z3geti": { - "callees": [], - "callers": [ - "_Z4get2i" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3onev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4dfltv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4get2i": { - "callees": [ - "_Z3geti" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4dfltv", - "_Z3onev", - "_Z4get2i" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0052.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0053.cpp b/tools/cage/test/input/functionPointers/0053.cpp deleted file mode 100644 index 734d2afe..00000000 --- a/tools/cage/test/input/functionPointers/0053.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// TODO Fix this for AA -int main(int argc, char** argv) { - const auto l = [](int a, int b) { - float alpha = a / (1.0 * b); - double delta = .0; - for (int i = 0; i < 4; ++i) { - delta = a * i * alpha; - } - return delta; - }; - auto d = l(2, 4); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0053.gtaacg b/tools/cage/test/input/functionPointers/0053.gtaacg deleted file mode 100644 index eb9cedf2..00000000 --- a/tools/cage/test/input/functionPointers/0053.gtaacg +++ /dev/null @@ -1 +0,0 @@ -{"_ZZ4mainEN3$_08__invokeEii":{"callees":["_ZZ4mainENK3$_0clEii"],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["_ZZ4mainENK3$_0cvPFdiiEEv"]},"_ZZ4mainEN3$_0C1EOS_":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0C2EOS_":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0D1Ev":{"callees":[],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainEN3$_0D2Ev":{"callees":[],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":["main"]},"_ZZ4mainENK3$_0clEii":{"callees":[],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":5,"overriddenBy":[],"overriddenFunctions":[],"parents":["_ZZ4mainEN3$_08__invokeEii","main"]},"_ZZ4mainENK3$_0cvPFdiiEEv":{"callees":["_ZZ4mainEN3$_08__invokeEii"],"doesOverride":false,"hasBody":false,"isVirtual":false,"numStatements":0,"overriddenBy":[],"overriddenFunctions":[],"parents":[]},"main":{"callees":["_ZZ4mainEN3$_0C1EOS_","_ZZ4mainEN3$_0C2EOS_","_ZZ4mainEN3$_0D1Ev","_ZZ4mainEN3$_0D2Ev","_ZZ4mainENK3$_0clEii"],"doesOverride":false,"hasBody":true,"isVirtual":false,"numStatements":3,"overriddenBy":[],"overriddenFunctions":[],"parents":[]}} diff --git a/tools/cage/test/input/functionPointers/0053.gtipcg b/tools/cage/test/input/functionPointers/0053.gtipcg deleted file mode 100644 index eb7dc0c2..00000000 --- a/tools/cage/test/input/functionPointers/0053.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0clEii": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0053.gtmcg b/tools/cage/test/input/functionPointers/0053.gtmcg deleted file mode 100644 index 13103f02..00000000 --- a/tools/cage/test/input/functionPointers/0053.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0clEii": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0053.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 15, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0053.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_ZZ4mainENK3$_0clEii": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 17, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "GITDIR-NOTFOUND", - "version": "0.4" - }, - "version": "2.0" - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0100.cpp b/tools/cage/test/input/functionPointers/0100.cpp deleted file mode 100644 index a2033017..00000000 --- a/tools/cage/test/input/functionPointers/0100.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// function pointer without hit - -int foo(float a) { return 0; } - -int main(int argc, char* argv[]) { - int (*function)(); - - function(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0100.gtaacg b/tools/cage/test/input/functionPointers/0100.gtaacg deleted file mode 100644 index 2867703a..00000000 --- a/tools/cage/test/input/functionPointers/0100.gtaacg +++ /dev/null @@ -1,172 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#I#**C#@CALL_EXPR@@124-133": "c:@F@main#I#**C#" - }, - "CallInfoMap": { - "c:@F@main#I#**C#@CALL_EXPR@@124-133": { - "Arguments": [], - "CalledObjects": [ - "c:0100.cpp@102@F@main#I#**C#@function" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@124-133" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0100.cpp@84@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0100.cpp@74@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0100.cpp@41@F@foo#f#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0100.cpp@102@F@main#I#**C#@function" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#f#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foof" - ], - "Parameters": [ - "c:0100.cpp@41@F@foo#f#@a" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#f#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0100.cpp@74@F@main#I#**C#@argc", - "c:0100.cpp@84@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#f#": "c:@F@foo#f#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0100.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0100.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0100.gtipcg b/tools/cage/test/input/functionPointers/0100.gtipcg deleted file mode 100644 index 9da643e1..00000000 --- a/tools/cage/test/input/functionPointers/0100.gtipcg +++ /dev/null @@ -1,22 +0,0 @@ -{ - "_Z3foof": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0100.gtmcg b/tools/cage/test/input/functionPointers/0100.gtmcg deleted file mode 100644 index 7deca77a..00000000 --- a/tools/cage/test/input/functionPointers/0100.gtmcg +++ /dev/null @@ -1,44 +0,0 @@ -{ - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0100.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0100.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0101.cpp b/tools/cage/test/input/functionPointers/0101.cpp deleted file mode 100644 index be644099..00000000 --- a/tools/cage/test/input/functionPointers/0101.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// function pointer without hit - -int foo(float a) { return 0; } - -int hit1() { return 0; } - -int main(int argc, char* argv[]) { - int (*function)(); - - function(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0101.gtaacg b/tools/cage/test/input/functionPointers/0101.gtaacg deleted file mode 100644 index f5929f9b..00000000 --- a/tools/cage/test/input/functionPointers/0101.gtaacg +++ /dev/null @@ -1,225 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#I#**C#@CALL_EXPR@@150-159": "c:@F@main#I#**C#" - }, - "CallInfoMap": { - "c:@F@main#I#**C#@CALL_EXPR@@150-159": { - "Arguments": [], - "CalledObjects": [ - "c:0101.cpp@128@F@main#I#**C#@function" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@150-159" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0101.cpp@41@F@foo#f#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0101.cpp@128@F@main#I#**C#@function" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0101.cpp@110@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0101.cpp@100@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#f#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foof" - ], - "Parameters": [ - "c:0101.cpp@41@F@foo#f#@a" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#f#@SRETURN" - ] - }, - "c:@F@hit1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4hit1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@hit1#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0101.cpp@100@F@main#I#**C#@argc", - "c:0101.cpp@110@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#f#": "c:@F@foo#f#", - "c:@F@hit1#": "c:@F@hit1#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0101.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0101.gtipcg b/tools/cage/test/input/functionPointers/0101.gtipcg deleted file mode 100644 index 24f600f8..00000000 --- a/tools/cage/test/input/functionPointers/0101.gtipcg +++ /dev/null @@ -1,32 +0,0 @@ -{ - "_Z3foof": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z4hit1v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0101.gtmcg b/tools/cage/test/input/functionPointers/0101.gtmcg deleted file mode 100644 index ec87dba8..00000000 --- a/tools/cage/test/input/functionPointers/0101.gtmcg +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0101.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0102.cpp b/tools/cage/test/input/functionPointers/0102.cpp deleted file mode 100644 index 2c4996bc..00000000 --- a/tools/cage/test/input/functionPointers/0102.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// function pointer with two hits - -int foo(float a) { return 0; } - -int hit1() { return 0; } - -int hit2() { return 5; } - -int main(int argc, char* argv[]) { - int (*function)(); - - function(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0102.gtaacg b/tools/cage/test/input/functionPointers/0102.gtaacg deleted file mode 100644 index 42f09d1f..00000000 --- a/tools/cage/test/input/functionPointers/0102.gtaacg +++ /dev/null @@ -1,278 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#I#**C#@CALL_EXPR@@178-187": "c:@F@main#I#**C#" - }, - "CallInfoMap": { - "c:@F@main#I#**C#@CALL_EXPR@@178-187": { - "Arguments": [], - "CalledObjects": [ - "c:0102.cpp@156@F@main#I#**C#@function" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@178-187" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#f#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0102.cpp@43@F@foo#f#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0102.cpp@156@F@main#I#**C#@function" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0102.cpp@138@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0102.cpp@128@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#f#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foof" - ], - "Parameters": [ - "c:0102.cpp@43@F@foo#f#@a" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#f#@SRETURN" - ] - }, - "c:@F@hit1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4hit1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@hit1#@SRETURN" - ] - }, - "c:@F@hit2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4hit2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@hit2#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0102.cpp@128@F@main#I#**C#@argc", - "c:0102.cpp@138@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#f#": "c:@F@foo#f#", - "c:@F@hit1#": "c:@F@hit1#", - "c:@F@hit2#": "c:@F@hit2#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit2v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0102.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0102.gtipcg b/tools/cage/test/input/functionPointers/0102.gtipcg deleted file mode 100644 index 525b763e..00000000 --- a/tools/cage/test/input/functionPointers/0102.gtipcg +++ /dev/null @@ -1,42 +0,0 @@ -{ - "_Z3foof": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z4hit1v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z4hit2v": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0102.gtmcg b/tools/cage/test/input/functionPointers/0102.gtmcg deleted file mode 100644 index bd8007c1..00000000 --- a/tools/cage/test/input/functionPointers/0102.gtmcg +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_CG": { - "_Z3foof": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4hit2v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0102.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0103.cpp b/tools/cage/test/input/functionPointers/0103.cpp deleted file mode 100644 index 3f219c0c..00000000 --- a/tools/cage/test/input/functionPointers/0103.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// function pointer with two hits - -void caller(int (*function)()) {} - -void foo() {} - -int hit() { return 5; } - -int main(int argc, char* argv[]) { - caller(&hit); - foo(); - - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0103.gtaacg b/tools/cage/test/input/functionPointers/0103.gtaacg deleted file mode 100644 index 6c9b32f9..00000000 --- a/tools/cage/test/input/functionPointers/0103.gtaacg +++ /dev/null @@ -1,276 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@hit#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@caller#*FI()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0103.cpp@129@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0103.cpp@119@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0103.cpp@47@F@caller#*FI()#@function", - "&c:@F@hit#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@hit#" - } - ] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@147-158", - "c:@F@caller#*FI()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@163-167", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@caller#*FI()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z6callerPFivE" - ], - "Parameters": [ - "c:0103.cpp@47@F@caller#*FI()#@function" - ], - "ReferencedInReturnStmts": [ - "c:@F@caller#*FI()#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@hit#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3hitv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@hit#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0103.cpp@119@F@main#I#**C#@argc", - "c:0103.cpp@129@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@F@hit#": "c:@F@hit#", - "c:@F@caller#*FI()#": "c:@F@caller#*FI()#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@hit#": "c:@F@hit#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3hitv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z6callerPFivE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z6callerPFivE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0103.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "_Z6callerPFivE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0103.gtipcg b/tools/cage/test/input/functionPointers/0103.gtipcg deleted file mode 100644 index d87ac13a..00000000 --- a/tools/cage/test/input/functionPointers/0103.gtipcg +++ /dev/null @@ -1,49 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3hitv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z6callerPFivE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z6callerPFivE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0103.gtmcg b/tools/cage/test/input/functionPointers/0103.gtmcg deleted file mode 100644 index b0e45e78..00000000 --- a/tools/cage/test/input/functionPointers/0103.gtmcg +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3hitv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z6callerPFivE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z6callerPFivE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0103.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0115.cpp b/tools/cage/test/input/functionPointers/0115.cpp deleted file mode 100644 index d46eb7b0..00000000 --- a/tools/cage/test/input/functionPointers/0115.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Test for unions involving function pointers -extern void foo(); -using FType = decltype(foo); - -class C { - public: - union { - int i; - FType* f; - }; -}; - -int main() { - C c; - c.i = 4; - c.f = foo; - c.f(); -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0115.gtaacg b/tools/cage/test/input/functionPointers/0115.gtaacg deleted file mode 100644 index 3202c261..00000000 --- a/tools/cage/test/input/functionPointers/0115.gtaacg +++ /dev/null @@ -1,453 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@205-209": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@205-209": { - "Arguments": [], - "CalledObjects": [ - "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@C@Ua@F@#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&1$@S@C@Ua#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&1$@S@C@Ua#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&1$@S@C@Ua#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&1$@S@C@Ua#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&&$@S@C@Ua#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&&$@S@C@Ua#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&&$@S@C@Ua#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#&&$@S@C@Ua#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@Ua@F@#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&1$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#&&$@S@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@C@F@C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@i", - "c:@S@C@Ua@FI@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155", - "c:@S@C@UNNAMED_UNION@96-155" - ], - "Prefixes": [ - { - "Member": "c:@S@C@Ua@FI@f", - "Object": "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f" - }, - { - "Member": "c:@S@C@Ua@FI@i", - "Object": "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@i" - } - ] - }, - { - "Objects": [ - "((c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155).c:@S@C@Ua@FI@f", - "c:@S@C@Ua@FI@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@205-209", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0115.cpp@174@F@main#@c", - "c:@F@main#@CALL_EXPR@@176-176" - ], - "Prefixes": [ - { - "Member": "c:@S@C@UNNAMED_UNION@96-155", - "Object": "(c:0115.cpp@174@F@main#@c).c:@S@C@UNNAMED_UNION@96-155" - } - ] - }, - { - "Objects": [ - "c:@S@C@F@C#@THIS", - "&c:@F@main#@CALL_EXPR@@176-176" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@176-176" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@C@F@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2Ev", - "_ZN1CC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#&&$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2EOS_", - "_ZN1CC1EOS_" - ], - "Parameters": [ - "c:@S@C@F@C#&&$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@F@C#&1$@S@C#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CC2ERKS_", - "_ZN1CC1ERKS_" - ], - "Parameters": [ - "c:@S@C@F@C#&1$@S@C#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@Ua@F@#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CUt_C2Ev", - "_ZN1CUt_C1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@Ua@F@#&&$@S@C@Ua#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CUt_C2EOS0_", - "_ZN1CUt_C1EOS0_" - ], - "Parameters": [ - "c:@S@C@Ua@F@#&&$@S@C@Ua#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@C@Ua@F@#&1$@S@C@Ua#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1CUt_C2ERKS0_", - "_ZN1CUt_C1ERKS0_" - ], - "Parameters": [ - "c:@S@C@Ua@F@#&1$@S@C@Ua#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@S@C@F@C#": "c:@S@C@F@C#", - "c:@S@C@F@C#&&$@S@C#": "c:@S@C@F@C#&&$@S@C#", - "c:@S@C@F@C#&1$@S@C#": "c:@S@C@F@C#&1$@S@C#", - "c:@S@C@Ua@F@#": "c:@S@C@Ua@F@#", - "c:@S@C@Ua@F@#&&$@S@C@Ua#": "c:@S@C@Ua@F@#&&$@S@C@Ua#", - "c:@S@C@Ua@F@#&1$@S@C@Ua#": "c:@S@C@Ua@F@#&1$@S@C@Ua#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_ZN1CC1Ev", - "_ZN1CC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 9 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0115.gtipcg b/tools/cage/test/input/functionPointers/0115.gtipcg deleted file mode 100644 index 6f96317f..00000000 --- a/tools/cage/test/input/functionPointers/0115.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0115.gtmcg b/tools/cage/test/input/functionPointers/0115.gtmcg deleted file mode 100644 index b2ae4d91..00000000 --- a/tools/cage/test/input/functionPointers/0115.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0115.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 9 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", - "version": "0.3" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0201.cpp b/tools/cage/test/input/functionPointers/0201.cpp deleted file mode 100644 index c6e26aa3..00000000 --- a/tools/cage/test/input/functionPointers/0201.cpp +++ /dev/null @@ -1,11 +0,0 @@ - -using func_t = void (*)(); - -void foo() {}; - -func_t get_f(func_t f) { return f; } - -int main() { - func_t f = get_f(foo); - f(); -} diff --git a/tools/cage/test/input/functionPointers/0201.gtaacg b/tools/cage/test/input/functionPointers/0201.gtaacg deleted file mode 100644 index 54a1c7f5..00000000 --- a/tools/cage/test/input/functionPointers/0201.gtaacg +++ /dev/null @@ -1,202 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@122-124": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@122-124": { - "Arguments": [], - "CalledObjects": [ - "c:0201.cpp@97@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_f#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0201.cpp@97@F@main#@f", - "c:@F@main#@CALL_EXPR@@108-117", - "c:0201.cpp@57@F@get_f#*Fv()#@f", - "c:@F@foo#", - "c:@F@get_f#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@122-124", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@get_f#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5get_fPFvvE" - ], - "Parameters": [ - "c:0201.cpp@57@F@get_f#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:0201.cpp@57@F@get_f#*Fv()#@f", - "c:@F@get_f#*Fv()#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@get_f#*Fv()#": "c:@F@get_f#*Fv()#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5get_fPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0201.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "_Z5get_fPFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0201.gtipcg b/tools/cage/test/input/functionPointers/0201.gtipcg deleted file mode 100644 index fe98d17c..00000000 --- a/tools/cage/test/input/functionPointers/0201.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5get_fPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0201.gtmcg b/tools/cage/test/input/functionPointers/0201.gtmcg deleted file mode 100644 index 76bb81c8..00000000 --- a/tools/cage/test/input/functionPointers/0201.gtmcg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5get_fPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0201.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0202.cpp b/tools/cage/test/input/functionPointers/0202.cpp deleted file mode 100644 index 5349de32..00000000 --- a/tools/cage/test/input/functionPointers/0202.cpp +++ /dev/null @@ -1,10 +0,0 @@ - -using func_t = void (*)(); - -void foo() {} - -void cast() { - func_t f; - f = reinterpret_cast(reinterpret_cast(foo)); - f(); -} diff --git a/tools/cage/test/input/functionPointers/0202.gtaacg b/tools/cage/test/input/functionPointers/0202.gtaacg deleted file mode 100644 index 8a63cdd8..00000000 --- a/tools/cage/test/input/functionPointers/0202.gtaacg +++ /dev/null @@ -1,145 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@cast#@CALL_EXPR@@135-137": "c:@F@cast#" - }, - "CallInfoMap": { - "c:@F@cast#@CALL_EXPR@@135-137": { - "Arguments": [], - "CalledObjects": [ - "c:0202.cpp@60@F@cast#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@cast#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@cast#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0202.cpp@60@F@cast#@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@cast#@CALL_EXPR@@135-137", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@cast#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4castv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@cast#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@cast#": "c:@F@cast#", - "c:@F@foo#": "c:@F@foo#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z4castv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0202.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4castv": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0202.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0202.gtipcg b/tools/cage/test/input/functionPointers/0202.gtipcg deleted file mode 100644 index e4a91315..00000000 --- a/tools/cage/test/input/functionPointers/0202.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4castv" - ] - }, - "_Z4castv": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0202.gtmcg b/tools/cage/test/input/functionPointers/0202.gtmcg deleted file mode 100644 index 92a87e42..00000000 --- a/tools/cage/test/input/functionPointers/0202.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z4castv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0202.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4castv": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0202.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0203.cpp b/tools/cage/test/input/functionPointers/0203.cpp deleted file mode 100644 index cb618332..00000000 --- a/tools/cage/test/input/functionPointers/0203.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -using func_t = void (*)(); - -void get_func2(func_t* out, func_t in) { - *out = in; - in(); -} -func_t get_func(func_t f) { - func_t res; - get_func2(&res, f); - return res; -} -void foo() {} -int main() { - auto f = get_func(foo); - f(); -} diff --git a/tools/cage/test/input/functionPointers/0203.gtaacg b/tools/cage/test/input/functionPointers/0203.gtaacg deleted file mode 100644 index 7a1c622c..00000000 --- a/tools/cage/test/input/functionPointers/0203.gtaacg +++ /dev/null @@ -1,291 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88": "c:@F@get_func2#**Fv()#S1_#", - "c:@F@main#@CALL_EXPR@@228-230": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88": { - "Arguments": [], - "CalledObjects": [ - "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in" - ] - }, - "c:@F@main#@CALL_EXPR@@228-230": { - "Arguments": [], - "CalledObjects": [ - "c:0203.cpp@202@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func2#**Fv()#S1_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", - "&c:0203.cpp@123@F@get_func#*Fv()#@res" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out" - } - ] - }, - { - "Objects": [ - "c:@F@get_func#*Fv()#@CALL_EXPR@@137-154", - "c:@F@get_func2#**Fv()#S1_#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0203.cpp@202@F@main#@f", - "c:@F@main#@CALL_EXPR@@211-223", - "c:0203.cpp@123@F@get_func#*Fv()#@res", - "*c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", - "c:@F@get_func#*Fv()#@SRETURN", - "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in", - "c:0203.cpp@109@F@get_func#*Fv()#@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@228-230", - "c:@F@get_func2#**Fv()#S1_#@CALL_EXPR@@85-88", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@get_func#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8get_funcPFvvE" - ], - "Parameters": [ - "c:0203.cpp@109@F@get_func#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:0203.cpp@123@F@get_func#*Fv()#@res", - "c:@F@get_func#*Fv()#@SRETURN" - ] - }, - "c:@F@get_func2#**Fv()#S1_#": { - "IsVariadic": false, - "MangledNames": [ - "_Z9get_func2PPFvvES0_" - ], - "Parameters": [ - "c:0203.cpp@44@F@get_func2#**Fv()#S1_#@out", - "c:0203.cpp@57@F@get_func2#**Fv()#S1_#@in" - ], - "ReferencedInReturnStmts": [ - "c:@F@get_func2#**Fv()#S1_#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@get_func#*Fv()#": "c:@F@get_func#*Fv()#", - "c:@F@get_func2#**Fv()#S1_#": "c:@F@get_func2#**Fv()#S1_#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z9get_func2PPFvvES0_", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8get_funcPFvvE": { - "callees": [ - "_Z9get_func2PPFvvES0_" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z9get_func2PPFvvES0_": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9get_func2PPFvvES0_": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "_Z8get_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z8get_funcPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0203.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "_Z8get_funcPFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0203.gtipcg b/tools/cage/test/input/functionPointers/0203.gtipcg deleted file mode 100644 index 81dd03f1..00000000 --- a/tools/cage/test/input/functionPointers/0203.gtipcg +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z9get_func2PPFvvES0_", - "main" - ] - }, - "_Z8get_funcPFvvE": { - "callees": [ - "_Z9get_func2PPFvvES0_" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z9get_func2PPFvvES0_": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z8get_funcPFvvE" - ] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z8get_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0203.gtmcg b/tools/cage/test/input/functionPointers/0203.gtmcg deleted file mode 100644 index 3470f01a..00000000 --- a/tools/cage/test/input/functionPointers/0203.gtmcg +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main", - "_Z9get_func2PPFvvES0_" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8get_funcPFvvE": { - "callees": [ - "_Z9get_func2PPFvvES0_" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9get_func2PPFvvES0_": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "_Z8get_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z8get_funcPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0203.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0204.cpp b/tools/cage/test/input/functionPointers/0204.cpp deleted file mode 100644 index fb3d0846..00000000 --- a/tools/cage/test/input/functionPointers/0204.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -using func_t = void (*)(); -void call_func2(func_t f) { - auto f2 = f; - f(); -} -void call_func(func_t f) { - auto f2 = f; - call_func2(f2); -} -void foo() {} -int main() { - func_t f = foo; - call_func(f); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0204.gtaacg b/tools/cage/test/input/functionPointers/0204.gtaacg deleted file mode 100644 index cb2077d1..00000000 --- a/tools/cage/test/input/functionPointers/0204.gtaacg +++ /dev/null @@ -1,271 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75": "c:@F@call_func2#*Fv()#" - }, - "CallInfoMap": { - "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75": { - "Arguments": [], - "CalledObjects": [ - "c:0204.cpp@44@F@call_func2#*Fv()#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_func2#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_func#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_func#*Fv()#@CALL_EXPR@@124-137", - "c:@F@call_func2#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@189-200", - "c:@F@call_func#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0204.cpp@58@F@call_func2#*Fv()#@f2", - "c:0204.cpp@44@F@call_func2#*Fv()#@f", - "c:0204.cpp@109@F@call_func#*Fv()#@f2", - "c:0204.cpp@95@F@call_func#*Fv()#@f", - "c:0204.cpp@171@F@main#@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_func2#*Fv()#@CALL_EXPR@@73-75", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@call_func#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z9call_funcPFvvE" - ], - "Parameters": [ - "c:0204.cpp@95@F@call_func#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@call_func#*Fv()#@SRETURN" - ] - }, - "c:@F@call_func2#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z10call_func2PFvvE" - ], - "Parameters": [ - "c:0204.cpp@44@F@call_func2#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@call_func2#*Fv()#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@call_func#*Fv()#": "c:@F@call_func#*Fv()#", - "c:@F@call_func2#*Fv()#": "c:@F@call_func2#*Fv()#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z10call_func2PFvvE": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "_Z9call_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z10call_func2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9call_funcPFvvE": { - "callees": [ - "_Z10call_func2PFvvE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z10call_func2PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z9call_funcPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0204.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z9call_funcPFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0204.gtipcg b/tools/cage/test/input/functionPointers/0204.gtipcg deleted file mode 100644 index 1892aa83..00000000 --- a/tools/cage/test/input/functionPointers/0204.gtipcg +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_Z10call_func2PFvvE": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z9call_funcPFvvE" - ] - }, - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z10call_func2PFvvE" - ] - }, - "_Z9call_funcPFvvE": { - "callees": [ - "_Z10call_func2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z9call_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0204.gtmcg b/tools/cage/test/input/functionPointers/0204.gtmcg deleted file mode 100644 index 30f473a3..00000000 --- a/tools/cage/test/input/functionPointers/0204.gtmcg +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_CG": { - "_Z10call_func2PFvvE": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "_Z9call_funcPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z10call_func2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9call_funcPFvvE": { - "callees": [ - "_Z10call_func2PFvvE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z9call_funcPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0204.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0205.cpp b/tools/cage/test/input/functionPointers/0205.cpp deleted file mode 100644 index b3b2842c..00000000 --- a/tools/cage/test/input/functionPointers/0205.cpp +++ /dev/null @@ -1,11 +0,0 @@ - -using func_t = void (*)(); -void foo() {} -void bar() {} - -int main() { - func_t a, b; - bool s = true; - (s ? a : b) = foo; - (s ? a : b)(); -} diff --git a/tools/cage/test/input/functionPointers/0205.gtaacg b/tools/cage/test/input/functionPointers/0205.gtaacg deleted file mode 100644 index c0830448..00000000 --- a/tools/cage/test/input/functionPointers/0205.gtaacg +++ /dev/null @@ -1,206 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@125-137": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@125-137": { - "Arguments": [], - "CalledObjects": [ - "c:0205.cpp@72@F@main#@a", - "c:0205.cpp@72@F@main#@b" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0205.cpp@87@F@main#@s" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@125-137", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0205.cpp@72@F@main#@b", - "c:0205.cpp@72@F@main#@a", - "c:@F@foo#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0205.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0205.gtipcg b/tools/cage/test/input/functionPointers/0205.gtipcg deleted file mode 100644 index 25e0c4fc..00000000 --- a/tools/cage/test/input/functionPointers/0205.gtipcg +++ /dev/null @@ -1,36 +0,0 @@ -{ - "_Z3barv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0205.gtmcg b/tools/cage/test/input/functionPointers/0205.gtmcg deleted file mode 100644 index 8eb7620d..00000000 --- a/tools/cage/test/input/functionPointers/0205.gtmcg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0205.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0206.cpp b/tools/cage/test/input/functionPointers/0206.cpp deleted file mode 100644 index ef29326a..00000000 --- a/tools/cage/test/input/functionPointers/0206.cpp +++ /dev/null @@ -1,19 +0,0 @@ - -using func_t = void (*)(); -void foo() {} -void bar() {} - -void call() { - func_t a, b; - bool s = true; - if (s) - a = foo; - else - b = foo; - if (s) - a(); - else - b(); -} - -int main() { call(); } diff --git a/tools/cage/test/input/functionPointers/0206.gtaacg b/tools/cage/test/input/functionPointers/0206.gtaacg deleted file mode 100644 index 1da467a8..00000000 --- a/tools/cage/test/input/functionPointers/0206.gtaacg +++ /dev/null @@ -1,273 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@call#@CALL_EXPR@@158-160": "c:@F@call#", - "c:@F@call#@CALL_EXPR@@174-176": "c:@F@call#" - }, - "CallInfoMap": { - "c:@F@call#@CALL_EXPR@@158-160": { - "Arguments": [], - "CalledObjects": [ - "c:0206.cpp@73@F@call#@a" - ] - }, - "c:@F@call#@CALL_EXPR@@174-176": { - "Arguments": [], - "CalledObjects": [ - "c:0206.cpp@73@F@call#@b" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0206.cpp@88@F@call#@s" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@195-200", - "c:@F@call#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0206.cpp@73@F@call#@b", - "c:0206.cpp@73@F@call#@a", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call#@CALL_EXPR@@174-176", - "c:@F@call#@CALL_EXPR@@158-160", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@call#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4callv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@call#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@call#": "c:@F@call#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z4callv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4callv": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4callv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0206.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4callv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0206.gtipcg b/tools/cage/test/input/functionPointers/0206.gtipcg deleted file mode 100644 index e79414f3..00000000 --- a/tools/cage/test/input/functionPointers/0206.gtipcg +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_Z3barv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z4callv" - ] - }, - "_Z4callv": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 8, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z4callv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0206.gtmcg b/tools/cage/test/input/functionPointers/0206.gtmcg deleted file mode 100644 index a821fcb5..00000000 --- a/tools/cage/test/input/functionPointers/0206.gtmcg +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z4callv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4callv": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", - "systemInclude": false - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4callv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0206.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0207.cpp b/tools/cage/test/input/functionPointers/0207.cpp deleted file mode 100644 index f69bb261..00000000 --- a/tools/cage/test/input/functionPointers/0207.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -using func_t = void (*)(); - -func_t f0(func_t f) { return f; } -func_t f1(func_t f) { return f0(f); } -func_t f2(func_t f) { return f1(f); } -func_t f3(func_t f) { return f2(f); } -func_t f4(func_t f) { return f3(f); } -func_t f5(func_t f) { return f4(f); } -func_t f6(func_t f) { return f5(f); } -func_t f7(func_t f) { return f6(f); } -func_t f8(func_t f) { return f7(f); } -func_t f9(func_t f) { return f8(f); } - -void foo() {} - -int main() { - auto f = f9(foo); - f(); -} diff --git a/tools/cage/test/input/functionPointers/0207.gtaacg b/tools/cage/test/input/functionPointers/0207.gtaacg deleted file mode 100644 index 68091bc6..00000000 --- a/tools/cage/test/input/functionPointers/0207.gtaacg +++ /dev/null @@ -1,733 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@456-458": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@456-458": { - "Arguments": [], - "CalledObjects": [ - "c:0207.cpp@436@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f9#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f8#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f7#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f6#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f5#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f4#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f3#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f2#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f1#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f0#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0207.cpp@436@F@main#@f", - "c:@F@main#@CALL_EXPR@@445-451", - "c:@F@f9#*Fv()#@CALL_EXPR@@396-400", - "c:@F@f8#*Fv()#@CALL_EXPR@@358-362", - "c:@F@f7#*Fv()#@CALL_EXPR@@320-324", - "c:@F@f6#*Fv()#@CALL_EXPR@@282-286", - "c:@F@f5#*Fv()#@CALL_EXPR@@244-248", - "c:@F@f4#*Fv()#@CALL_EXPR@@206-210", - "c:@F@f3#*Fv()#@CALL_EXPR@@168-172", - "c:@F@f2#*Fv()#@CALL_EXPR@@130-134", - "c:@F@f1#*Fv()#@CALL_EXPR@@92-96", - "c:0207.cpp@39@F@f0#*Fv()#@f", - "c:0207.cpp@73@F@f1#*Fv()#@f", - "c:@F@f0#*Fv()#@SRETURN", - "c:0207.cpp@111@F@f2#*Fv()#@f", - "c:@F@f1#*Fv()#@SRETURN", - "c:0207.cpp@149@F@f3#*Fv()#@f", - "c:@F@f2#*Fv()#@SRETURN", - "c:0207.cpp@187@F@f4#*Fv()#@f", - "c:@F@f3#*Fv()#@SRETURN", - "c:0207.cpp@225@F@f5#*Fv()#@f", - "c:@F@f4#*Fv()#@SRETURN", - "c:0207.cpp@263@F@f6#*Fv()#@f", - "c:@F@f5#*Fv()#@SRETURN", - "c:0207.cpp@301@F@f7#*Fv()#@f", - "c:@F@f6#*Fv()#@SRETURN", - "c:0207.cpp@339@F@f8#*Fv()#@f", - "c:@F@f7#*Fv()#@SRETURN", - "c:0207.cpp@377@F@f9#*Fv()#@f", - "c:@F@f8#*Fv()#@SRETURN", - "c:@F@foo#", - "c:@F@f9#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@456-458", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@f0#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f0PFvvE" - ], - "Parameters": [ - "c:0207.cpp@39@F@f0#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:0207.cpp@39@F@f0#*Fv()#@f", - "c:@F@f0#*Fv()#@SRETURN" - ] - }, - "c:@F@f1#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f1PFvvE" - ], - "Parameters": [ - "c:0207.cpp@73@F@f1#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f1#*Fv()#@CALL_EXPR@@92-96", - "c:@F@f1#*Fv()#@SRETURN" - ] - }, - "c:@F@f2#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f2PFvvE" - ], - "Parameters": [ - "c:0207.cpp@111@F@f2#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f2#*Fv()#@CALL_EXPR@@130-134", - "c:@F@f2#*Fv()#@SRETURN" - ] - }, - "c:@F@f3#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f3PFvvE" - ], - "Parameters": [ - "c:0207.cpp@149@F@f3#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f3#*Fv()#@CALL_EXPR@@168-172", - "c:@F@f3#*Fv()#@SRETURN" - ] - }, - "c:@F@f4#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f4PFvvE" - ], - "Parameters": [ - "c:0207.cpp@187@F@f4#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f4#*Fv()#@CALL_EXPR@@206-210", - "c:@F@f4#*Fv()#@SRETURN" - ] - }, - "c:@F@f5#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f5PFvvE" - ], - "Parameters": [ - "c:0207.cpp@225@F@f5#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f5#*Fv()#@CALL_EXPR@@244-248", - "c:@F@f5#*Fv()#@SRETURN" - ] - }, - "c:@F@f6#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f6PFvvE" - ], - "Parameters": [ - "c:0207.cpp@263@F@f6#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f6#*Fv()#@CALL_EXPR@@282-286", - "c:@F@f6#*Fv()#@SRETURN" - ] - }, - "c:@F@f7#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f7PFvvE" - ], - "Parameters": [ - "c:0207.cpp@301@F@f7#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f7#*Fv()#@CALL_EXPR@@320-324", - "c:@F@f7#*Fv()#@SRETURN" - ] - }, - "c:@F@f8#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f8PFvvE" - ], - "Parameters": [ - "c:0207.cpp@339@F@f8#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f8#*Fv()#@CALL_EXPR@@358-362", - "c:@F@f8#*Fv()#@SRETURN" - ] - }, - "c:@F@f9#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f9PFvvE" - ], - "Parameters": [ - "c:0207.cpp@377@F@f9#*Fv()#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@f9#*Fv()#@CALL_EXPR@@396-400", - "c:@F@f9#*Fv()#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@f0#*Fv()#": "c:@F@f0#*Fv()#", - "c:@F@f1#*Fv()#": "c:@F@f1#*Fv()#", - "c:@F@f2#*Fv()#": "c:@F@f2#*Fv()#", - "c:@F@f3#*Fv()#": "c:@F@f3#*Fv()#", - "c:@F@f4#*Fv()#": "c:@F@f4#*Fv()#", - "c:@F@f5#*Fv()#": "c:@F@f5#*Fv()#", - "c:@F@f6#*Fv()#": "c:@F@f6#*Fv()#", - "c:@F@f7#*Fv()#": "c:@F@f7#*Fv()#", - "c:@F@f8#*Fv()#": "c:@F@f8#*Fv()#", - "c:@F@f9#*Fv()#": "c:@F@f9#*Fv()#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z2f0PFvvE": { - "callees": [], - "callers": [ - "_Z2f1PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f1PFvvE": { - "callees": [ - "_Z2f0PFvvE" - ], - "callers": [ - "_Z2f2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f0PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f2PFvvE": { - "callees": [ - "_Z2f1PFvvE" - ], - "callers": [ - "_Z2f3PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f1PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f3PFvvE": { - "callees": [ - "_Z2f2PFvvE" - ], - "callers": [ - "_Z2f4PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f2PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f4PFvvE": { - "callees": [ - "_Z2f3PFvvE" - ], - "callers": [ - "_Z2f5PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f3PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f5PFvvE": { - "callees": [ - "_Z2f4PFvvE" - ], - "callers": [ - "_Z2f6PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f4PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f6PFvvE": { - "callees": [ - "_Z2f5PFvvE" - ], - "callers": [ - "_Z2f7PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f5PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f7PFvvE": { - "callees": [ - "_Z2f6PFvvE" - ], - "callers": [ - "_Z2f8PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f6PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f8PFvvE": { - "callees": [ - "_Z2f7PFvvE" - ], - "callers": [ - "_Z2f9PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f7PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f9PFvvE": { - "callees": [ - "_Z2f8PFvvE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f8PFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z2f9PFvvE", - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0207.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z2f9PFvvE": 0, - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0207.gtipcg b/tools/cage/test/input/functionPointers/0207.gtipcg deleted file mode 100644 index 9d4643a6..00000000 --- a/tools/cage/test/input/functionPointers/0207.gtipcg +++ /dev/null @@ -1,165 +0,0 @@ -{ - "_Z2f0PFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f1PFvvE" - ] - }, - "_Z2f1PFvvE": { - "callees": [ - "_Z2f0PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f2PFvvE" - ] - }, - "_Z2f2PFvvE": { - "callees": [ - "_Z2f1PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f3PFvvE" - ] - }, - "_Z2f3PFvvE": { - "callees": [ - "_Z2f2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f4PFvvE" - ] - }, - "_Z2f4PFvvE": { - "callees": [ - "_Z2f3PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f5PFvvE" - ] - }, - "_Z2f5PFvvE": { - "callees": [ - "_Z2f4PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f6PFvvE" - ] - }, - "_Z2f6PFvvE": { - "callees": [ - "_Z2f5PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f7PFvvE" - ] - }, - "_Z2f7PFvvE": { - "callees": [ - "_Z2f6PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f8PFvvE" - ] - }, - "_Z2f8PFvvE": { - "callees": [ - "_Z2f7PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z2f9PFvvE" - ] - }, - "_Z2f9PFvvE": { - "callees": [ - "_Z2f8PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z2f9PFvvE", - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0207.gtmcg b/tools/cage/test/input/functionPointers/0207.gtmcg deleted file mode 100644 index 6a470103..00000000 --- a/tools/cage/test/input/functionPointers/0207.gtmcg +++ /dev/null @@ -1,247 +0,0 @@ -{ - "_CG": { - "_Z2f0PFvvE": { - "callees": [], - "callers": [ - "_Z2f1PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f1PFvvE": { - "callees": [ - "_Z2f0PFvvE" - ], - "callers": [ - "_Z2f2PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f2PFvvE": { - "callees": [ - "_Z2f1PFvvE" - ], - "callers": [ - "_Z2f3PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f3PFvvE": { - "callees": [ - "_Z2f2PFvvE" - ], - "callers": [ - "_Z2f4PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f4PFvvE": { - "callees": [ - "_Z2f3PFvvE" - ], - "callers": [ - "_Z2f5PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f5PFvvE": { - "callees": [ - "_Z2f4PFvvE" - ], - "callers": [ - "_Z2f6PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f6PFvvE": { - "callees": [ - "_Z2f5PFvvE" - ], - "callers": [ - "_Z2f7PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f7PFvvE": { - "callees": [ - "_Z2f6PFvvE" - ], - "callers": [ - "_Z2f8PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f8PFvvE": { - "callees": [ - "_Z2f7PFvvE" - ], - "callers": [ - "_Z2f9PFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z2f9PFvvE": { - "callees": [ - "_Z2f8PFvvE" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z2f9PFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0207.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0208.cpp b/tools/cage/test/input/functionPointers/0208.cpp deleted file mode 100644 index 4d5fed3e..00000000 --- a/tools/cage/test/input/functionPointers/0208.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -struct A { - void foo() {} -}; -void bar(A* a, void (A::*f)()) { (a->*f)(); } -int main() { - A a; - bar(&a, &A::foo); -} diff --git a/tools/cage/test/input/functionPointers/0208.gtaacg b/tools/cage/test/input/functionPointers/0208.gtaacg deleted file mode 100644 index 0bcec27a..00000000 --- a/tools/cage/test/input/functionPointers/0208.gtaacg +++ /dev/null @@ -1,415 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72": "c:@F@bar#*$@S@A# #" - }, - "CallInfoMap": { - "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72": { - "Arguments": [], - "CalledObjects": [ - "c:0208.cpp@40@F@bar#*$@S@A# #@a" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#*$@S@A# #@CALL_EXPR@@64-72" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#*$@S@A# #" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0208.cpp@46@F@bar#*$@S@A# #@f", - "&c:@S@A@F@foo#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@S@A@F@foo#" - } - ] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@99-114", - "c:@F@bar#*$@S@A# #@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0208.cpp@92@F@main#@a", - "c:@F@main#@CALL_EXPR@@94-94" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@foo#@THIS", - "c:0208.cpp@40@F@bar#*$@S@A# #@a", - "&c:0208.cpp@92@F@main#@a" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0208.cpp@92@F@main#@a" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@94-94" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@94-94" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@bar#*$@S@A# #": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barP1AMS_FvvE" - ], - "Parameters": [ - "c:0208.cpp@40@F@bar#*$@S@A# #@a", - "c:0208.cpp@46@F@bar#*$@S@A# #@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@bar#*$@S@A# #@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1A3fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@A@F@foo#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@S@A@F@foo#": "c:@S@A@F@foo#", - "c:@F@bar#*$@S@A# #": "c:@F@bar#*$@S@A# #", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", - "c:@S@A@F@foo#": "c:@S@A@F@foo#" - } - }, - "_CG": { - "_Z3barP1AMS_FvvE": { - "callees": [ - "_ZN1A3fooEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3fooEv": { - "callees": [], - "callers": [ - "_Z3barP1AMS_FvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3barP1AMS_FvvE", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0208.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3barP1AMS_FvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0208.gtipcg b/tools/cage/test/input/functionPointers/0208.gtipcg deleted file mode 100644 index 4cf8532d..00000000 --- a/tools/cage/test/input/functionPointers/0208.gtipcg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_Z3barP1AMS_FvvE": { - "callees": [ - "_ZN1A3fooEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1A3fooEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z3barP1AMS_FvvE" - ] - }, - "main": { - "callees": [ - "_Z3barP1AMS_FvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0208.gtmcg b/tools/cage/test/input/functionPointers/0208.gtmcg deleted file mode 100644 index 5635d505..00000000 --- a/tools/cage/test/input/functionPointers/0208.gtmcg +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_CG": { - "_Z3barP1AMS_FvvE": { - "callees": [ - "_ZN1A3fooEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3fooEv": { - "callees": [], - "callers": [ - "_Z3barP1AMS_FvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3barP1AMS_FvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0208.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0209.cpp b/tools/cage/test/input/functionPointers/0209.cpp deleted file mode 100644 index feaeb59c..00000000 --- a/tools/cage/test/input/functionPointers/0209.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -struct A { - void foo() {} - void bar() {} - void baz() {} -}; -using func_t = void (A::*)(); -func_t get_f(bool b) { - func_t fooPtr; - fooPtr = &A::foo; - if (b) { - return &A::bar; - } - return fooPtr; -} -int main() { - A a; - auto f = get_f(1); - (a.*f)(); -} diff --git a/tools/cage/test/input/functionPointers/0209.gtaacg b/tools/cage/test/input/functionPointers/0209.gtaacg deleted file mode 100644 index c49800d3..00000000 --- a/tools/cage/test/input/functionPointers/0209.gtaacg +++ /dev/null @@ -1,530 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@250-257": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@250-257": { - "Arguments": [], - "CalledObjects": [ - "c:0209.cpp@222@F@main#@a" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@baz#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@baz#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@baz#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@bar#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@250-257" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_f#b#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0209.cpp@106@F@get_f#b#@b" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0209.cpp@229@F@main#@f", - "c:@F@main#@CALL_EXPR@@238-245", - "&c:@S@A@F@bar#", - "c:0209.cpp@118@F@get_f#b#@fooPtr", - "c:@F@get_f#b#@SRETURN", - "&c:@S@A@F@foo#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@S@A@F@bar#" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@foo#", - "c:@S@A@F@bar#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0209.cpp@222@F@main#@a", - "c:@F@main#@CALL_EXPR@@224-224" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@224-224" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@224-224" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@foo#@THIS", - "c:@S@A@F@bar#@THIS", - "&c:0209.cpp@222@F@main#@a" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0209.cpp@222@F@main#@a" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@get_f#b#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5get_fb" - ], - "Parameters": [ - "c:0209.cpp@106@F@get_f#b#@b" - ], - "ReferencedInReturnStmts": [ - "&c:@S@A@F@bar#", - "c:0209.cpp@118@F@get_f#b#@fooPtr", - "c:@F@get_f#b#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1A3barEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@A@F@bar#@SRETURN" - ] - }, - "c:@S@A@F@baz#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1A3bazEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@A@F@baz#@SRETURN" - ] - }, - "c:@S@A@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1A3fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@A@F@foo#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@S@A@F@bar#": "c:@S@A@F@bar#", - "&c:@S@A@F@foo#": "c:@S@A@F@foo#", - "c:@F@get_f#b#": "c:@F@get_f#b#", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#", - "c:@S@A@F@bar#": "c:@S@A@F@bar#", - "c:@S@A@F@baz#": "c:@S@A@F@baz#", - "c:@S@A@F@foo#": "c:@S@A@F@foo#" - } - }, - "_CG": { - "_Z5get_fb": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3barEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3bazEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z5get_fb", - "_ZN1A3barEv", - "_ZN1A3fooEv", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0209.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z5get_fb": 0, - "_ZN1A3barEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0209.gtipcg b/tools/cage/test/input/functionPointers/0209.gtipcg deleted file mode 100644 index cb4802ec..00000000 --- a/tools/cage/test/input/functionPointers/0209.gtipcg +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_Z5get_fb": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1A3barEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_ZN1A3bazEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_ZN1A3fooEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z5get_fb", - "_ZN1A3barEv", - "_ZN1A3fooEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0209.gtmcg b/tools/cage/test/input/functionPointers/0209.gtmcg deleted file mode 100644 index 0027b886..00000000 --- a/tools/cage/test/input/functionPointers/0209.gtmcg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_CG": { - "_Z5get_fb": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3barEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3bazEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1A3fooEv", - "_ZN1A3barEv", - "_Z5get_fb" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0209.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0210.cpp b/tools/cage/test/input/functionPointers/0210.cpp deleted file mode 100644 index 740c59b1..00000000 --- a/tools/cage/test/input/functionPointers/0210.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// Test fpr a lambda that is casted to a function pointer -using func_t = void (*)(); - -int main() { - func_t a, b; - bool s = true; - (s ? a : b) = []() {}; - (s ? a : b)(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0210.gtaacg b/tools/cage/test/input/functionPointers/0210.gtaacg deleted file mode 100644 index 86378a9b..00000000 --- a/tools/cage/test/input/functionPointers/0210.gtaacg +++ /dev/null @@ -1,324 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@158-170": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@158-170": { - "Arguments": [], - "CalledObjects": [ - "c:0210.cpp@101@F@main#@a", - "c:0210.cpp@101@F@main#@b" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@MTE@147-153" - ], - "Prefixes": [ - { - "Member": "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", - "Object": "(c:@F@main#@MTE@147-153).c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1" - } - ] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@150@F@main#@Sa@F@operator()#1@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@150@F@main#@Sa@F@operator()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@150@F@main#@Sa@F@operator()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@147@F@main#@Sa@F@~#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@147@F@main#@Sa@F@~#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@147@F@main#@Sa@F@~#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@116@F@main#@s" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:@F@main#@MTE@147-153).c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@158-170", - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@101@F@main#@b", - "c:0210.cpp@101@F@main#@a", - "c:@F@main#@CALL_EXPR@@147-153", - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@THIS", - "&c:@F@main#@MTE@147-153" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@MTE@147-153" - } - ] - } - ], - "FunctionInfoMap": { - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S@SRETURN" - ] - }, - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1@SRETURN" - ] - }, - "c:0210.cpp@147@F@main#@Sa@F@~#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainEN3$_0D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:0210.cpp@150@F@main#@Sa@F@operator()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0clEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0210.cpp@150@F@main#@Sa@F@operator()#1@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0210.cpp@147@F@main#@Sa@F@__invoke#S": "c:0210.cpp@147@F@main#@Sa@F@__invoke#S", - "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1": "c:0210.cpp@147@F@main#@Sa@F@operator void (*)()#1", - "c:0210.cpp@147@F@main#@Sa@F@~#": "c:0210.cpp@147@F@main#@Sa@F@~#", - "c:0210.cpp@150@F@main#@Sa@F@operator()#1": "c:0210.cpp@150@F@main#@Sa@F@operator()#1", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_ZZ4mainEN3$_08__invokeEv": { - "callees": [ - "_ZZ4mainENK3$_0clEv" - ], - "callers": [ - "_ZZ4mainENK3$_0cvPFvvEEv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0clEv": { - "callees": [], - "callers": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEv", - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFvvEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0210.gtipcg b/tools/cage/test/input/functionPointers/0210.gtipcg deleted file mode 100644 index e296ff3e..00000000 --- a/tools/cage/test/input/functionPointers/0210.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0210.gtmcg b/tools/cage/test/input/functionPointers/0210.gtmcg deleted file mode 100644 index e7f2a110..00000000 --- a/tools/cage/test/input/functionPointers/0210.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0210.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFvvEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "GITDIR-NOTFOUND", - "version": "0.4" - }, - "version": "2.0" - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0211.cpp b/tools/cage/test/input/functionPointers/0211.cpp deleted file mode 100644 index d9fb4539..00000000 --- a/tools/cage/test/input/functionPointers/0211.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -using func_t = void (*)(); - -struct A { - func_t f; -}; - -void foo() {} - -int main() { - A a; - a.f = foo; - a.f(); -} diff --git a/tools/cage/test/input/functionPointers/0211.gtaacg b/tools/cage/test/input/functionPointers/0211.gtaacg deleted file mode 100644 index adb7af57..00000000 --- a/tools/cage/test/input/functionPointers/0211.gtaacg +++ /dev/null @@ -1,330 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@106-110": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@106-110": { - "Arguments": [], - "CalledObjects": [ - "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f", - "c:@S@A@FI@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@106-110", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0211.cpp@86@F@main#@a", - "c:@F@main#@CALL_EXPR@@88-88" - ], - "Prefixes": [ - { - "Member": "c:@S@A@FI@f", - "Object": "(c:0211.cpp@86@F@main#@a).c:@S@A@FI@f" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@88-88" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@88-88" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0211.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0211.gtipcg b/tools/cage/test/input/functionPointers/0211.gtipcg deleted file mode 100644 index f9dcb249..00000000 --- a/tools/cage/test/input/functionPointers/0211.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0211.gtmcg b/tools/cage/test/input/functionPointers/0211.gtmcg deleted file mode 100644 index 8acea6e2..00000000 --- a/tools/cage/test/input/functionPointers/0211.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0211.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0211.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0212.cpp b/tools/cage/test/input/functionPointers/0212.cpp deleted file mode 100644 index 3958df50..00000000 --- a/tools/cage/test/input/functionPointers/0212.cpp +++ /dev/null @@ -1,15 +0,0 @@ - -using func_t = void (*)(); - -struct A { - func_t f; -}; - -void foo() {} -void call_f(const A& arg) { arg.f(); } - -int main() { - A a; - a.f = foo; - call_f(a); -} diff --git a/tools/cage/test/input/functionPointers/0212.gtaacg b/tools/cage/test/input/functionPointers/0212.gtaacg deleted file mode 100644 index 030dae95..00000000 --- a/tools/cage/test/input/functionPointers/0212.gtaacg +++ /dev/null @@ -1,392 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104": "c:@F@call_f#&1$@S@A#" - }, - "CallInfoMap": { - "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104": { - "Arguments": [], - "CalledObjects": [ - "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_f#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@145-153", - "c:@F@call_f#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:0212.cpp@125@F@main#@a).c:@S@A@FI@f", - "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f", - "c:@S@A@FI@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_f#&1$@S@A#@CALL_EXPR@@98-104", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0212.cpp@82@F@call_f#&1$@S@A#@arg", - "c:0212.cpp@125@F@main#@a", - "c:@F@main#@CALL_EXPR@@127-127" - ], - "Prefixes": [ - { - "Member": "c:@S@A@FI@f", - "Object": "(c:0212.cpp@82@F@call_f#&1$@S@A#@arg).c:@S@A@FI@f" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@127-127" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@127-127" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@call_f#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_Z6call_fRK1A" - ], - "Parameters": [ - "c:0212.cpp@82@F@call_f#&1$@S@A#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@call_f#&1$@S@A#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@call_f#&1$@S@A#": "c:@F@call_f#&1$@S@A#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z6call_fRK1A" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z6call_fRK1A": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z6call_fRK1A", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0212.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z6call_fRK1A": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0212.gtipcg b/tools/cage/test/input/functionPointers/0212.gtipcg deleted file mode 100644 index 5d3ffa7c..00000000 --- a/tools/cage/test/input/functionPointers/0212.gtipcg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z6call_fRK1A" - ] - }, - "_Z6call_fRK1A": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z6call_fRK1A" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0212.gtmcg b/tools/cage/test/input/functionPointers/0212.gtmcg deleted file mode 100644 index 177a1744..00000000 --- a/tools/cage/test/input/functionPointers/0212.gtmcg +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z6call_fRK1A" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z6call_fRK1A": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z6call_fRK1A" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0212.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0213.cpp b/tools/cage/test/input/functionPointers/0213.cpp deleted file mode 100644 index 16d4cde7..00000000 --- a/tools/cage/test/input/functionPointers/0213.cpp +++ /dev/null @@ -1,16 +0,0 @@ - -using func_t = void (*)(); - -struct A { - func_t f; -}; - -void foo() {} -func_t get_f(const A& a) { return a.f; } - -int main() { - A a; - a.f = foo; - auto f = get_f(a); - f(); -} diff --git a/tools/cage/test/input/functionPointers/0213.gtaacg b/tools/cage/test/input/functionPointers/0213.gtaacg deleted file mode 100644 index 89a11f54..00000000 --- a/tools/cage/test/input/functionPointers/0213.gtaacg +++ /dev/null @@ -1,389 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@168-170": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@168-170": { - "Arguments": [], - "CalledObjects": [ - "c:0213.cpp@147@F@main#@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@A@F@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#&&$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@A@F@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_f#&1$@S@A#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0213.cpp@147@F@main#@f", - "c:@F@main#@CALL_EXPR@@156-163", - "(c:0213.cpp@127@F@main#@a).c:@S@A@FI@f", - "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f", - "c:@F@get_f#&1$@S@A#@SRETURN", - "c:@S@A@FI@f", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@168-170", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0213.cpp@83@F@get_f#&1$@S@A#@a", - "c:0213.cpp@127@F@main#@a", - "c:@F@main#@CALL_EXPR@@129-129" - ], - "Prefixes": [ - { - "Member": "c:@S@A@FI@f", - "Object": "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f" - } - ] - }, - { - "Objects": [ - "c:@S@A@F@A#@THIS", - "&c:@F@main#@CALL_EXPR@@129-129" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@CALL_EXPR@@129-129" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@get_f#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5get_fRK1A" - ], - "Parameters": [ - "c:0213.cpp@83@F@get_f#&1$@S@A#@a" - ], - "ReferencedInReturnStmts": [ - "(c:0213.cpp@83@F@get_f#&1$@S@A#@a).c:@S@A@FI@f", - "c:@F@get_f#&1$@S@A#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@S@A@F@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2Ev", - "_ZN1AC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&&$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2EOS_", - "_ZN1AC1EOS_" - ], - "Parameters": [ - "c:@S@A@F@A#&&$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@A@F@A#&1$@S@A#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN1AC2ERKS_", - "_ZN1AC1ERKS_" - ], - "Parameters": [ - "c:@S@A@F@A#&1$@S@A#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@get_f#&1$@S@A#": "c:@F@get_f#&1$@S@A#", - "c:@F@main#": "c:@F@main#", - "c:@S@A@F@A#": "c:@S@A@F@A#", - "c:@S@A@F@A#&&$@S@A#": "c:@S@A@F@A#&&$@S@A#", - "c:@S@A@F@A#&1$@S@A#": "c:@S@A@F@A#&1$@S@A#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5get_fRK1A": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1AC2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fRK1A", - "_ZN1AC1Ev", - "_ZN1AC2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0213.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "_Z5get_fRK1A": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0213.gtipcg b/tools/cage/test/input/functionPointers/0213.gtipcg deleted file mode 100644 index d4f255ac..00000000 --- a/tools/cage/test/input/functionPointers/0213.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z5get_fRK1A": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fRK1A" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0213.gtmcg b/tools/cage/test/input/functionPointers/0213.gtmcg deleted file mode 100644 index 0342e92b..00000000 --- a/tools/cage/test/input/functionPointers/0213.gtmcg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5get_fRK1A": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov", - "_Z5get_fRK1A" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0213.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0214.cpp b/tools/cage/test/input/functionPointers/0214.cpp deleted file mode 100644 index 65e683f1..00000000 --- a/tools/cage/test/input/functionPointers/0214.cpp +++ /dev/null @@ -1,11 +0,0 @@ -typedef void (*func_t)(); - -void foo(func_t fp) {} -void bar() {} - -int main(int argc, char** argv) { - func_t f; - f = bar; - foo(f); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0214.gtaacg b/tools/cage/test/input/functionPointers/0214.gtaacg deleted file mode 100644 index d45164fe..00000000 --- a/tools/cage/test/input/functionPointers/0214.gtaacg +++ /dev/null @@ -1,207 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#*Fv()#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0214.cpp@84@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0214.cpp@74@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@124-129", - "c:@F@foo#*Fv()#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0214.cpp@36@F@foo#*Fv()#@fp", - "c:0214.cpp@101@F@main#I#**C#@f", - "c:@F@bar#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@foo#*Fv()#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooPFvvE" - ], - "Parameters": [ - "c:0214.cpp@36@F@foo#*Fv()#@fp" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#*Fv()#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0214.cpp@74@F@main#I#**C#@argc", - "c:0214.cpp@84@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@foo#*Fv()#": "c:@F@foo#*Fv()#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0214.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooPFvvE": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0214.gtipcg b/tools/cage/test/input/functionPointers/0214.gtipcg deleted file mode 100644 index 1eb69ebb..00000000 --- a/tools/cage/test/input/functionPointers/0214.gtipcg +++ /dev/null @@ -1,36 +0,0 @@ -{ - "_Z3barv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - }, - "_Z3fooPFvvE": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooPFvvE" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0214.gtmcg b/tools/cage/test/input/functionPointers/0214.gtmcg deleted file mode 100644 index 10c46c82..00000000 --- a/tools/cage/test/input/functionPointers/0214.gtmcg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooPFvvE": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", - "systemInclude": false - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooPFvvE" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0214.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0216.cpp b/tools/cage/test/input/functionPointers/0216.cpp deleted file mode 100644 index 10d8dcb3..00000000 --- a/tools/cage/test/input/functionPointers/0216.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -using func_t = void (*)(); - -int main() { - func_t a; - a = []() {}; - a(); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0216.gtaacg b/tools/cage/test/input/functionPointers/0216.gtaacg deleted file mode 100644 index 0a0e6727..00000000 --- a/tools/cage/test/input/functionPointers/0216.gtaacg +++ /dev/null @@ -1,316 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@70-72": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@70-72": { - "Arguments": [], - "CalledObjects": [ - "c:0216.cpp@44@F@main#@a" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@MTE@60-65" - ], - "Prefixes": [ - { - "Member": "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", - "Object": "(c:@F@main#@MTE@60-65).c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1" - } - ] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@63@F@main#@Sa@F@operator()#1@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@63@F@main#@Sa@F@operator()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@63@F@main#@Sa@F@operator()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@60@F@main#@Sa@F@~#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@60@F@main#@Sa@F@~#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@60@F@main#@Sa@F@~#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:@F@main#@MTE@60-65).c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@44@F@main#@a", - "c:@F@main#@CALL_EXPR@@60-65", - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@70-72", - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@THIS", - "&c:@F@main#@MTE@60-65" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@MTE@60-65" - } - ] - } - ], - "FunctionInfoMap": { - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S@SRETURN" - ] - }, - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1@SRETURN" - ] - }, - "c:0216.cpp@60@F@main#@Sa@F@~#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainEN3$_0D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:0216.cpp@63@F@main#@Sa@F@operator()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0clEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0216.cpp@63@F@main#@Sa@F@operator()#1@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0216.cpp@60@F@main#@Sa@F@__invoke#S": "c:0216.cpp@60@F@main#@Sa@F@__invoke#S", - "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1": "c:0216.cpp@60@F@main#@Sa@F@operator void (*)()#1", - "c:0216.cpp@60@F@main#@Sa@F@~#": "c:0216.cpp@60@F@main#@Sa@F@~#", - "c:0216.cpp@63@F@main#@Sa@F@operator()#1": "c:0216.cpp@63@F@main#@Sa@F@operator()#1", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_ZZ4mainEN3$_08__invokeEv": { - "callees": [ - "_ZZ4mainENK3$_0clEv" - ], - "callers": [ - "_ZZ4mainENK3$_0cvPFvvEEv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0clEv": { - "callees": [], - "callers": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEv", - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFvvEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0216.gtipcg b/tools/cage/test/input/functionPointers/0216.gtipcg deleted file mode 100644 index aff2b684..00000000 --- a/tools/cage/test/input/functionPointers/0216.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0216.gtmcg b/tools/cage/test/input/functionPointers/0216.gtmcg deleted file mode 100644 index bccc6f5d..00000000 --- a/tools/cage/test/input/functionPointers/0216.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [ ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0216.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFvvEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "GITDIR-NOTFOUND", - "version": "0.4" - }, - "version": "2.0" - } -} \ No newline at end of file diff --git a/tools/cage/test/input/functionPointers/0217.cpp b/tools/cage/test/input/functionPointers/0217.cpp deleted file mode 100644 index 965e2b57..00000000 --- a/tools/cage/test/input/functionPointers/0217.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Test passing a variable through a lambda that is cast to a fptr -using func_t = int (*)(int); - -int main() { - func_t lamb = [](int a) { - int tmp = a; - return tmp; - }; - int parameter = 0; - int result = lamb(parameter); - return 0; -} diff --git a/tools/cage/test/input/functionPointers/0217.gtaacg b/tools/cage/test/input/functionPointers/0217.gtaacg deleted file mode 100644 index 9699c119..00000000 --- a/tools/cage/test/input/functionPointers/0217.gtaacg +++ /dev/null @@ -1,331 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@212-226": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@212-226": { - "Arguments": [ - [ - "c:0217.cpp@178@F@main#@parameter" - ] - ], - "CalledObjects": [ - "c:0217.cpp@112@F@main#@lamb" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@MTE@126-173" - ], - "Prefixes": [ - { - "Member": "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", - "Object": "(c:@F@main#@MTE@126-173).c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1" - } - ] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@126@F@main#@Sa@F@~#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@126@F@main#@Sa@F@~#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@126@F@main#@Sa@F@~#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(c:@F@main#@MTE@126-173).c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@112@F@main#@lamb", - "c:@F@main#@CALL_EXPR@@126-173", - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@199@F@main#@result", - "c:@F@main#@CALL_EXPR@@212-226", - "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S@SRETURN", - "c:0217.cpp@129@F@main#@Sa@F@__invoke#I#S@a", - "c:0217.cpp@129@F@main#@Sa@F@operator()#I#1@a", - "c:0217.cpp@178@F@main#@parameter" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@THIS", - "&c:@F@main#@MTE@126-173" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@MTE@126-173" - } - ] - } - ], - "FunctionInfoMap": { - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_08__invokeEi" - ], - "Parameters": [ - "c:0217.cpp@129@F@main#@Sa@F@__invoke#I#S@a" - ], - "ReferencedInReturnStmts": [ - "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S@SRETURN" - ] - }, - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0cvPFiiEEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1@SRETURN" - ] - }, - "c:0217.cpp@126@F@main#@Sa@F@~#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainEN3$_0D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0clEi" - ], - "Parameters": [ - "c:0217.cpp@129@F@main#@Sa@F@operator()#I#1@a" - ], - "ReferencedInReturnStmts": [ - "c:0217.cpp@142@F@main#@Sa@F@operator()#I#1@tmp", - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S": "c:0217.cpp@126@F@main#@Sa@F@__invoke#I#S", - "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1": "c:0217.cpp@126@F@main#@Sa@F@operator int (*)(int)#1", - "c:0217.cpp@126@F@main#@Sa@F@~#": "c:0217.cpp@126@F@main#@Sa@F@~#", - "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1": "c:0217.cpp@134@F@main#@Sa@F@operator()#I#1", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_ZZ4mainEN3$_08__invokeEi": { - "callees": [ - "_ZZ4mainENK3$_0clEi" - ], - "callers": [ - "_ZZ4mainENK3$_0cvPFiiEEv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0clEi": { - "callees": [], - "callers": [ - "_ZZ4mainEN3$_08__invokeEi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0cvPFiiEEv": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEi" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEi", - "_ZZ4mainENK3$_0cvPFiiEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFiiEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "e99454234010d5c91f671a53644c35b50f26c368", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/functionPointers/0217.gtipcg b/tools/cage/test/input/functionPointers/0217.gtipcg deleted file mode 100644 index 55b03195..00000000 --- a/tools/cage/test/input/functionPointers/0217.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0cvPFiiEEv": { - "callees": [ ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFiiEEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/functionPointers/0217.gtmcg b/tools/cage/test/input/functionPointers/0217.gtmcg deleted file mode 100644 index 43a83306..00000000 --- a/tools/cage/test/input/functionPointers/0217.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0cvPFiiEEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0cvPFiiEEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/functionPointers/0217.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0cvPFiiEEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "e99454234010d5c91f671a53644c35b50f26c368", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.cpp b/tools/cage/test/input/metaCollectors/numStatements/0023.cpp deleted file mode 100644 index 079e8201..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0023.cpp +++ /dev/null @@ -1,10 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k; ++i) { - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg deleted file mode 100644 index a0a7bdc9..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0023.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0023.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0023.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0023.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0023.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0023.cpp@11@F@main#I#**C#@argc", - "c:0023.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0023.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg deleted file mode 100644 index e243b733..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0023.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg deleted file mode 100644 index 6423dd99..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0023.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0023.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.cpp b/tools/cage/test/input/metaCollectors/numStatements/0024.cpp deleted file mode 100644 index 942ed542..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0024.cpp +++ /dev/null @@ -1,11 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k;) { - ++i; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg deleted file mode 100644 index 1a085dcf..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0024.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0024.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0024.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0024.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0024.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0024.cpp@11@F@main#I#**C#@argc", - "c:0024.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0024.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg deleted file mode 100644 index f055fa7b..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0024.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 4, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg deleted file mode 100644 index b7ee6993..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0024.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0024.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.cpp b/tools/cage/test/input/metaCollectors/numStatements/0025.cpp deleted file mode 100644 index fe1e1a09..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0025.cpp +++ /dev/null @@ -1,12 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k;) { - ++i; - --k; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg deleted file mode 100644 index 70b42bad..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0025.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0025.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0025.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0025.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0025.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0025.cpp@11@F@main#I#**C#@argc", - "c:0025.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0025.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 6, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg deleted file mode 100644 index f465226c..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0025.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg deleted file mode 100644 index db824351..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0025.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0025.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.cpp b/tools/cage/test/input/metaCollectors/numStatements/0026.cpp deleted file mode 100644 index d4602add..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0026.cpp +++ /dev/null @@ -1,15 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k;) { - ++i; - --k; - if (k % 2 == 0) { - ++k; - } - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg deleted file mode 100644 index 45940fc7..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0026.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0026.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0026.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0026.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0026.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0026.cpp@11@F@main#I#**C#@argc", - "c:0026.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0026.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 10, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg deleted file mode 100644 index 55c50070..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0026.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 7, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg deleted file mode 100644 index 49092fa3..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0026.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0026.cpp", - "systemInclude": false - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.cpp b/tools/cage/test/input/metaCollectors/numStatements/0027.cpp deleted file mode 100644 index 9a46bd25..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0027.cpp +++ /dev/null @@ -1,16 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k;) { - ++i; - --k; - if (k % 2 == 0) { - ++k; - } else { - } - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg deleted file mode 100644 index e2367ad9..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0027.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0027.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0027.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0027.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0027.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0027.cpp@11@F@main#I#**C#@argc", - "c:0027.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0027.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 10, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg deleted file mode 100644 index 55c50070..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0027.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 7, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg deleted file mode 100644 index b9b26613..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0027.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0027.cpp", - "systemInclude": false - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.cpp b/tools/cage/test/input/metaCollectors/numStatements/0028.cpp deleted file mode 100644 index 33f90e63..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0028.cpp +++ /dev/null @@ -1,16 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - - for (int i = 0; i < k;) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg deleted file mode 100644 index bbb9591a..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0028.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0028.cpp@58@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0028.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0028.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0028.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0028.cpp@11@F@main#I#**C#@argc", - "c:0028.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0028.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 10, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg deleted file mode 100644 index 55c50070..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0028.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 7, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg deleted file mode 100644 index 34bcb708..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0028.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0028.cpp", - "systemInclude": false - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.cpp b/tools/cage/test/input/metaCollectors/numStatements/0029.cpp deleted file mode 100644 index 97b76b7f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0029.cpp +++ /dev/null @@ -1,18 +0,0 @@ - - -int main(int argc, char** argv) { - int k = 12; - int i = 0; - - while (i < k) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - ++i; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg deleted file mode 100644 index 65dfa33f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0029.gtaacg +++ /dev/null @@ -1,102 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0029.cpp@52@F@main#I#**C#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0029.cpp@38@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0029.cpp@21@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0029.cpp@11@F@main#I#**C#@argc" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0029.cpp@11@F@main#I#**C#@argc", - "c:0029.cpp@21@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0029.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 11, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg deleted file mode 100644 index c192a51f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0029.gtipcg +++ /dev/null @@ -1,12 +0,0 @@ -{ - "main": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 9, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg deleted file mode 100644 index 286af256..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0029.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0029.cpp", - "systemInclude": false - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.cpp b/tools/cage/test/input/metaCollectors/numStatements/0030.cpp deleted file mode 100644 index 1f22e4a7..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0030.cpp +++ /dev/null @@ -1,19 +0,0 @@ - -int foo() { return 4 + 2; } - -int main(int argc, char** argv) { - int k = 12; - int i = foo(); - - while (i < k) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - ++i; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg deleted file mode 100644 index e4634efa..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0030.gtaacg +++ /dev/null @@ -1,157 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0030.cpp@66@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0030.cpp@49@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0030.cpp@39@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0030.cpp@80@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@88-92", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0030.cpp@39@F@main#I#**C#@argc", - "c:0030.cpp@49@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0030.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0030.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z3foov": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 11, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg deleted file mode 100644 index b1023de0..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0030.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3foov": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 9, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg deleted file mode 100644 index 0059f732..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0030.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0030.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0030.cpp", - "systemInclude": false - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.cpp b/tools/cage/test/input/metaCollectors/numStatements/0031.cpp deleted file mode 100644 index a2cc98de..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0031.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - while (i < k) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - ++i; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg deleted file mode 100644 index 7739ac03..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0031.gtaacg +++ /dev/null @@ -1,160 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0031.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0031.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0031.cpp@9@F@foo#I#@k", - "c:0031.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0031.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0031.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0031.cpp@53@F@main#I#**C#@argc", - "c:0031.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0031.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0031.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 11, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg deleted file mode 100644 index 9474853f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0031.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 9, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg deleted file mode 100644 index 0db11623..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0031.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0031.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0031.cpp", - "systemInclude": false - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.cpp b/tools/cage/test/input/metaCollectors/numStatements/0032.cpp deleted file mode 100644 index e8768500..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0032.cpp +++ /dev/null @@ -1,34 +0,0 @@ - -int bar(int f) { - int k = f % 3; - int n = 0; - while (k > 0) { - --k; - ++n; - } - return n; -} - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - while (i < k) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - ++i; - } - - int n = bar(i); - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg deleted file mode 100644 index 94f0cf48..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0032.gtaacg +++ /dev/null @@ -1,225 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0032.cpp@165@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0032.cpp@155@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0032.cpp@111@F@foo#I#@k", - "c:0032.cpp@182@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0032.cpp@20@F@bar#I#@k", - "c:0032.cpp@9@F@bar#I#@f", - "c:0032.cpp@196@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@204-209", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0032.cpp@321@F@main#I#**C#@n", - "c:@F@main#I#**C#@CALL_EXPR@@329-334", - "c:0032.cpp@37@F@bar#I#@n", - "c:@F@bar#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3bari" - ], - "Parameters": [ - "c:0032.cpp@9@F@bar#I#@f" - ], - "ReferencedInReturnStmts": [ - "c:0032.cpp@37@F@bar#I#@n", - "c:@F@bar#I#@SRETURN" - ] - }, - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0032.cpp@111@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0032.cpp@155@F@main#I#**C#@argc", - "c:0032.cpp@165@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#I#": "c:@F@bar#I#", - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3bari": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0032.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z3bari": 0, - "_Z3fooi": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 12, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg deleted file mode 100644 index f6240d2e..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0032.gtipcg +++ /dev/null @@ -1,39 +0,0 @@ -{ - "_Z3bari": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 10, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg deleted file mode 100644 index cabc1b17..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0032.gtmcg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_CG": { - "_Z3bari": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0032.cpp", - "systemInclude": false - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.cpp b/tools/cage/test/input/metaCollectors/numStatements/0033.cpp deleted file mode 100644 index 4b77d5f9..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0033.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -int sentinel(int f) { return f / 2; } - -int bar(int f) { - int k = f % 3; - int n = 0; - while (k > 0) { - --k; - ++n; - } - return sentinel(n); -} - -int foo(int k) { - ++k; - return sentinel(4 * k); -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - while (i < k) { - if (k % 2 == 0) { - ++k; - } else { - ++i; - ++k; - } - ++i; - } - - int n = bar(i); - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg deleted file mode 100644 index 901b2790..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0033.gtaacg +++ /dev/null @@ -1,286 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@sentinel#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@bar#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0033.cpp@224@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0033.cpp@214@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0033.cpp@160@F@foo#I#@k", - "c:0033.cpp@241@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0033.cpp@380@F@main#I#**C#@n", - "c:0033.cpp@59@F@bar#I#@k", - "c:0033.cpp@48@F@bar#I#@f", - "c:0033.cpp@255@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@388-393", - "c:@F@main#I#**C#@CALL_EXPR@@263-268", - "c:@F@foo#I#@CALL_EXPR@@185-199", - "c:@F@bar#I#@CALL_EXPR@@136-146", - "c:0033.cpp@14@F@sentinel#I#@f", - "c:0033.cpp@76@F@bar#I#@n", - "c:@F@sentinel#I#@SRETURN", - "c:@F@foo#I#@SRETURN", - "c:@F@bar#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3bari" - ], - "Parameters": [ - "c:0033.cpp@48@F@bar#I#@f" - ], - "ReferencedInReturnStmts": [ - "c:@F@bar#I#@CALL_EXPR@@136-146", - "c:@F@bar#I#@SRETURN" - ] - }, - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0033.cpp@160@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@CALL_EXPR@@185-199", - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0033.cpp@214@F@main#I#**C#@argc", - "c:0033.cpp@224@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - }, - "c:@F@sentinel#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8sentineli" - ], - "Parameters": [ - "c:0033.cpp@14@F@sentinel#I#@f" - ], - "ReferencedInReturnStmts": [ - "c:0033.cpp@14@F@sentinel#I#@f", - "c:@F@sentinel#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#I#": "c:@F@bar#I#", - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#", - "c:@F@sentinel#I#": "c:@F@sentinel#I#" - } - }, - "_CG": { - "_Z3bari": { - "callees": [ - "_Z8sentineli" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z8sentineli": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooi": { - "callees": [ - "_Z8sentineli" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z8sentineli": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8sentineli": { - "callees": [], - "callers": [ - "_Z3bari", - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0033.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z3bari": 0, - "_Z3fooi": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 12, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg deleted file mode 100644 index cf5d16a2..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0033.gtipcg +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_Z3bari": { - "callees": [ - "_Z8sentineli" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z3fooi": { - "callees": [ - "_Z8sentineli" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "_Z8sentineli": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 1, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "_Z3bari", - "_Z3fooi" - ] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 10, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg deleted file mode 100644 index d8244473..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0033.gtmcg +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_CG": { - "_Z3bari": { - "callees": [ - "_Z8sentineli" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooi": { - "callees": [ - "_Z8sentineli" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8sentineli": { - "callees": [], - "callers": [ - "_Z3fooi", - "_Z3bari" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3bari", - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0033.cpp", - "systemInclude": false - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.cpp b/tools/cage/test/input/metaCollectors/numStatements/0034.cpp deleted file mode 100644 index ac746f68..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0034.cpp +++ /dev/null @@ -1,18 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - switch (k) { - default: - k = 11; - break; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg deleted file mode 100644 index 3b67350e..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0034.gtaacg +++ /dev/null @@ -1,160 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0034.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0034.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0034.cpp@9@F@foo#I#@k", - "c:0034.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0034.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0034.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0034.cpp@53@F@main#I#**C#@argc", - "c:0034.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0034.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0034.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg deleted file mode 100644 index a6a8ec47..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0034.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg deleted file mode 100644 index 7da9971b..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0034.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0034.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0034.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.cpp b/tools/cage/test/input/metaCollectors/numStatements/0035.cpp deleted file mode 100644 index e49c5549..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0035.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - switch (k) { - case 1: - case 2: - default: - k = 11; - break; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg deleted file mode 100644 index 744e2718..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0035.gtaacg +++ /dev/null @@ -1,160 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0035.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0035.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0035.cpp@9@F@foo#I#@k", - "c:0035.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0035.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0035.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0035.cpp@53@F@main#I#**C#@argc", - "c:0035.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0035.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0035.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 6, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg deleted file mode 100644 index a6a8ec47..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0035.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg deleted file mode 100644 index fccb0746..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0035.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0035.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0035.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.cpp b/tools/cage/test/input/metaCollectors/numStatements/0036.cpp deleted file mode 100644 index 2ce496b8..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0036.cpp +++ /dev/null @@ -1,25 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - switch (k) { - case 1: - k = 2; - break; - case 4: - k = 100; - i = 101; - break; - default: - k = 11; - break; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg deleted file mode 100644 index c41ff4fe..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0036.gtaacg +++ /dev/null @@ -1,160 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0036.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0036.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0036.cpp@9@F@foo#I#@k", - "c:0036.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0036.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0036.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0036.cpp@53@F@main#I#**C#@argc", - "c:0036.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0036.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0036.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 0, - "numberOfIntOps": 9, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 11 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg deleted file mode 100644 index dac488ed..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0036.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 11, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg deleted file mode 100644 index 7eaf5883..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0036.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0036.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0036.cpp", - "systemInclude": false - }, - "numStatements": 11 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.cpp b/tools/cage/test/input/metaCollectors/numStatements/0037.cpp deleted file mode 100644 index 217e4124..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0037.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - do { - i = k - 2; - ++i; - } while (i < k); - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg deleted file mode 100644 index c64bef89..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0037.gtaacg +++ /dev/null @@ -1,155 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0037.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0037.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0037.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN", - "c:0037.cpp@9@F@foo#I#@k", - "c:0037.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0037.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0037.cpp@53@F@main#I#**C#@argc", - "c:0037.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0037.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0037.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg deleted file mode 100644 index a6a8ec47..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0037.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg deleted file mode 100644 index caa73bbc..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0037.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0037.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0037.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.cpp b/tools/cage/test/input/metaCollectors/numStatements/0038.cpp deleted file mode 100644 index 0a3bf55e..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0038.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - try { - ++k; - } catch (int ec) { - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg deleted file mode 100644 index e0d40850..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0038.gtaacg +++ /dev/null @@ -1,166 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0038.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0038.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0038.cpp@139@F@main#I#**C#@ec" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0038.cpp@9@F@foo#I#@k", - "c:0038.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0038.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0038.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0038.cpp@53@F@main#I#**C#@argc", - "c:0038.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0038.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0038.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg deleted file mode 100644 index a6a8ec47..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0038.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 6, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg deleted file mode 100644 index 926f19a0..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0038.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0038.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0038.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.cpp b/tools/cage/test/input/metaCollectors/numStatements/0039.cpp deleted file mode 100644 index 72edc1f1..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0039.cpp +++ /dev/null @@ -1,18 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - try { - ++k; - } catch (int ec) { - ++i; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg deleted file mode 100644 index 4942e5ab..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0039.gtaacg +++ /dev/null @@ -1,166 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0039.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0039.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0039.cpp@139@F@main#I#**C#@ec" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0039.cpp@9@F@foo#I#@k", - "c:0039.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0039.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0039.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0039.cpp@53@F@main#I#**C#@argc", - "c:0039.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0039.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0039.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 6, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg deleted file mode 100644 index 8236746b..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0039.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 7, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg deleted file mode 100644 index befaf4eb..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0039.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0039.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0039.cpp", - "systemInclude": false - }, - "numStatements": 7 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.cpp b/tools/cage/test/input/metaCollectors/numStatements/0040.cpp deleted file mode 100644 index d867587b..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0040.cpp +++ /dev/null @@ -1,26 +0,0 @@ - -int foo(int k) { - ++k; - return 4 * k; -} - -int main(int argc, char** argv) { - int k = 12; - int i = foo(k); - - switch (k) { - case 1: - k = 2; - break; - case 4: { - k = 100; - i = 101; - break; - } - default: - k = 11; - break; - } - - return 0; -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg deleted file mode 100644 index 9563cefc..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0040.gtaacg +++ /dev/null @@ -1,160 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0040.cpp@63@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0040.cpp@53@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0040.cpp@9@F@foo#I#@k", - "c:0040.cpp@80@F@main#I#**C#@k" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0040.cpp@94@F@main#I#**C#@i", - "c:@F@main#I#**C#@CALL_EXPR@@102-107", - "c:@F@foo#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooi" - ], - "Parameters": [ - "c:0040.cpp@9@F@foo#I#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0040.cpp@53@F@main#I#**C#@argc", - "c:0040.cpp@63@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#": "c:@F@foo#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0040.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0040.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 0, - "numberOfIntOps": 9, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 11 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg deleted file mode 100644 index dac488ed..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0040.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_Z3fooi": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 2, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 11, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg deleted file mode 100644 index f1ffbd2f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0040.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0040.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0040.cpp", - "systemInclude": false - }, - "numStatements": 11 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.cpp b/tools/cage/test/input/metaCollectors/numStatements/0041.cpp deleted file mode 100644 index c795a862..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0041.cpp +++ /dev/null @@ -1,6 +0,0 @@ - -int main(int argc, char** argv) { - const auto l = []() {}; - l(); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg deleted file mode 100644 index e4924f93..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0041.gtaacg +++ /dev/null @@ -1,522 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@20@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@10@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0", - "c:@F@main#I#**C#@MTE@51-56" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@61-63", - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@36@F@main#I#**C#@l", - "c:@F@main#I#**C#@CALL_EXPR@@51-56" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@THIS", - "&c:@F@main#I#**C#@CALL_EXPR@@51-56" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#I#**C#@CALL_EXPR@@51-56" - } - ] - }, - { - "Objects": [ - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@THIS", - "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#@THIS", - "&c:0041.cpp@36@F@main#I#**C#@l" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0041.cpp@36@F@main#I#**C#@l" - } - ] - } - ], - "FunctionInfoMap": { - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0C2EOS_", - "_ZZ4mainEN3$_0C1EOS_" - ], - "Parameters": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0C2ERKS_", - "_ZZ4mainEN3$_0C1ERKS_" - ], - "Parameters": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S@SRETURN" - ] - }, - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1@SRETURN" - ] - }, - "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainEN3$_0D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0clEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0041.cpp@10@F@main#I#**C#@argc", - "c:0041.cpp@20@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#", - "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#", - "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S": "c:0041.cpp@51@F@main#I#**C#@Sa@F@__invoke#S", - "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1": "c:0041.cpp@51@F@main#I#**C#@Sa@F@operator void (*)()#1", - "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#": "c:0041.cpp@51@F@main#I#**C#@Sa@F@~#", - "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1": "c:0041.cpp@54@F@main#I#**C#@Sa@F@operator()#1", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_ZZ4mainEN3$_08__invokeEv": { - "callees": [ - "_ZZ4mainENK3$_0clEv" - ], - "callers": [ - "_ZZ4mainENK3$_0cvPFvvEEv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0C1EOS_": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0C2EOS_": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0D1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0D2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0clEv": { - "callees": [], - "callers": [ - "_ZZ4mainEN3$_08__invokeEv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0cvPFvvEEv": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainEN3$_0C1EOS_", - "_ZZ4mainEN3$_0C2EOS_", - "_ZZ4mainEN3$_0D1Ev", - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainENK3$_0clEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0clEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg deleted file mode 100644 index 9adebc1f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0041.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0clEv": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 0, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg deleted file mode 100644 index ee9a33b9..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0041.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0clEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0041.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZZ4mainENK3$_0clEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "GITDIR-NOTFOUND", - "version": "0.4" - }, - "version": "2.0" - } -} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.cpp b/tools/cage/test/input/metaCollectors/numStatements/0042.cpp deleted file mode 100644 index 3d5af319..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0042.cpp +++ /dev/null @@ -1,12 +0,0 @@ -int main(int argc, char** argv) { - const auto l = [](int a, int b) { - float alpha = a / (1.0 * b); - double delta = .0; - for (int i = 0; i < 4; ++i) { - delta = a * i * alpha; - } - return delta; - }; - auto d = l(2, 4); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg deleted file mode 100644 index 7454b553..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0042.gtaacg +++ /dev/null @@ -1,548 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@43@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@33@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@157@F@main#I#**C#@Sa@F@operator()#I#I#1@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0", - "c:@F@main#I#**C#@MTE@74-236" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@84@F@main#I#**C#@Sa@F@__invoke#I#I#S@b", - "c:0042.cpp@84@F@main#I#**C#@Sa@F@operator()#I#I#1@b" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@59@F@main#I#**C#@l", - "c:@F@main#I#**C#@CALL_EXPR@@74-236" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@241@F@main#I#**C#@d", - "c:@F@main#I#**C#@CALL_EXPR@@250-256", - "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@SRETURN", - "c:0042.cpp@96@F@main#I#**C#@Sa@F@operator()#I#I#1@alpha", - "c:0042.cpp@77@F@main#I#**C#@Sa@F@__invoke#I#I#S@a", - "c:0042.cpp@77@F@main#I#**C#@Sa@F@operator()#I#I#1@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@THIS", - "&c:@F@main#I#**C#@CALL_EXPR@@74-236" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#I#**C#@CALL_EXPR@@74-236" - } - ] - }, - { - "Objects": [ - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@THIS", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#@THIS", - "&c:0042.cpp@59@F@main#I#**C#@l" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0042.cpp@59@F@main#I#**C#@l" - } - ] - } - ], - "FunctionInfoMap": { - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0C2EOS_", - "_ZZ4mainEN3$_0C1EOS_" - ], - "Parameters": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0C2ERKS_", - "_ZZ4mainEN3$_0C1ERKS_" - ], - "Parameters": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_08__invokeEii" - ], - "Parameters": [ - "c:0042.cpp@77@F@main#I#**C#@Sa@F@__invoke#I#I#S@a", - "c:0042.cpp@84@F@main#I#**C#@Sa@F@__invoke#I#I#S@b" - ], - "ReferencedInReturnStmts": [ - "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S@SRETURN" - ] - }, - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0cvPFdiiEEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1@SRETURN" - ] - }, - "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainEN3$_0D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1": { - "IsVariadic": false, - "MangledNames": [ - "_ZZ4mainENK3$_0clEii" - ], - "Parameters": [ - "c:0042.cpp@77@F@main#I#**C#@Sa@F@operator()#I#I#1@a", - "c:0042.cpp@84@F@main#I#**C#@Sa@F@operator()#I#I#1@b" - ], - "ReferencedInReturnStmts": [ - "c:0042.cpp@129@F@main#I#**C#@Sa@F@operator()#I#I#1@delta", - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0042.cpp@33@F@main#I#**C#@argc", - "c:0042.cpp@43@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&&$@F@main#I#S0_#@Sa#", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@#&1$@F@main#I#S0_#@Sa#", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S": "c:0042.cpp@74@F@main#I#**C#@Sa@F@__invoke#I#I#S", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1": "c:0042.cpp@74@F@main#I#**C#@Sa@F@operator double (*)(int, int)#1", - "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#": "c:0042.cpp@74@F@main#I#**C#@Sa@F@~#", - "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1": "c:0042.cpp@89@F@main#I#**C#@Sa@F@operator()#I#I#1", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_ZZ4mainEN3$_08__invokeEii": { - "callees": [ - "_ZZ4mainENK3$_0clEii" - ], - "callers": [ - "_ZZ4mainENK3$_0cvPFdiiEEv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0C1EOS_": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0C2EOS_": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0D1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainEN3$_0D2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0clEii": { - "callees": [], - "callers": [ - "_ZZ4mainEN3$_08__invokeEii", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 15, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZZ4mainENK3$_0cvPFdiiEEv": { - "callees": [ - "_ZZ4mainEN3$_08__invokeEii" - ], - "callers": [], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainEN3$_0C1EOS_", - "_ZZ4mainEN3$_0C2EOS_", - "_ZZ4mainEN3$_0D1Ev", - "_ZZ4mainEN3$_0D2Ev", - "_ZZ4mainENK3$_0clEii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_ZZ4mainENK3$_0clEii": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 17, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "e99454234010d5c91f671a53644c35b50f26c368", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg deleted file mode 100644 index eb7dc0c2..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0042.gtipcg +++ /dev/null @@ -1,26 +0,0 @@ -{ - "_ZZ4mainENK3$_0clEii": { - "callees": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 5, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [ - "main" - ] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEii" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "numStatements": 3, - "overriddenBy": [], - "overriddenFunctions": [], - "parents": [] - } -} \ No newline at end of file diff --git a/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg b/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg deleted file mode 100644 index 2e69e22f..00000000 --- a/tools/cage/test/input/metaCollectors/numStatements/0042.gtmcg +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_CG": { - "_ZZ4mainENK3$_0clEii": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 5 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": {}, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 15, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZZ4mainENK3$_0clEii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/metaCollectors/numStatements/0042.cpp", - "systemInclude": false - }, - "globalLoopDepth": 1, - "loopCallDepth": { - "_ZZ4mainENK3$_0clEii": 0 - }, - "loopDepth": 1, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 8, - "numberOfFloatOps": 17, - "numberOfIntOps": 5, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "GITDIR-NOTFOUND", - "version": "0.4" - }, - "version": "2.0" - } -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042.gtmcg b/tools/cage/test/input/multiTU/0042.gtmcg new file mode 100644 index 00000000..9efa6e6c --- /dev/null +++ b/tools/cage/test/input/multiTU/0042.gtmcg @@ -0,0 +1,54 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3barv": { + "callees": { + "_Z3boov": {} + }, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3bazv": { + "callees": { + "_Z3foov": {} + }, + "functionName": "_Z3bazv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3boov": { + "callees": {}, + "functionName": "_Z3boov", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042_a.cpp b/tools/cage/test/input/multiTU/0042_a.cpp index 646f9f9c..50ed00b5 100644 --- a/tools/cage/test/input/multiTU/0042_a.cpp +++ b/tools/cage/test/input/multiTU/0042_a.cpp @@ -1,3 +1,7 @@ +__attribute__((retain)) int foo() { return 42; } +__attribute__((retain)) int baz() { return foo(); } + +int main() { return 0; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042_b.cpp b/tools/cage/test/input/multiTU/0042_b.cpp index e8fd486a..41b939e2 100644 --- a/tools/cage/test/input/multiTU/0042_b.cpp +++ b/tools/cage/test/input/multiTU/0042_b.cpp @@ -1,7 +1,9 @@ +__attribute__((retain)) int boo() { int a = 1; int b = 0; return a + b; } +__attribute__((retain)) int bar() { return boo(); } diff --git a/tools/cage/test/input/multiTU/0042_combined.gtmcg b/tools/cage/test/input/multiTU/0042_combined.gtmcg deleted file mode 100644 index f5d89fad..00000000 --- a/tools/cage/test/input/multiTU/0042_combined.gtmcg +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_CG": { - "_Z3barv": { - "callees": [ - "_Z3boov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_b.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3bazv": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_a.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3boov": { - "callees": [], - "callers": [ - "_Z3barv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_b.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z3bazv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0042_a.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0043.gtmcg b/tools/cage/test/input/multiTU/0043.gtmcg new file mode 100644 index 00000000..8f309c3d --- /dev/null +++ b/tools/cage/test/input/multiTU/0043.gtmcg @@ -0,0 +1,52 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3barv": { + "callees": {}, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3goov": { + "callees": { + "_Z3barv": {} + }, + "functionName": "_Z3goov", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3harv": { + "callees": {}, + "functionName": "_Z3harv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0043_a.cpp b/tools/cage/test/input/multiTU/0043_a.cpp index 8c558c56..3efe82c0 100644 --- a/tools/cage/test/input/multiTU/0043_a.cpp +++ b/tools/cage/test/input/multiTU/0043_a.cpp @@ -1,3 +1,7 @@ +__attribute__((retain)) int foo() { return 1; } +__attribute__((retain)) int bar() { return 2; } + +int main() { return 0; } diff --git a/tools/cage/test/input/multiTU/0043_b.cpp b/tools/cage/test/input/multiTU/0043_b.cpp index 72dad579..bf12126b 100644 --- a/tools/cage/test/input/multiTU/0043_b.cpp +++ b/tools/cage/test/input/multiTU/0043_b.cpp @@ -1,5 +1,7 @@ extern int bar(); +__attribute__((retain)) int har() { return 4; } +__attribute__((retain)) int goo() { return bar(); } diff --git a/tools/cage/test/input/multiTU/0043_combined.gtmcg b/tools/cage/test/input/multiTU/0043_combined.gtmcg deleted file mode 100644 index 252a25a9..00000000 --- a/tools/cage/test/input/multiTU/0043_combined.gtmcg +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_CG": { - "_Z3barv": { - "callees": [], - "callers": [ - "_Z3goov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_a.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_a.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3goov": { - "callees": [ - "_Z3barv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3harv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0043_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0044.gtmcg b/tools/cage/test/input/multiTU/0044.gtmcg new file mode 100644 index 00000000..9dc16b56 --- /dev/null +++ b/tools/cage/test/input/multiTU/0044.gtmcg @@ -0,0 +1,56 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z2hfv": { + "callees": { + "_Z3foov": {} + }, + "functionName": "_Z2hfv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3barv": { + "callees": { + "_Z3foov": {} + }, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z3harv": { + "callees": { + "_Z3barv": {} + }, + "functionName": "_Z3harv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0044_a.cpp b/tools/cage/test/input/multiTU/0044_a.cpp index deffde2e..e826489d 100644 --- a/tools/cage/test/input/multiTU/0044_a.cpp +++ b/tools/cage/test/input/multiTU/0044_a.cpp @@ -2,4 +2,7 @@ extern int foo(); int bar() { return foo(); } +__attribute__((retain)) int har() { return bar(); } + +int main() { return 0; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0044_b.cpp b/tools/cage/test/input/multiTU/0044_b.cpp index 642cebe8..422846c4 100644 --- a/tools/cage/test/input/multiTU/0044_b.cpp +++ b/tools/cage/test/input/multiTU/0044_b.cpp @@ -1,3 +1,4 @@ int foo() { return 2; } +__attribute__((retain)) int hf() { return foo(); } diff --git a/tools/cage/test/input/multiTU/0044_combined.gtmcg b/tools/cage/test/input/multiTU/0044_combined.gtmcg deleted file mode 100644 index 1d5a77e7..00000000 --- a/tools/cage/test/input/multiTU/0044_combined.gtmcg +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_CG": { - "_Z2hfv": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3barv": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "_Z3harv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_a.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z2hfv", - "_Z3barv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3harv": { - "callees": [ - "_Z3barv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0044_a.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0050.gtmcg b/tools/cage/test/input/multiTU/0050.gtmcg new file mode 100644 index 00000000..8a760ef7 --- /dev/null +++ b/tools/cage/test/input/multiTU/0050.gtmcg @@ -0,0 +1,65 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_ZN4Base3fooEv": { + "callees": {}, + "functionName": "_ZN4Base3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN4BaseC2Ev": { + "callees": {}, + "functionName": "_ZN4BaseC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN6Derive3fooEv": { + "callees": {}, + "functionName": "_ZN6Derive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN6DeriveC2Ev": { + "callees": { + "_ZN4BaseC2Ev": {} + }, + "functionName": "_ZN6DeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN4Base3fooEv": {}, + "_ZN4BaseC2Ev": {}, + "_ZN6Derive3fooEv": {}, + "_ZN6DeriveC2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0050_a.cpp b/tools/cage/test/input/multiTU/0050_a.cpp index e243ffc2..9262b855 100644 --- a/tools/cage/test/input/multiTU/0050_a.cpp +++ b/tools/cage/test/input/multiTU/0050_a.cpp @@ -3,3 +3,9 @@ struct DeriveTwo : public Base { virtual void foo() override {} }; + +int main() { + Base* b = new Derive; + b->foo(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0050_combined.gtmcg b/tools/cage/test/input/multiTU/0050_combined.gtmcg deleted file mode 100644 index 2db20431..00000000 --- a/tools/cage/test/input/multiTU/0050_combined.gtmcg +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_CG": { - "_ZN12DeriveDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [ - "_ZN6Derive3fooEv" - ] - }, - "_ZN4Base3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050.h", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 0 - }, - "overriddenBy": [ - "_ZN9DeriveTwo3fooEv", - "_ZN6Derive3fooEv" - ], - "overrides": [] - }, - "_ZN6Derive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050.h", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 0 - }, - "overriddenBy": [ - "_ZN12DeriveDerive3fooEv" - ], - "overrides": [ - "_ZN4Base3fooEv" - ] - }, - "_ZN9DeriveTwo3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0050_a.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [ - "_ZN4Base3fooEv" - ] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0053.gtmcg b/tools/cage/test/input/multiTU/0053.gtmcg new file mode 100644 index 00000000..7f2e7226 --- /dev/null +++ b/tools/cage/test/input/multiTU/0053.gtmcg @@ -0,0 +1,80 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} + }, + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN14MyClassDeriveD3fooEv": { + "callees": {}, + "functionName": "_ZN14MyClassDeriveD3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN14MyClassDeriveDC2Ev": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {} + }, + "functionName": "_ZN14MyClassDeriveDC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "__cxa_pure_virtual": { + "callees": {}, + "functionName": "__cxa_pure_virtual", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {}, + "_ZN14MyClassDeriveD3fooEv": {}, + "_ZN14MyClassDeriveDC2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0053_combined.gtmcg b/tools/cage/test/input/multiTU/0053_combined.gtmcg deleted file mode 100644 index 929656ca..00000000 --- a/tools/cage/test/input/multiTU/0053_combined.gtmcg +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053.h", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [ - "_ZN14MyClassDeriveD3fooEv" - ], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN14MyClassDeriveD3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [ - "_ZN13MyClassDerive3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053.h", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 0 - }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0053_b.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "0d36c2c6619b53464d31d589be9bc2f9e11660f4", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0060.gtmcg b/tools/cage/test/input/multiTU/0060.gtmcg new file mode 100644 index 00000000..3b113432 --- /dev/null +++ b/tools/cage/test/input/multiTU/0060.gtmcg @@ -0,0 +1,78 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z1xv": { + "callees": { + "_Z4leafv": {}, + "_Z4loopv": {} + }, + "functionName": "_Z1xv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z4leafv": { + "callees": {}, + "functionName": "_Z4leafv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z4leftv": { + "callees": { + "_Z1xv": {} + }, + "functionName": "_Z4leftv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z4loopv": { + "callees": { + "_Z5splitv": {} + }, + "functionName": "_Z4loopv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z5rightv": { + "callees": { + "_Z1xv": {} + }, + "functionName": "_Z5rightv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Z5splitv": { + "callees": { + "_Z4leftv": {}, + "_Z5rightv": {} + }, + "functionName": "_Z5splitv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_Z5splitv": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0060_combined.gtmcg b/tools/cage/test/input/multiTU/0060_combined.gtmcg deleted file mode 100644 index 5be66820..00000000 --- a/tools/cage/test/input/multiTU/0060_combined.gtmcg +++ /dev/null @@ -1,174 +0,0 @@ -{ - "_CG": { - "_Z1xv": { - "callees": [ - "_Z4leafv", - "_Z4loopv" - ], - "callers": [ - "_Z4leftv", - "_Z5rightv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leafv": { - "callees": [], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leftv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5entryv", - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4loopv": { - "callees": [ - "_Z5splitv" - ], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_b.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5entryv": { - "callees": [ - "_Z4leftv", - "_Z5entryv" - ], - "callers": [ - "_Z5entryv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5rightv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5splitv": { - "callees": [ - "_Z4leftv", - "_Z5rightv" - ], - "callers": [ - "_Z4loopv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z5splitv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0060_a.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0070_a.cpp b/tools/cage/test/input/multiTU/0070_a.cpp deleted file mode 100644 index 6fa0fb76..00000000 --- a/tools/cage/test/input/multiTU/0070_a.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Test for handling different parameters across translation units -int foo(int some_name, int); - -int main() { - foo(1, 2); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0070_a.gtaacg b/tools/cage/test/input/multiTU/0070_a.gtaacg deleted file mode 100644 index 67f70cd1..00000000 --- a/tools/cage/test/input/multiTU/0070_a.gtaacg +++ /dev/null @@ -1,150 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#I#@UNNAMED_PARAM@1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0070_a.cpp@75@F@foo#I#I#@some_name" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@112-120", - "c:@F@foo#I#I#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooii" - ], - "Parameters": [ - "c:0070_a.cpp@75@F@foo#I#I#@some_name", - "c:@F@foo#I#I#@UNNAMED_PARAM@1" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#I#": "c:@F@foo#I#I#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3fooii": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooii": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0070_b.cpp b/tools/cage/test/input/multiTU/0070_b.cpp deleted file mode 100644 index f291e380..00000000 --- a/tools/cage/test/input/multiTU/0070_b.cpp +++ /dev/null @@ -1 +0,0 @@ -int foo(int a, int b) { return a; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0070_b.gtaacg b/tools/cage/test/input/multiTU/0070_b.gtaacg deleted file mode 100644 index 17c0bbff..00000000 --- a/tools/cage/test/input/multiTU/0070_b.gtaacg +++ /dev/null @@ -1,91 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@foo#I#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0070_b.cpp@8@F@foo#I#I#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0070_b.cpp@15@F@foo#I#I#@b" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooii" - ], - "Parameters": [ - "c:0070_b.cpp@8@F@foo#I#I#@a", - "c:0070_b.cpp@15@F@foo#I#I#@b" - ], - "ReferencedInReturnStmts": [ - "c:0070_b.cpp@8@F@foo#I#I#@a", - "c:@F@foo#I#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#I#": "c:@F@foo#I#I#" - } - }, - "_CG": { - "_Z3fooii": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0070_combined.gtaacg b/tools/cage/test/input/multiTU/0070_combined.gtaacg deleted file mode 100644 index c3f7d99d..00000000 --- a/tools/cage/test/input/multiTU/0070_combined.gtaacg +++ /dev/null @@ -1,152 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@112-120", - "c:@F@foo#I#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0070_a.cpp@75@F@foo#I#I#@some_name", - "c:0070_b.cpp@8@F@foo#I#I#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#I#I#@UNNAMED_PARAM@1", - "c:0070_b.cpp@15@F@foo#I#I#@b" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#I#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3fooii" - ], - "Parameters": [ - "c:0070_a.cpp@75@F@foo#I#I#@some_name", - "c:@F@foo#I#I#@UNNAMED_PARAM@1" - ], - "ReferencedInReturnStmts": [ - "c:@F@foo#I#I#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@foo#I#I#": "c:@F@foo#I#I#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3fooii": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooii" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0070_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3fooii": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0071_a.cpp b/tools/cage/test/input/multiTU/0071_a.cpp deleted file mode 100644 index 53577d6a..00000000 --- a/tools/cage/test/input/multiTU/0071_a.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// Test for handling function ptrs in a global variable across different TUs -void function() { int a = 1 + 2; } - -void* functionptr; - -int foo() { - void* var = (void*)&function; - functionptr = var; - return 1; -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0071_a.gtaacg b/tools/cage/test/input/multiTU/0071_a.gtaacg deleted file mode 100644 index 79d631e9..00000000 --- a/tools/cage/test/input/multiTU/0071_a.gtaacg +++ /dev/null @@ -1,148 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@function#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0071_a.cpp@95@F@function#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@functionptr", - "c:0071_a.cpp@147@F@foo#@var", - "&c:@F@function#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@function#" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@function#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@F@function#": "c:@F@function#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@function#": "c:@F@function#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8functionv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0071_b.cpp b/tools/cage/test/input/multiTU/0071_b.cpp deleted file mode 100644 index e562eb3e..00000000 --- a/tools/cage/test/input/multiTU/0071_b.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -extern void* functionptr; - -typedef void (*Ftype)(); - -int main() { - ((Ftype)functionptr)(); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0071_b.gtaacg b/tools/cage/test/input/multiTU/0071_b.gtaacg deleted file mode 100644 index dbfea801..00000000 --- a/tools/cage/test/input/multiTU/0071_b.gtaacg +++ /dev/null @@ -1,96 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@69-90": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@69-90": { - "Arguments": [], - "CalledObjects": [ - "c:@functionptr" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@functionptr" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@69-90" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0071_combined.gtaacg b/tools/cage/test/input/multiTU/0071_combined.gtaacg deleted file mode 100644 index ced3ff8a..00000000 --- a/tools/cage/test/input/multiTU/0071_combined.gtaacg +++ /dev/null @@ -1,215 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@main#@CALL_EXPR@@69-90": "c:@F@main#" - }, - "CallInfoMap": { - "c:@F@main#@CALL_EXPR@@69-90": { - "Arguments": [], - "CalledObjects": [ - "c:@functionptr" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@functionptr", - "c:0071_a.cpp@147@F@foo#@var", - "&c:@F@function#" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@function#" - } - ] - }, - { - "Objects": [ - "c:0071_a.cpp@95@F@function#@a" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@69-90", - "c:@F@function#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@function#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "&c:@F@function#": "c:@F@function#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@function#": "c:@F@function#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8functionv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8functionv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0071_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0072_a.cpp b/tools/cage/test/input/multiTU/0072_a.cpp deleted file mode 100644 index 805b076d..00000000 --- a/tools/cage/test/input/multiTU/0072_a.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Testcase for the multi TU imbalance integration test - */ -#define NULL 0 - -void get_func_ptr(void (**func)(), int i); - -void function_pointer_test() { - void (*r)() = NULL; - - get_func_ptr(&r, 0); - - r(); -} - -/** - * Main function - */ -int main(int argc, char** argv) { - function_pointer_test(); - return 0; -} diff --git a/tools/cage/test/input/multiTU/0072_a.gtaacg b/tools/cage/test/input/multiTU/0072_a.gtaacg deleted file mode 100644 index 527a13c7..00000000 --- a/tools/cage/test/input/multiTU/0072_a.gtaacg +++ /dev/null @@ -1,252 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@function_pointer_test#@CALL_EXPR@@204-206": "c:@F@function_pointer_test#" - }, - "CallInfoMap": { - "c:@F@function_pointer_test#@CALL_EXPR@@204-206": { - "Arguments": [], - "CalledObjects": [ - "c:0072_a.cpp@157@F@function_pointer_test#@r" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func_ptr#**Fv()#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function_pointer_test#@CALL_EXPR@@204-206" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function_pointer_test#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@256@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@246@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@157@F@function_pointer_test#@r" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", - "&c:0072_a.cpp@157@F@function_pointer_test#@r" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0072_a.cpp@157@F@function_pointer_test#@r" - } - ] - }, - { - "Objects": [ - "c:@F@function_pointer_test#@CALL_EXPR@@180-198", - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@273-295", - "c:@F@function_pointer_test#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@function_pointer_test#": { - "IsVariadic": false, - "MangledNames": [ - "_Z21function_pointer_testv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@function_pointer_test#@SRETURN" - ] - }, - "c:@F@get_func_ptr#**Fv()#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z12get_func_ptrPPFvvEi" - ], - "Parameters": [ - "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", - "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0072_a.cpp@246@F@main#I#**C#@argc", - "c:0072_a.cpp@256@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@function_pointer_test#": "c:@F@function_pointer_test#", - "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z12get_func_ptrPPFvvEi": { - "callees": [], - "callers": [ - "_Z21function_pointer_testv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z21function_pointer_testv": { - "callees": [ - "_Z12get_func_ptrPPFvvEi" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z12get_func_ptrPPFvvEi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z21function_pointer_testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z21function_pointer_testv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0072_b.cpp b/tools/cage/test/input/multiTU/0072_b.cpp deleted file mode 100644 index 75032243..00000000 --- a/tools/cage/test/input/multiTU/0072_b.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#define NULL 0 - -void func1(); -void func2(); - -void get_func_ptr(void (**func)(), int i) { - void (*r)() = NULL; - - switch (i) { - case 0: - r = func1; - break; - default: - r = func2; - } - - *func = r; -} - -void func1() {} - -void func2() {} diff --git a/tools/cage/test/input/multiTU/0072_b.gtaacg b/tools/cage/test/input/multiTU/0072_b.gtaacg deleted file mode 100644 index c2039460..00000000 --- a/tools/cage/test/input/multiTU/0072_b.gtaacg +++ /dev/null @@ -1,198 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func_ptr#**Fv()#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@func2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@func1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" - } - ] - }, - { - "Objects": [ - "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", - "c:0072_b.cpp@91@F@get_func_ptr#**Fv()#I#@r", - "c:@F@func1#", - "c:@F@func2#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@func1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func1#@SRETURN" - ] - }, - "c:@F@func2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func2#@SRETURN" - ] - }, - "c:@F@get_func_ptr#**Fv()#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z12get_func_ptrPPFvvEi" - ], - "Parameters": [ - "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", - "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@func1#": "c:@F@func1#", - "c:@F@func2#": "c:@F@func2#", - "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#" - } - }, - "_CG": { - "_Z12get_func_ptrPPFvvEi": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func2v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0072_combined.gtaacg b/tools/cage/test/input/multiTU/0072_combined.gtaacg deleted file mode 100644 index 568a3a46..00000000 --- a/tools/cage/test/input/multiTU/0072_combined.gtaacg +++ /dev/null @@ -1,348 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@function_pointer_test#@CALL_EXPR@@204-206": "c:@F@function_pointer_test#" - }, - "CallInfoMap": { - "c:@F@function_pointer_test#@CALL_EXPR@@204-206": { - "Arguments": [], - "CalledObjects": [ - "c:0072_a.cpp@157@F@function_pointer_test#@r" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#I#**C#@CALL_EXPR@@273-295", - "c:@F@function_pointer_test#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function_pointer_test#@CALL_EXPR@@180-198", - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@246@F@main#I#**C#@argc" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@256@F@main#I#**C#@argv" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function_pointer_test#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@get_func_ptr#**Fv()#I#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#I#**C#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", - "&c:0072_a.cpp@157@F@function_pointer_test#@r", - "c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:0072_a.cpp@157@F@function_pointer_test#@r" - } - ] - }, - { - "Objects": [ - "*c:0072_b.cpp@63@F@get_func_ptr#**Fv()#I#@func", - "c:0072_b.cpp@91@F@get_func_ptr#**Fv()#I#@r", - "c:@F@func1#", - "c:@F@func2#", - "c:0072_a.cpp@157@F@function_pointer_test#@r" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i", - "c:0072_b.cpp@80@F@get_func_ptr#**Fv()#I#@i" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@function_pointer_test#@CALL_EXPR@@204-206", - "c:@F@func1#@SRETURN", - "c:@F@func2#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@func1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func1#@SRETURN" - ] - }, - "c:@F@func2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z5func2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@func2#@SRETURN" - ] - }, - "c:@F@function_pointer_test#": { - "IsVariadic": false, - "MangledNames": [ - "_Z21function_pointer_testv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@function_pointer_test#@SRETURN" - ] - }, - "c:@F@get_func_ptr#**Fv()#I#": { - "IsVariadic": false, - "MangledNames": [ - "_Z12get_func_ptrPPFvvEi" - ], - "Parameters": [ - "c:0072_a.cpp@98@F@get_func_ptr#**Fv()#I#@func", - "c:0072_a.cpp@115@F@get_func_ptr#**Fv()#I#@i" - ], - "ReferencedInReturnStmts": [ - "c:@F@get_func_ptr#**Fv()#I#@SRETURN" - ] - }, - "c:@F@main#I#**C#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [ - "c:0072_a.cpp@246@F@main#I#**C#@argc", - "c:0072_a.cpp@256@F@main#I#**C#@argv" - ], - "ReferencedInReturnStmts": [ - "c:@F@main#I#**C#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@func1#": "c:@F@func1#", - "c:@F@func2#": "c:@F@func2#", - "c:@F@function_pointer_test#": "c:@F@function_pointer_test#", - "c:@F@get_func_ptr#**Fv()#I#": "c:@F@get_func_ptr#**Fv()#I#", - "c:@F@main#I#**C#": "c:@F@main#I#**C#" - } - }, - "_CG": { - "_Z12get_func_ptrPPFvvEi": { - "callees": [], - "callers": [ - "_Z21function_pointer_testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z21function_pointer_testv": { - "callees": [ - "_Z12get_func_ptrPPFvvEi", - "_Z5func1v", - "_Z5func2v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z12get_func_ptrPPFvvEi": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func1v": { - "callees": [], - "callers": [ - "_Z21function_pointer_testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func2v": { - "callees": [], - "callers": [ - "_Z21function_pointer_testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z21function_pointer_testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0072_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z21function_pointer_testv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0214_a.cpp b/tools/cage/test/input/multiTU/0214_a.cpp deleted file mode 100644 index 5e1d7378..00000000 --- a/tools/cage/test/input/multiTU/0214_a.cpp +++ /dev/null @@ -1,11 +0,0 @@ - -using func_t = void (*)(); -func_t g_foo; - -void call_foo(); -void foo() {} - -int main() { - g_foo = foo; - call_foo(); -} diff --git a/tools/cage/test/input/multiTU/0214_a.gtaacg b/tools/cage/test/input/multiTU/0214_a.gtaacg deleted file mode 100644 index e4efe228..00000000 --- a/tools/cage/test/input/multiTU/0214_a.gtaacg +++ /dev/null @@ -1,189 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@105-114", - "c:@F@call_foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@g_foo", - "c:@F@foo#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@call_foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8call_foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@call_foo#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@call_foo#": "c:@F@call_foo#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8call_foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8call_foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z8call_foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0214_b.cpp b/tools/cage/test/input/multiTU/0214_b.cpp deleted file mode 100644 index b6f07806..00000000 --- a/tools/cage/test/input/multiTU/0214_b.cpp +++ /dev/null @@ -1,5 +0,0 @@ - -using func_t = void (*)(); -extern func_t g_foo; - -void call_foo() { g_foo(); } diff --git a/tools/cage/test/input/multiTU/0214_b.gtaacg b/tools/cage/test/input/multiTU/0214_b.gtaacg deleted file mode 100644 index da1bc18c..00000000 --- a/tools/cage/test/input/multiTU/0214_b.gtaacg +++ /dev/null @@ -1,96 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@call_foo#@CALL_EXPR@@68-74": "c:@F@call_foo#" - }, - "CallInfoMap": { - "c:@F@call_foo#@CALL_EXPR@@68-74": { - "Arguments": [], - "CalledObjects": [ - "c:@g_foo" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@g_foo" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#@CALL_EXPR@@68-74" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@call_foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8call_foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@call_foo#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@call_foo#": "c:@F@call_foo#" - } - }, - "_CG": { - "_Z8call_foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0214_combined.gtaacg b/tools/cage/test/input/multiTU/0214_combined.gtaacg deleted file mode 100644 index a69d8842..00000000 --- a/tools/cage/test/input/multiTU/0214_combined.gtaacg +++ /dev/null @@ -1,203 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@call_foo#@CALL_EXPR@@68-74": "c:@F@call_foo#" - }, - "CallInfoMap": { - "c:@F@call_foo#@CALL_EXPR@@68-74": { - "Arguments": [], - "CalledObjects": [ - "c:@g_foo" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@g_foo", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@105-114", - "c:@F@call_foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@call_foo#@CALL_EXPR@@68-74", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@call_foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z8call_foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@call_foo#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@call_foo#": "c:@F@call_foo#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#" - } - }, - "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "_Z8call_foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8call_foov": { - "callees": [ - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8call_foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0214_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z8call_foov": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0240_a.cpp b/tools/cage/test/input/multiTU/0240_a.cpp deleted file mode 100644 index ecf2882b..00000000 --- a/tools/cage/test/input/multiTU/0240_a.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// Test for handling default args/ differing definitions accross translation units -extern void some_function(); -extern void some_other_function(); -using FType = decltype(some_function); - -void f(FType n = some_function, FType arg = some_other_function); - -void work() { f(); } diff --git a/tools/cage/test/input/multiTU/0240_a.gtaacg b/tools/cage/test/input/multiTU/0240_a.gtaacg deleted file mode 100644 index bfa9ccf8..00000000 --- a/tools/cage/test/input/multiTU/0240_a.gtaacg +++ /dev/null @@ -1,186 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@F@work#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@work#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@some_other_function#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@some_function#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", - "c:@F@some_function#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg", - "c:@F@some_other_function#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@work#@CALL_EXPR@@268-270", - "c:@F@f#*Fv()#S0_#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@f#*Fv()#S0_#": { - "IsVariadic": false, - "MangledNames": [ - "_Z1fPFvvES0_" - ], - "Parameters": [ - "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", - "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@f#*Fv()#S0_#@SRETURN" - ] - }, - "c:@F@some_function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z13some_functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@some_function#@SRETURN" - ] - }, - "c:@F@some_other_function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z19some_other_functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@some_other_function#@SRETURN" - ] - }, - "c:@F@work#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4workv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@work#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", - "c:@F@some_function#": "c:@F@some_function#", - "c:@F@some_other_function#": "c:@F@some_other_function#", - "c:@F@work#": "c:@F@work#" - } - }, - "_CG": { - "_Z1fPFvvES0_": { - "callees": [], - "callers": [ - "_Z4workv" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4workv": { - "callees": [ - "_Z1fPFvvES0_" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z1fPFvvES0_": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0240_b.cpp b/tools/cage/test/input/multiTU/0240_b.cpp deleted file mode 100644 index 6ce5a00e..00000000 --- a/tools/cage/test/input/multiTU/0240_b.cpp +++ /dev/null @@ -1,19 +0,0 @@ -extern void foo(); -extern void bar(); -using FType = decltype(foo); - -void f(FType n, FType k); -void f(FType n, FType k = bar); -void f(FType n = foo, FType k); - -void work(); - -int main() { - work(); - f(); -} - -void f(FType n, FType k) { - n(); - k(); -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0240_b.gtaacg b/tools/cage/test/input/multiTU/0240_b.gtaacg deleted file mode 100644 index e87473af..00000000 --- a/tools/cage/test/input/multiTU/0240_b.gtaacg +++ /dev/null @@ -1,335 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": "c:@F@f#*Fv()#S0_#", - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": "c:@F@f#*Fv()#S0_#" - }, - "CallInfoMap": { - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": { - "Arguments": [], - "CalledObjects": [ - "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n" - ] - }, - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": { - "Arguments": [], - "CalledObjects": [ - "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@work#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@188-193", - "c:@F@work#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@198-200", - "c:@F@f#*Fv()#S0_#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237", - "c:@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244", - "c:@F@bar#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_b.cpp@133@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@101@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@75@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_b.cpp@148@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@110@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@84@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k", - "c:@F@bar#" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@f#*Fv()#S0_#": { - "IsVariadic": false, - "MangledNames": [ - "_Z1fPFvvES0_" - ], - "Parameters": [ - "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" - ], - "ReferencedInReturnStmts": [ - "c:@F@f#*Fv()#S0_#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@work#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4workv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@work#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@F@work#": "c:@F@work#" - } - }, - "_CG": { - "_Z1fPFvvES0_": { - "callees": [ - "_Z3barv", - "_Z3foov" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3barv": { - "callees": [], - "callers": [ - "_Z1fPFvvES0_" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z1fPFvvES0_" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4workv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z1fPFvvES0_", - "_Z4workv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z1fPFvvES0_": 0, - "_Z4workv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0240_combined.gtaacg b/tools/cage/test/input/multiTU/0240_combined.gtaacg deleted file mode 100644 index b1c7e342..00000000 --- a/tools/cage/test/input/multiTU/0240_combined.gtaacg +++ /dev/null @@ -1,371 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": "c:@F@f#*Fv()#S0_#", - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": "c:@F@f#*Fv()#S0_#" - }, - "CallInfoMap": { - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237": { - "Arguments": [], - "CalledObjects": [ - "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n" - ] - }, - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244": { - "Arguments": [], - "CalledObjects": [ - "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#@SRETURN", - "c:@F@main#@CALL_EXPR@@198-200", - "c:@F@work#@CALL_EXPR@@268-270" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@work#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@188-193", - "c:@F@work#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", - "c:@F@some_function#", - "c:0240_b.cpp@133@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@101@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@75@F@f#*Fv()#S0_#@n", - "c:0240_b.cpp@213@F@f#*Fv()#S0_#@n", - "c:@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg", - "c:@F@some_other_function#", - "c:0240_b.cpp@148@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@110@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@84@F@f#*Fv()#S0_#@k", - "c:0240_b.cpp@222@F@f#*Fv()#S0_#@k", - "c:@F@bar#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@235-237", - "c:@F@foo#@SRETURN", - "c:@F@some_function#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f#*Fv()#S0_#@CALL_EXPR@@242-244", - "c:@F@bar#@SRETURN", - "c:@F@some_other_function#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@bar#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3barv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@bar#@SRETURN" - ] - }, - "c:@F@f#*Fv()#S0_#": { - "IsVariadic": false, - "MangledNames": [ - "_Z1fPFvvES0_" - ], - "Parameters": [ - "c:0240_a.cpp@194@F@f#*Fv()#S0_#@n", - "c:0240_a.cpp@219@F@f#*Fv()#S0_#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@f#*Fv()#S0_#@SRETURN" - ] - }, - "c:@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_Z3foov" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@foo#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@some_function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z13some_functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@some_function#@SRETURN" - ] - }, - "c:@F@some_other_function#": { - "IsVariadic": false, - "MangledNames": [ - "_Z19some_other_functionv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@some_other_function#@SRETURN" - ] - }, - "c:@F@work#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4workv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@work#@SRETURN" - ] - } - }, - "FunctionMap": { - "c:@F@bar#": "c:@F@bar#", - "c:@F@f#*Fv()#S0_#": "c:@F@f#*Fv()#S0_#", - "c:@F@foo#": "c:@F@foo#", - "c:@F@main#": "c:@F@main#", - "c:@F@some_function#": "c:@F@some_function#", - "c:@F@some_other_function#": "c:@F@some_other_function#", - "c:@F@work#": "c:@F@work#" - } - }, - "_CG": { - "_Z1fPFvvES0_": { - "callees": [ - "_Z13some_functionv", - "_Z19some_other_functionv", - "_Z3barv", - "_Z3foov" - ], - "callers": [ - "_Z4workv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3barv": { - "callees": [], - "callers": [ - "_Z1fPFvvES0_" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [], - "callers": [ - "_Z1fPFvvES0_" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4workv": { - "callees": [ - "_Z1fPFvvES0_" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z1fPFvvES0_": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z1fPFvvES0_", - "_Z4workv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0240_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z1fPFvvES0_": 0, - "_Z4workv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0241_a.cpp b/tools/cage/test/input/multiTU/0241_a.cpp deleted file mode 100644 index 8dba1e91..00000000 --- a/tools/cage/test/input/multiTU/0241_a.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Test for handling a combination of function pointers and virtual classes across multiple TUs -extern void f1(); -extern void f2(); - -using Ftype = void(); - -struct Base { - virtual int foo() { - f = nullptr; - return 1; - } - Ftype* f; -}; - -struct Child1 : Base { - int foo() override { - f = f1; - return 2; - } -}; - -struct Child2 : Base { - int foo() override { - f = f2; - return 3; - } -}; - -void calc(Base* arg); - -int main() { - Base* b = new Base(); - bool test1 = true; - bool test2 = true; - if (test1) { - b = new Child1(); - } - if (test2) { - b = new Child2(); - } - calc(b); -} diff --git a/tools/cage/test/input/multiTU/0241_a.gtaacg b/tools/cage/test/input/multiTU/0241_a.gtaacg deleted file mode 100644 index a8a649ae..00000000 --- a/tools/cage/test/input/multiTU/0241_a.gtaacg +++ /dev/null @@ -1,1352 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": {}, - "CallInfoMap": {}, - "EquivClasses": [ - { - "Objects": [ - "c:@S@Child2@F@~Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@~Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@~Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@f1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@486@F@main#@test2" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@465@F@main#@test1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@589-595", - "c:@F@calc#*$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@foo#@THIS", - "c:@S@Child1@F@foo#@THIS", - "c:@S@Base@F@foo#@THIS" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:@S@Child2@F@foo#@THIS" - } - ] - }, - { - "Objects": [ - "*c:@S@Base@F@foo#@THIS", - "*c:@S@Child1@F@foo#@THIS", - "*c:@S@Child2@F@foo#@THIS" - ], - "Prefixes": [ - { - "Member": "c:@S@Base@FI@f", - "Object": "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f" - } - ] - }, - { - "Objects": [ - "c:@S@Child2@F@foo#@SRETURN", - "c:@S@Child1@F@foo#@SRETURN", - "c:@S@Base@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:@S@Child2@F@foo#@THIS).c:@S@Base@FI@f", - "(*c:@S@Child1@F@foo#@THIS).c:@S@Base@FI@f", - "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f", - "c:@S@Base@FI@f", - "c:@F@f1#", - "c:@F@f2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg", - "c:0241_a.cpp@441@F@main#@b", - "&c:@F@main#@NEW@451-460", - "&c:@F@main#@NEW@528-539", - "&c:@F@main#@NEW@569-580" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@NEW@451-460" - } - ] - }, - { - "Objects": [ - "c:@F@main#@NEW@569-580", - "c:@F@main#@NEW@528-539", - "c:@F@main#@NEW@451-460", - "c:@F@main#@CALL_EXPR@@455-460", - "c:@F@main#@CALL_EXPR@@532-539", - "c:@F@main#@CALL_EXPR@@573-580", - "c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", - "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#@THIS", - "c:@S@Child1@F@Child1#@THIS", - "c:@S@Base@F@Base#@THIS", - "&c:@S@Child1@F@Child1#@CALL_EXPR@@250-250", - "&c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", - "&c:@F@main#@CALL_EXPR@@455-460", - "&c:@F@main#@CALL_EXPR@@532-539", - "&c:@F@main#@CALL_EXPR@@573-580" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@calc#*$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4calcP4Base" - ], - "Parameters": [ - "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@calc#*$@S@Base#@SRETURN" - ] - }, - "c:@F@f1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@f1#@SRETURN" - ] - }, - "c:@F@f2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@f2#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@operator delete#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdlPv" - ], - "Parameters": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete#*v#@SRETURN" - ] - }, - "c:@F@operator delete[]#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdaPv" - ], - "Parameters": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete[]#*v#@SRETURN" - ] - }, - "c:@F@operator new#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znwm" - ], - "Parameters": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new#l#@SRETURN" - ] - }, - "c:@F@operator new[]#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znam" - ], - "Parameters": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new[]#l#@SRETURN" - ] - }, - "c:@S@Base@F@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2Ev", - "_ZN4BaseC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@Base#&&$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2EOS_", - "_ZN4BaseC1EOS_" - ], - "Parameters": [ - "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@Base#&1$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2ERKS_", - "_ZN4BaseC1ERKS_" - ], - "Parameters": [ - "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4Base3fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@foo#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&&$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSEOS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&1$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSERKS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@~Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseD2Ev", - "_ZN4BaseD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2Ev", - "_ZN6Child1C1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#&&$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2EOS_", - "_ZN6Child1C1EOS_" - ], - "Parameters": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#&1$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2ERKS_", - "_ZN6Child1C1ERKS_" - ], - "Parameters": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child13fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@foo#@SRETURN" - ] - }, - "c:@S@Child1@F@operator=#&&$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1aSEOS_" - ], - "Parameters": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" - ] - }, - "c:@S@Child1@F@operator=#&1$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1aSERKS_" - ], - "Parameters": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" - ] - }, - "c:@S@Child1@F@~Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1D2Ev", - "_ZN6Child1D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2Ev", - "_ZN6Child2C1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#&&$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2EOS_", - "_ZN6Child2C1EOS_" - ], - "Parameters": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#&1$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2ERKS_", - "_ZN6Child2C1ERKS_" - ], - "Parameters": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child23fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@foo#@SRETURN" - ] - }, - "c:@S@Child2@F@operator=#&&$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2aSEOS_" - ], - "Parameters": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" - ] - }, - "c:@S@Child2@F@operator=#&1$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2aSERKS_" - ], - "Parameters": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" - ] - }, - "c:@S@Child2@F@~Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2D2Ev", - "_ZN6Child2D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", - "c:@F@f1#": "c:@F@f1#", - "c:@F@f2#": "c:@F@f2#", - "c:@F@main#": "c:@F@main#", - "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", - "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", - "c:@F@operator new#l#": "c:@F@operator new#l#", - "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", - "c:@S@Base@F@Base#": "c:@S@Base@F@Base#", - "c:@S@Base@F@Base#&&$@S@Base#": "c:@S@Base@F@Base#&&$@S@Base#", - "c:@S@Base@F@Base#&1$@S@Base#": "c:@S@Base@F@Base#&1$@S@Base#", - "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", - "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", - "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", - "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#", - "c:@S@Child1@F@Child1#": "c:@S@Child1@F@Child1#", - "c:@S@Child1@F@Child1#&&$@S@Child1#": "c:@S@Child1@F@Child1#&&$@S@Child1#", - "c:@S@Child1@F@Child1#&1$@S@Child1#": "c:@S@Child1@F@Child1#&1$@S@Child1#", - "c:@S@Child1@F@foo#": "c:@S@Child1@F@foo#", - "c:@S@Child1@F@operator=#&&$@S@Child1#": "c:@S@Child1@F@operator=#&&$@S@Child1#", - "c:@S@Child1@F@operator=#&1$@S@Child1#": "c:@S@Child1@F@operator=#&1$@S@Child1#", - "c:@S@Child1@F@~Child1#": "c:@S@Child1@F@~Child1#", - "c:@S@Child2@F@Child2#": "c:@S@Child2@F@Child2#", - "c:@S@Child2@F@Child2#&&$@S@Child2#": "c:@S@Child2@F@Child2#&&$@S@Child2#", - "c:@S@Child2@F@Child2#&1$@S@Child2#": "c:@S@Child2@F@Child2#&1$@S@Child2#", - "c:@S@Child2@F@foo#": "c:@S@Child2@F@foo#", - "c:@S@Child2@F@operator=#&&$@S@Child2#": "c:@S@Child2@F@operator=#&&$@S@Child2#", - "c:@S@Child2@F@operator=#&1$@S@Child2#": "c:@S@Child2@F@operator=#&1$@S@Child2#", - "c:@S@Child2@F@~Child2#": "c:@S@Child2@F@~Child2#" - } - }, - "_CG": { - "_Z4calcP4Base": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4Base3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [ - "_ZN6Child13fooEv", - "_ZN6Child23fooEv" - ], - "overrides": [] - }, - "_ZN4BaseC1Ev": { - "callees": [], - "callers": [ - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4BaseC2Ev": { - "callees": [], - "callers": [ - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child13fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [ - "_ZN4Base3fooEv" - ] - }, - "_ZN6Child1C1Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child1C2Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child23fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [ - "_ZN4Base3fooEv" - ] - }, - "_ZN6Child2C1Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child2C2Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4calcP4Base", - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev", - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4calcP4Base": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 12, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0241_b.cpp b/tools/cage/test/input/multiTU/0241_b.cpp deleted file mode 100644 index d2a53a58..00000000 --- a/tools/cage/test/input/multiTU/0241_b.cpp +++ /dev/null @@ -1,12 +0,0 @@ -using Ftype = void(); - -struct Base { - virtual int foo(); - Ftype* f; -}; - -void calc(Base* arg) { - //(*arg).foo(); - arg->foo(); - arg->f(); -} diff --git a/tools/cage/test/input/multiTU/0241_b.gtaacg b/tools/cage/test/input/multiTU/0241_b.gtaacg deleted file mode 100644 index d43f6b1d..00000000 --- a/tools/cage/test/input/multiTU/0241_b.gtaacg +++ /dev/null @@ -1,289 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": "c:@F@calc#*$@S@Base#" - }, - "CallInfoMap": { - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": { - "Arguments": [], - "CalledObjects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@Base@F@~Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" - ], - "Prefixes": [ - { - "Member": "c:@S@Base@F@foo#", - "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#" - }, - { - "Member": "c:@S@Base@FI@f", - "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" - } - ] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#@CALL_EXPR@@117-126", - "c:@S@Base@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#", - "c:@S@Base@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f", - "c:@S@Base@FI@f" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@foo#@THIS", - "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" - ], - "Prefixes": [ - { - "Member": "", - "Object": "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" - } - ] - } - ], - "FunctionInfoMap": { - "c:@F@calc#*$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4calcP4Base" - ], - "Parameters": [ - "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@calc#*$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4Base3fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@foo#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&&$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSEOS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&1$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSERKS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@~Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseD2Ev", - "_ZN4BaseD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", - "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", - "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", - "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", - "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#" - } - }, - "_CG": { - "_Z4calcP4Base": { - "callees": [ - "_ZN4Base3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN4Base3fooEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4Base3fooEv": { - "callees": [], - "callers": [ - "_Z4calcP4Base" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/multiTU/0241_combined.gtaacg b/tools/cage/test/input/multiTU/0241_combined.gtaacg deleted file mode 100644 index c62e0f99..00000000 --- a/tools/cage/test/input/multiTU/0241_combined.gtaacg +++ /dev/null @@ -1,1359 +0,0 @@ -{ - "PointerEquivalenceData": { - "CallExprParentMap": { - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": "c:@F@calc#*$@S@Base#" - }, - "CallInfoMap": { - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138": { - "Arguments": [], - "CalledObjects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" - ] - } - }, - "EquivClasses": [ - { - "Objects": [ - "c:@S@Child2@F@Child2#@THIS", - "c:@S@Child1@F@Child1#@THIS", - "c:@S@Base@F@Base#@THIS", - "&c:@S@Child1@F@Child1#@CALL_EXPR@@250-250", - "&c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", - "&c:@F@main#@CALL_EXPR@@455-460", - "&c:@F@main#@CALL_EXPR@@532-539", - "&c:@F@main#@CALL_EXPR@@573-580" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" - } - ] - }, - { - "Objects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f", - "(*c:@S@Base@F@foo#@THIS).c:@S@Base@FI@f", - "(*c:@S@Child1@F@foo#@THIS).c:@S@Base@FI@f", - "(*c:@S@Child2@F@foo#@THIS).c:@S@Base@FI@f", - "c:@F@f1#", - "c:@F@f2#", - "c:@S@Base@FI@f" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#@CALL_EXPR@@117-126", - "c:@S@Base@F@foo#@SRETURN", - "c:@S@Child1@F@foo#@SRETURN", - "c:@S@Child2@F@foo#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@CALL_EXPR@@589-595", - "c:@F@calc#*$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@465@F@main#@test1" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@486@F@main#@test2" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@main#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#", - "c:@S@Base@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Base@F@~Base#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child1@F@~Child1#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@foo#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@~Child2#" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@~Child2#@SRETURN" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:@S@Child2@F@~Child2#@THIS" - ], - "Prefixes": [] - }, - { - "Objects": [ - "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg", - "c:0241_a.cpp@441@F@main#@b", - "&c:@F@main#@NEW@451-460", - "&c:@F@main#@NEW@528-539", - "&c:@F@main#@NEW@569-580", - "c:0241_b.cpp@84@F@calc#*$@S@Base#@arg", - "c:@S@Base@F@foo#@THIS", - "c:@S@Child1@F@foo#@THIS", - "c:@S@Child2@F@foo#@THIS" - ], - "Prefixes": [ - { - "Member": "", - "Object": "c:@F@main#@NEW@451-460" - } - ] - }, - { - "Objects": [ - "*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg", - "*c:@S@Base@F@foo#@THIS", - "*c:@S@Child1@F@foo#@THIS", - "*c:@S@Child2@F@foo#@THIS", - "c:@F@main#@NEW@569-580", - "c:@F@main#@NEW@528-539", - "c:@F@main#@NEW@451-460", - "c:@F@main#@CALL_EXPR@@455-460", - "c:@F@main#@CALL_EXPR@@532-539", - "c:@F@main#@CALL_EXPR@@573-580", - "c:@S@Child2@F@Child2#@CALL_EXPR@@330-330", - "c:@S@Child1@F@Child1#@CALL_EXPR@@250-250" - ], - "Prefixes": [ - { - "Member": "c:@S@Base@F@foo#", - "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@F@foo#" - }, - { - "Member": "c:@S@Base@FI@f", - "Object": "(*c:0241_b.cpp@84@F@calc#*$@S@Base#@arg).c:@S@Base@FI@f" - } - ] - }, - { - "Objects": [ - "c:@F@calc#*$@S@Base#@CALL_EXPR@@131-138", - "c:@F@f1#@SRETURN", - "c:@F@f2#@SRETURN" - ], - "Prefixes": [] - } - ], - "FunctionInfoMap": { - "c:@F@calc#*$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_Z4calcP4Base" - ], - "Parameters": [ - "c:0241_a.cpp@413@F@calc#*$@S@Base#@arg" - ], - "ReferencedInReturnStmts": [ - "c:@F@calc#*$@S@Base#@SRETURN" - ] - }, - "c:@F@f1#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f1v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@f1#@SRETURN" - ] - }, - "c:@F@f2#": { - "IsVariadic": false, - "MangledNames": [ - "_Z2f2v" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@f2#@SRETURN" - ] - }, - "c:@F@main#": { - "IsVariadic": false, - "MangledNames": [ - "main" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@F@main#@SRETURN" - ] - }, - "c:@F@operator delete#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdlPv" - ], - "Parameters": [ - "c:@F@operator delete#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete#*v#@SRETURN" - ] - }, - "c:@F@operator delete[]#*v#": { - "IsVariadic": false, - "MangledNames": [ - "_ZdaPv" - ], - "Parameters": [ - "c:@F@operator delete[]#*v#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator delete[]#*v#@SRETURN" - ] - }, - "c:@F@operator new#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znwm" - ], - "Parameters": [ - "c:@F@operator new#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new#l#@SRETURN" - ] - }, - "c:@F@operator new[]#l#": { - "IsVariadic": false, - "MangledNames": [ - "_Znam" - ], - "Parameters": [ - "c:@F@operator new[]#l#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@F@operator new[]#l#@SRETURN" - ] - }, - "c:@S@Base@F@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2Ev", - "_ZN4BaseC1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@Base#&&$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2EOS_", - "_ZN4BaseC1EOS_" - ], - "Parameters": [ - "c:@S@Base@F@Base#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@Base#&1$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseC2ERKS_", - "_ZN4BaseC1ERKS_" - ], - "Parameters": [ - "c:@S@Base@F@Base#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Base@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4Base3fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@foo#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&&$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSEOS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&&$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&&$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@operator=#&1$@S@Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseaSERKS_" - ], - "Parameters": [ - "c:@S@Base@F@operator=#&1$@S@Base#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Base@F@operator=#&1$@S@Base#@SRETURN" - ] - }, - "c:@S@Base@F@~Base#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN4BaseD2Ev", - "_ZN4BaseD1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2Ev", - "_ZN6Child1C1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#&&$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2EOS_", - "_ZN6Child1C1EOS_" - ], - "Parameters": [ - "c:@S@Child1@F@Child1#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@Child1#&1$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1C2ERKS_", - "_ZN6Child1C1ERKS_" - ], - "Parameters": [ - "c:@S@Child1@F@Child1#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child1@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child13fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@foo#@SRETURN" - ] - }, - "c:@S@Child1@F@operator=#&&$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1aSEOS_" - ], - "Parameters": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@operator=#&&$@S@Child1#@SRETURN" - ] - }, - "c:@S@Child1@F@operator=#&1$@S@Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1aSERKS_" - ], - "Parameters": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child1@F@operator=#&1$@S@Child1#@SRETURN" - ] - }, - "c:@S@Child1@F@~Child1#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child1D2Ev", - "_ZN6Child1D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2Ev", - "_ZN6Child2C1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#&&$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2EOS_", - "_ZN6Child2C1EOS_" - ], - "Parameters": [ - "c:@S@Child2@F@Child2#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@Child2#&1$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2C2ERKS_", - "_ZN6Child2C1ERKS_" - ], - "Parameters": [ - "c:@S@Child2@F@Child2#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [] - }, - "c:@S@Child2@F@foo#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child23fooEv" - ], - "Parameters": [], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@foo#@SRETURN" - ] - }, - "c:@S@Child2@F@operator=#&&$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2aSEOS_" - ], - "Parameters": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@operator=#&&$@S@Child2#@SRETURN" - ] - }, - "c:@S@Child2@F@operator=#&1$@S@Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2aSERKS_" - ], - "Parameters": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@UNNAMED_PARAM@0" - ], - "ReferencedInReturnStmts": [ - "c:@S@Child2@F@operator=#&1$@S@Child2#@SRETURN" - ] - }, - "c:@S@Child2@F@~Child2#": { - "IsVariadic": false, - "MangledNames": [ - "_ZN6Child2D2Ev", - "_ZN6Child2D1Ev" - ], - "Parameters": [], - "ReferencedInReturnStmts": [] - } - }, - "FunctionMap": { - "c:@F@calc#*$@S@Base#": "c:@F@calc#*$@S@Base#", - "c:@F@f1#": "c:@F@f1#", - "c:@F@f2#": "c:@F@f2#", - "c:@F@main#": "c:@F@main#", - "c:@F@operator delete#*v#": "c:@F@operator delete#*v#", - "c:@F@operator delete[]#*v#": "c:@F@operator delete[]#*v#", - "c:@F@operator new#l#": "c:@F@operator new#l#", - "c:@F@operator new[]#l#": "c:@F@operator new[]#l#", - "c:@S@Base@F@Base#": "c:@S@Base@F@Base#", - "c:@S@Base@F@Base#&&$@S@Base#": "c:@S@Base@F@Base#&&$@S@Base#", - "c:@S@Base@F@Base#&1$@S@Base#": "c:@S@Base@F@Base#&1$@S@Base#", - "c:@S@Base@F@foo#": "c:@S@Base@F@foo#", - "c:@S@Base@F@operator=#&&$@S@Base#": "c:@S@Base@F@operator=#&&$@S@Base#", - "c:@S@Base@F@operator=#&1$@S@Base#": "c:@S@Base@F@operator=#&1$@S@Base#", - "c:@S@Base@F@~Base#": "c:@S@Base@F@~Base#", - "c:@S@Child1@F@Child1#": "c:@S@Child1@F@Child1#", - "c:@S@Child1@F@Child1#&&$@S@Child1#": "c:@S@Child1@F@Child1#&&$@S@Child1#", - "c:@S@Child1@F@Child1#&1$@S@Child1#": "c:@S@Child1@F@Child1#&1$@S@Child1#", - "c:@S@Child1@F@foo#": "c:@S@Child1@F@foo#", - "c:@S@Child1@F@operator=#&&$@S@Child1#": "c:@S@Child1@F@operator=#&&$@S@Child1#", - "c:@S@Child1@F@operator=#&1$@S@Child1#": "c:@S@Child1@F@operator=#&1$@S@Child1#", - "c:@S@Child1@F@~Child1#": "c:@S@Child1@F@~Child1#", - "c:@S@Child2@F@Child2#": "c:@S@Child2@F@Child2#", - "c:@S@Child2@F@Child2#&&$@S@Child2#": "c:@S@Child2@F@Child2#&&$@S@Child2#", - "c:@S@Child2@F@Child2#&1$@S@Child2#": "c:@S@Child2@F@Child2#&1$@S@Child2#", - "c:@S@Child2@F@foo#": "c:@S@Child2@F@foo#", - "c:@S@Child2@F@operator=#&&$@S@Child2#": "c:@S@Child2@F@operator=#&&$@S@Child2#", - "c:@S@Child2@F@operator=#&1$@S@Child2#": "c:@S@Child2@F@operator=#&1$@S@Child2#", - "c:@S@Child2@F@~Child2#": "c:@S@Child2@F@~Child2#" - } - }, - "_CG": { - "_Z4calcP4Base": { - "callees": [ - "_Z2f1v", - "_Z2f2v", - "_ZN4Base3fooEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_b.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN4Base3fooEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4Base3fooEv": { - "callees": [], - "callers": [ - "_Z4calcP4Base" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [ - "_ZN6Child13fooEv", - "_ZN6Child23fooEv" - ], - "overrides": [] - }, - "_ZN4BaseC1Ev": { - "callees": [], - "callers": [ - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN4BaseC2Ev": { - "callees": [], - "callers": [ - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child13fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [ - "_ZN4Base3fooEv" - ] - }, - "_ZN6Child1C1Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child1C2Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child23fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [ - "_ZN4Base3fooEv" - ] - }, - "_ZN6Child2C1Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN6Child2C2Ev": { - "callees": [ - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4calcP4Base", - "_ZN4BaseC1Ev", - "_ZN4BaseC2Ev", - "_ZN6Child1C1Ev", - "_ZN6Child1C2Ev", - "_ZN6Child2C1Ev", - "_ZN6Child2C2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/multiTU/0241_a.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z4calcP4Base": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 2, - "numOperations": { - "numberOfControlFlowOps": 12, - "numberOfFloatOps": 0, - "numberOfIntOps": 7, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0001.gtmcg b/tools/cage/test/input/singleTU/0001.gtmcg index aaaa518f..4e3702b9 100644 --- a/tools/cage/test/input/singleTU/0001.gtmcg +++ b/tools/cage/test/input/singleTU/0001.gtmcg @@ -1,28 +1,22 @@ { "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0001.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] + "meta": {}, + "nodes": { + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0002.gtmcg b/tools/cage/test/input/singleTU/0002.gtmcg index e054fd42..8bc1daad 100644 --- a/tools/cage/test/input/singleTU/0002.gtmcg +++ b/tools/cage/test/input/singleTU/0002.gtmcg @@ -1,48 +1,31 @@ { "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0002.cpp", - "systemInclude": false + "main": { + "callees": { + "_Z3foov": {} }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0003.gtmcg b/tools/cage/test/input/singleTU/0003.gtmcg index a8c50890..ed6cecfe 100644 --- a/tools/cage/test/input/singleTU/0003.gtmcg +++ b/tools/cage/test/input/singleTU/0003.gtmcg @@ -1,68 +1,40 @@ { "_CG": { - "_Z3barv": { - "callees": [], - "callers": [ - "_Z3foov" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_Z3barv": { + "callees": {}, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foov": { - "callees": [ - "_Z3barv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false + "_Z3foov": { + "callees": { + "_Z3barv": {} }, - "numStatements": 1 + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0003.cpp", - "systemInclude": false + "main": { + "callees": { + "_Z3foov": {} }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0004.gtmcg b/tools/cage/test/input/singleTU/0004.gtmcg index b1bb139f..811b90c0 100644 --- a/tools/cage/test/input/singleTU/0004.gtmcg +++ b/tools/cage/test/input/singleTU/0004.gtmcg @@ -1,44 +1,29 @@ { "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", - "systemInclude": false - }, - "numStatements": 4 + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0004.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0005.gtmcg b/tools/cage/test/input/singleTU/0005.gtmcg index 50bad406..e266deb2 100644 --- a/tools/cage/test/input/singleTU/0005.gtmcg +++ b/tools/cage/test/input/singleTU/0005.gtmcg @@ -1,67 +1,39 @@ { "_CG": { - "_Z8childOnev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_Z8childOnev": { + "callees": {}, + "functionName": "_Z8childOnev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z8childTwov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false - }, - "numStatements": 0 + "_Z8childTwov": { + "callees": {}, + "functionName": "_Z8childTwov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8childTwov", - "_Z8childOnev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0005.cpp", - "systemInclude": false + "main": { + "callees": { + "_Z8childOnev": {}, + "_Z8childTwov": {} }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0013.gtmcg b/tools/cage/test/input/singleTU/0013.gtmcg index 6ab88d0a..0c4f5847 100644 --- a/tools/cage/test/input/singleTU/0013.gtmcg +++ b/tools/cage/test/input/singleTU/0013.gtmcg @@ -1,87 +1,49 @@ { "_CG": { - "_Z6middlev": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false + "meta": {}, + "nodes": { + "_Z6middlev": { + "callees": { + "_Z9lastChildv": {} }, - "numStatements": 1 + "functionName": "_Z6middlev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false + "_Z7middle2v": { + "callees": { + "_Z9lastChildv": {} }, - "numStatements": 1 + "functionName": "_Z7middle2v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9lastChildv": { - "callees": [], - "callers": [ - "_Z7middle2v", - "_Z6middlev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false - }, - "numStatements": 1 + "_Z9lastChildv": { + "callees": {}, + "functionName": "_Z9lastChildv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z6middlev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0013.cpp", - "systemInclude": false + "main": { + "callees": { + "_Z6middlev": {} }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0014.gtmcg b/tools/cage/test/input/singleTU/0014.gtmcg index 1fac27ec..5d844d49 100644 --- a/tools/cage/test/input/singleTU/0014.gtmcg +++ b/tools/cage/test/input/singleTU/0014.gtmcg @@ -1,90 +1,50 @@ { "_CG": { - "_Z6middlev": { - "callees": [ - "_Z7middle2v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false + "meta": {}, + "nodes": { + "_Z6middlev": { + "callees": { + "_Z7middle2v": {} }, - "numStatements": 1 + "functionName": "_Z6middlev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z7middle2v": { - "callees": [ - "_Z9lastChildv" - ], - "callers": [ - "_Z6middlev" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false + "_Z7middle2v": { + "callees": { + "_Z9lastChildv": {} }, - "numStatements": 1 + "functionName": "_Z7middle2v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z9lastChildv": { - "callees": [], - "callers": [ - "main", - "_Z7middle2v" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false - }, - "numStatements": 1 + "_Z9lastChildv": { + "callees": {}, + "functionName": "_Z9lastChildv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z9lastChildv", - "_Z6middlev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0014.cpp", - "systemInclude": false + "main": { + "callees": { + "_Z6middlev": {}, + "_Z9lastChildv": {} }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0022.cpp b/tools/cage/test/input/singleTU/0022.cpp deleted file mode 100644 index 961ef2ef..00000000 --- a/tools/cage/test/input/singleTU/0022.cpp +++ /dev/null @@ -1,10 +0,0 @@ - - -int main(int argc, char** argv) { - int a = 2; - int b = 2; - - int k = a * b; - - return 0; -} diff --git a/tools/cage/test/input/singleTU/0022.gtmcg b/tools/cage/test/input/singleTU/0022.gtmcg deleted file mode 100644 index 6cd9a3cc..00000000 --- a/tools/cage/test/input/singleTU/0022.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0022.cpp", - "systemInclude": false - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0063.cpp b/tools/cage/test/input/singleTU/0063.cpp deleted file mode 100644 index b391d8e8..00000000 --- a/tools/cage/test/input/singleTU/0063.cpp +++ /dev/null @@ -1,3 +0,0 @@ -// This test is for checking that the Alias Analysis does not assume that __status and __arg are parameters to on_exit -// Tests function types in a parameter -extern int on_exit(void (*__func)(int __status, void* __arg), void* __arg); \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0063.gtmcg b/tools/cage/test/input/singleTU/0063.gtmcg deleted file mode 100644 index ab557002..00000000 --- a/tools/cage/test/input/singleTU/0063.gtmcg +++ /dev/null @@ -1,11 +0,0 @@ -{ - "_CG": {}, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "9a42ed575dd43d75255b74cbfccb686af3e70e8b", - "version": "0.3" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0065.cpp b/tools/cage/test/input/singleTU/0065.cpp index cd4a508d..562ee0a3 100644 --- a/tools/cage/test/input/singleTU/0065.cpp +++ b/tools/cage/test/input/singleTU/0065.cpp @@ -1,5 +1,5 @@ /** - * Testcase for a missing call in the load imbalance integration test + * Function pointer test */ typedef void (*Fn)(); diff --git a/tools/cage/test/input/singleTU/0065.gtmcg b/tools/cage/test/input/singleTU/0065.gtmcg index 1a87509a..db78fd4e 100644 --- a/tools/cage/test/input/singleTU/0065.gtmcg +++ b/tools/cage/test/input/singleTU/0065.gtmcg @@ -1,145 +1,47 @@ { "_CG": { - "_Z12get_func_ptri": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 + "meta": {}, + "nodes": { + "_Z12get_func_ptri": { + "callees": {}, + "functionName": "_Z12get_func_ptri", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func1v": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5func2v": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z12get_func_ptri", - "_Z5func1v", - "_Z5func2v" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0065.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z12get_func_ptri": 0, - "_Z5func1v": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 + "_Z5func2v": { + "callees": {}, + "functionName": "_Z5func2v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_Z12get_func_ptri": {}, + "_Z5func1v": {}, + "_Z5func2v": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0066.cpp b/tools/cage/test/input/singleTU/0066.cpp index 2101dd61..8ca1c99e 100644 --- a/tools/cage/test/input/singleTU/0066.cpp +++ b/tools/cage/test/input/singleTU/0066.cpp @@ -1,5 +1,5 @@ // Tests the handling of builtin functions -extern void foo(); +void foo() {}; int main() { int x = 0; diff --git a/tools/cage/test/input/singleTU/0066.gtmcg b/tools/cage/test/input/singleTU/0066.gtmcg index 554aa353..8bc1daad 100644 --- a/tools/cage/test/input/singleTU/0066.gtmcg +++ b/tools/cage/test/input/singleTU/0066.gtmcg @@ -1,79 +1,31 @@ { "_CG": { - "_Z3foov": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": false, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3foov" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 + "main": { + "callees": { + "_Z3foov": {} }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0066.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_Z3foov": 0, - "__builtin_expect": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 1, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 2, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 4 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "7f4afb25e43f74263aff689b1d42501c830a67eb", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0215.cpp b/tools/cage/test/input/singleTU/0215.cpp deleted file mode 100644 index 7fb3da3e..00000000 --- a/tools/cage/test/input/singleTU/0215.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -int* k; - -int foo(int k) { - if (k == 42) { - return 0; - } - return foo(k); -} - -int main() { - foo(42); - return 0; -} diff --git a/tools/cage/test/input/singleTU/0215.gtmcg b/tools/cage/test/input/singleTU/0215.gtmcg deleted file mode 100644 index d18f404d..00000000 --- a/tools/cage/test/input/singleTU/0215.gtmcg +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_CG": { - "_Z3fooi": { - "callees": [ - "_Z3fooi" - ], - "callers": [ - "main", - "_Z3fooi" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z3fooi" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0215.cpp", - "systemInclude": false - }, - "mallocCollector": [], - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "3f6097119927b7bf04c0507f0bd75c65ae9f5088", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0221.cpp b/tools/cage/test/input/singleTU/0221.cpp deleted file mode 100644 index 81ebaa0a..00000000 --- a/tools/cage/test/input/singleTU/0221.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Test branch - -int main() { - bool a = 5 ? false : true; - int b = 7; - if (a) { - switch (b) { - default: - break; - } - } else if (b) { - bool f = true; - while (f) { - f = false; - } - } - - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0221.gtmcg b/tools/cage/test/input/singleTU/0221.gtmcg deleted file mode 100644 index 1698edbb..00000000 --- a/tools/cage/test/input/singleTU/0221.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0221.cpp", - "systemInclude": false - }, - "numStatements": 10 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0222.cpp b/tools/cage/test/input/singleTU/0222.cpp deleted file mode 100644 index aa902f19..00000000 --- a/tools/cage/test/input/singleTU/0222.cpp +++ /dev/null @@ -1,11 +0,0 @@ -int x; - -int main() { - int f = 5; - f = 7; - - if (4) { - return 0; - } - return 1 + 2 + x; -} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0222.gtmcg b/tools/cage/test/input/singleTU/0222.gtmcg deleted file mode 100644 index cdce2677..00000000 --- a/tools/cage/test/input/singleTU/0222.gtmcg +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0222.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0223.cpp b/tools/cage/test/input/singleTU/0223.cpp deleted file mode 100644 index 9688ccad..00000000 --- a/tools/cage/test/input/singleTU/0223.cpp +++ /dev/null @@ -1,20 +0,0 @@ -int x; - -int test() { - do { - return 1; - } while (true); -}; - -int main() { - while (true) { - int a; - while (true) { - break; - } - a = 0; - break; - } - test(); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0223.gtmcg b/tools/cage/test/input/singleTU/0223.gtmcg deleted file mode 100644 index f5215b3f..00000000 --- a/tools/cage/test/input/singleTU/0223.gtmcg +++ /dev/null @@ -1,48 +0,0 @@ -{ - "_CG": { - "_Z4testv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0223.cpp", - "systemInclude": false - }, - "numStatements": 8 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0224.cpp b/tools/cage/test/input/singleTU/0224.cpp deleted file mode 100644 index 2dd7cb87..00000000 --- a/tools/cage/test/input/singleTU/0224.cpp +++ /dev/null @@ -1,21 +0,0 @@ -int test2() { return 0; } - -int test() { - do { - return test2(); - } while (true); -}; - -int main() { - while (true) { - int a; - while (true) { - test(); - break; - } - a = 0; - break; - } - test(); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0224.gtmcg b/tools/cage/test/input/singleTU/0224.gtmcg deleted file mode 100644 index 100af60e..00000000 --- a/tools/cage/test/input/singleTU/0224.gtmcg +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_CG": { - "_Z4testv": { - "callees": [ - "_Z5test2v" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5test2v": { - "callees": [], - "callers": [ - "_Z4testv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z4testv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0224.cpp", - "systemInclude": false - }, - "numStatements": 9 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0225.cpp b/tools/cage/test/input/singleTU/0225.cpp deleted file mode 100644 index e176bd5d..00000000 --- a/tools/cage/test/input/singleTU/0225.cpp +++ /dev/null @@ -1,58 +0,0 @@ -void leaf() { - while (true) { - break; - } -} - -void loop(); - -void x() { - leaf(); - loop(); -} - -void left() { - while (true) { - x(); - break; - } -} - -void right() { - while (true) { - while (true) { - x(); - break; - } - break; - } -} - -void split() { - left(); - right(); -} - -void loop() { - while (true) { - split(); - break; - } -} - -__attribute__((retain)) -void entry() { - while (true) { - while (true) { - left(); - entry(); - break; - } - break; - } -} - -int main() { - split(); - return 0; -} diff --git a/tools/cage/test/input/singleTU/0225.gtmcg b/tools/cage/test/input/singleTU/0225.gtmcg deleted file mode 100644 index a21e5980..00000000 --- a/tools/cage/test/input/singleTU/0225.gtmcg +++ /dev/null @@ -1,174 +0,0 @@ -{ - "_CG": { - "_Z1xv": { - "callees": [ - "_Z4leafv", - "_Z4loopv" - ], - "callers": [ - "_Z4leftv", - "_Z5rightv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leafv": { - "callees": [], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4leftv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5entryv", - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z4loopv": { - "callees": [ - "_Z5splitv" - ], - "callers": [ - "_Z1xv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5entryv": { - "callees": [ - "_Z4leftv", - "_Z5entryv" - ], - "callers": [ - "_Z5entryv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 6 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5rightv": { - "callees": [ - "_Z1xv" - ], - "callers": [ - "_Z5splitv" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 5 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z5splitv": { - "callees": [ - "_Z4leftv", - "_Z5rightv" - ], - "callers": [ - "_Z4loopv", - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z5splitv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0225.cpp", - "systemInclude": false - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0226.cpp b/tools/cage/test/input/singleTU/0226.cpp deleted file mode 100644 index c2891ae3..00000000 --- a/tools/cage/test/input/singleTU/0226.cpp +++ /dev/null @@ -1,8 +0,0 @@ -int foo(int arg[], int offset) { return arg[offset]; } - -struct A { - int a; - int b; -}; - -int boo(struct A a) { return a.b; } \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0226.gtmcg b/tools/cage/test/input/singleTU/0226.gtmcg deleted file mode 100644 index 76d95cf6..00000000 --- a/tools/cage/test/input/singleTU/0226.gtmcg +++ /dev/null @@ -1,44 +0,0 @@ -{ - "_CG": { - "_Z3boo1A": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3fooPii": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0226.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0227.cpp b/tools/cage/test/input/singleTU/0227.cpp deleted file mode 100644 index fbb52699..00000000 --- a/tools/cage/test/input/singleTU/0227.cpp +++ /dev/null @@ -1,11 +0,0 @@ -float foo(float a, int b) { return a * b; } - -float g; -double h; - -void baa(float* arr, int count) { - for (int i = 0; i < count; ++i) { - g *= arr[i]; - } - h++; -} diff --git a/tools/cage/test/input/singleTU/0227.gtmcg b/tools/cage/test/input/singleTU/0227.gtmcg deleted file mode 100644 index 1c3e6343..00000000 --- a/tools/cage/test/input/singleTU/0227.gtmcg +++ /dev/null @@ -1,44 +0,0 @@ -{ - "_CG": { - "_Z3baaPfi": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", - "systemInclude": false - }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] - }, - "_Z3foofi": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0227.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "278803e7a348ac944fc70175b96ff707f6faf03b", - "version": "0.2" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0228.cpp b/tools/cage/test/input/singleTU/0228.cpp deleted file mode 100644 index 43f0b804..00000000 --- a/tools/cage/test/input/singleTU/0228.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Test to make sure we do not mangle the name of this function wrong again -// According to the LLVM discourse, this has internal linkage and as such both manglings -// GCC's and Clang's are permissable. -extern "C" { -typedef unsigned short int __uint16_t; -static __inline __uint16_t __uint16_identity(__uint16_t __x) { return __x; } -} diff --git a/tools/cage/test/input/singleTU/0228.gtmcg b/tools/cage/test/input/singleTU/0228.gtmcg deleted file mode 100644 index 05cedd7f..00000000 --- a/tools/cage/test/input/singleTU/0228.gtmcg +++ /dev/null @@ -1,42 +0,0 @@ -{ - "_CG": { - "_ZL17__uint16_identityt": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0228.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - } - }, - "_MetaCG": { - "generator": { - "name": "CGCollector", - "sha": "7d2df9e14d98eaafadbec1e53b2f7c6aed5bf41b", - "version": "0.4" - }, - "version": "2.0" - } -} diff --git a/tools/cage/test/input/singleTU/0230.gtmcg b/tools/cage/test/input/singleTU/0230.gtmcg index 81f9fad2..c9e064ea 100644 --- a/tools/cage/test/input/singleTU/0230.gtmcg +++ b/tools/cage/test/input/singleTU/0230.gtmcg @@ -1,111 +1,39 @@ { "_CG": { - "_Z1fv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_Z1fv": { + "callees": {}, + "functionName": "_Z1fv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1A14memberFunctionEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_Z1fv", - "_ZN1A14memberFunctionEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0230.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1A14memberFunctionEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 6, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 5 + "_ZN1A14memberFunctionEv": { + "callees": {}, + "functionName": "_ZN1A14memberFunctionEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_Z1fv": {}, + "_ZN1A14memberFunctionEv": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", - "version": "0.3" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0232.cpp b/tools/cage/test/input/singleTU/0232.cpp index c538f180..c7a0c0f3 100644 --- a/tools/cage/test/input/singleTU/0232.cpp +++ b/tools/cage/test/input/singleTU/0232.cpp @@ -1,4 +1,5 @@ -// Test for the handling of new and delete and calling function pointers within them +// Test for the handling of new and delete and calling function pointers within them. +// The ground truth assumes that the pointer can be resolved. typedef void (*Fn)(); void func1() {} diff --git a/tools/cage/test/input/singleTU/0232.gtmcg b/tools/cage/test/input/singleTU/0232.gtmcg index 88fde759..1fca52a5 100644 --- a/tools/cage/test/input/singleTU/0232.gtmcg +++ b/tools/cage/test/input/singleTU/0232.gtmcg @@ -1,192 +1,64 @@ { "_CG": { - "_Z5func1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_ZN1XC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1XC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_ZN1XD2Ev": { + "callees": { + "_Z5func1v": {} + }, + "functionName": "_ZN1XD2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_ZdlPvm": { + "callees": {}, + "functionName": "_ZdlPvm", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0232.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 2 + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN1XC2EPFvvE": {}, + "_ZN1XD2Ev": {}, + "_ZdlPvm": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0233.gtmcg b/tools/cage/test/input/singleTU/0233.gtmcg index aa010221..f6d2a6fb 100644 --- a/tools/cage/test/input/singleTU/0233.gtmcg +++ b/tools/cage/test/input/singleTU/0233.gtmcg @@ -1,42 +1,31 @@ { "_CG": { - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 3 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0233.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 4, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 + "meta": {}, + "nodes": { + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "470b9d4f8aa11a40a535bb01b744c6c355fac544", - "version": "0.3" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0234.gtmcg b/tools/cage/test/input/singleTU/0234.gtmcg index cdb45e6b..8df978bd 100644 --- a/tools/cage/test/input/singleTU/0234.gtmcg +++ b/tools/cage/test/input/singleTU/0234.gtmcg @@ -1,202 +1,56 @@ { "_CG": { - "_Z5func1v": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC1EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XC2EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_ZN1XC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1XC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1XD2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 1, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_ZN1XD2Ev": { + "callees": { + "_Z5func1v": {} + }, + "functionName": "_ZN1XD2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1XD1Ev", - "_ZN1XD2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0234.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1XD1Ev": 0, - "_ZN1XD2Ev": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 5, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN1XC2EPFvvE": {}, + "_ZN1XD2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0235.gtmcg b/tools/cage/test/input/singleTU/0235.gtmcg index ea97a814..84179290 100644 --- a/tools/cage/test/input/singleTU/0235.gtmcg +++ b/tools/cage/test/input/singleTU/0235.gtmcg @@ -1,132 +1,39 @@ { "_CG": { - "_Z3foov": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC1EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC2EPFvvE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0235.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 3, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 3 + "_ZN1CC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1CC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_Z3foov": {}, + "_ZN1CC2EPFvvE": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0237.cpp b/tools/cage/test/input/singleTU/0237.cpp index 49ced569..742e0c26 100644 --- a/tools/cage/test/input/singleTU/0237.cpp +++ b/tools/cage/test/input/singleTU/0237.cpp @@ -1,6 +1,6 @@ // Tests for c++ style constructor init -int foo(); -int boo(); +int foo() {}; +int boo() {}; using FType = decltype(foo); class B { diff --git a/tools/cage/test/input/singleTU/0237.gtmcg b/tools/cage/test/input/singleTU/0237.gtmcg index 38c3add2..0435e08e 100644 --- a/tools/cage/test/input/singleTU/0237.gtmcg +++ b/tools/cage/test/input/singleTU/0237.gtmcg @@ -1,198 +1,66 @@ { "_CG": { - "_ZN1BC1EPFivE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_Z3boov": { + "callees": {}, + "functionName": "_Z3boov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1BC2EPFivE": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 1 + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1C4workEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 2, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 2 + "_ZN1BC2EPFivE": { + "callees": {}, + "functionName": "_ZN1BC2EPFivE", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC1EPFivES1_": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN1CC2EPFivES1_": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN1C4workEv": { + "callees": { + "_Z3boov": {}, + "_Z3foov": {}, + "main": {} + }, + "functionName": "_ZN1C4workEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN1C4workEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0237.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN1C4workEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 4, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 2 + "_ZN1CC2EPFivES1_": { + "callees": { + "_ZN1BC2EPFivE": {} + }, + "functionName": "_ZN1CC2EPFivES1_", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN1C4workEv": {}, + "_ZN1CC2EPFivES1_": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0006.gtmcg b/tools/cage/test/input/virtualCalls/0006.gtmcg index 8262f670..bb778d58 100644 --- a/tools/cage/test/input/virtualCalls/0006.gtmcg +++ b/tools/cage/test/input/virtualCalls/0006.gtmcg @@ -1,48 +1,31 @@ { "_CG": { - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0006.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0006.cpp", - "systemInclude": false + "main": { + "callees": { + "_ZN7MyClass3fooEv": {} }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0007.gtmcg b/tools/cage/test/input/virtualCalls/0007.gtmcg index b6699c3f..a5743786 100644 --- a/tools/cage/test/input/virtualCalls/0007.gtmcg +++ b/tools/cage/test/input/virtualCalls/0007.gtmcg @@ -1,192 +1,56 @@ { "_CG": { - "_ZN7MyClassC1Ei": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_ZN7MyClassC2Ei": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ei", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassC2Ei": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 2 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 1 + "_ZN7MyClassD0Ev": { + "callees": { + "_ZN7MyClassD2Ev": {}, + "_ZdlPvm": {} + }, + "functionName": "_ZN7MyClassD0Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD0Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClassD2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassD2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD1Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN7MyClassD2Ev": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 - }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0007.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 3, - "numberOfFloatOps": 0, - "numberOfIntOps": 1, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 3 + "_ZdlPvm": { + "callees": {}, + "functionName": "_ZdlPvm", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN7MyClassC2Ei": {}, + "_ZN7MyClassD2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "00d2b8453cc08cb1aacd7df9ea1645bd086f80da", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0008.gtmcg b/tools/cage/test/input/virtualCalls/0008.gtmcg index 6d696272..a8e33ddd 100644 --- a/tools/cage/test/input/virtualCalls/0008.gtmcg +++ b/tools/cage/test/input/virtualCalls/0008.gtmcg @@ -1,68 +1,56 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN13MyClassDerive3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0008.cpp", - "systemInclude": false - }, - "numStatements": 4 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {}, + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0009.gtmcg b/tools/cage/test/input/virtualCalls/0009.gtmcg index 64dc23e1..1105a215 100644 --- a/tools/cage/test/input/virtualCalls/0009.gtmcg +++ b/tools/cage/test/input/virtualCalls/0009.gtmcg @@ -1,68 +1,56 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0009.cpp", - "systemInclude": false - }, - "numStatements": 4 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0010.gtmcg b/tools/cage/test/input/virtualCalls/0010.gtmcg index 390a8507..f8fbc251 100644 --- a/tools/cage/test/input/virtualCalls/0010.gtmcg +++ b/tools/cage/test/input/virtualCalls/0010.gtmcg @@ -1,130 +1,81 @@ { "_CG": { - "_Z8callsBarR13MyClassDerive": { - "callees": [ - "_ZN13MyClassDerive3barEv" - ], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false + "meta": {}, + "nodes": { + "_Z8callsBarR13MyClassDerive": { + "callees": { + "_ZN13MyClassDerive3barEv": {} }, - "numStatements": 1 + "functionName": "_Z8callsBarR13MyClassDerive", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN13MyClassDerive3barEv": { - "callees": [], - "callers": [ - "_Z8callsBarR13MyClassDerive" - ], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false - }, - "numStatements": 1 + "_ZN13MyClassDerive3barEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3barEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3barEv" - ] - }, - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false - }, - "numStatements": 0 + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN7MyClass3barEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 1 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3barEv" - ], - "overrides": [] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false - }, - "numStatements": 0 + "_ZN7MyClass3barEv": { + "callees": {}, + "functionName": "_ZN7MyClass3barEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_Z8callsBarR13MyClassDerive", - "_ZN7MyClass3barEv", - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0010.cpp", - "systemInclude": false - }, - "numStatements": 6 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_Z8callsBarR13MyClassDerive": {}, + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3barEv": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0011.gtmcg b/tools/cage/test/input/virtualCalls/0011.gtmcg index 1685f4c5..c61c9ff0 100644 --- a/tools/cage/test/input/virtualCalls/0011.gtmcg +++ b/tools/cage/test/input/virtualCalls/0011.gtmcg @@ -1,64 +1,31 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN14MyClassDeriveD3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", - "systemInclude": false - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN13MyClassDerive3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0011.cpp", - "systemInclude": false + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {} }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0012.gtmcg b/tools/cage/test/input/virtualCalls/0012.gtmcg index 91b6d347..3a93b52b 100644 --- a/tools/cage/test/input/virtualCalls/0012.gtmcg +++ b/tools/cage/test/input/virtualCalls/0012.gtmcg @@ -1,64 +1,31 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", - "systemInclude": false - }, - "numStatements": 1 - }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN14MyClassDeriveD3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", - "systemInclude": false - }, - "numStatements": 1 + "meta": {}, + "nodes": { + "_ZN14MyClassDeriveD3fooEv": { + "callees": {}, + "functionName": "_ZN14MyClassDeriveD3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN14MyClassDeriveD3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0012.cpp", - "systemInclude": false + "main": { + "callees": { + "_ZN14MyClassDeriveD3fooEv": {} }, - "numStatements": 3 - }, - "overriddenBy": [], - "overrides": [] + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0015.gtmcg b/tools/cage/test/input/virtualCalls/0015.gtmcg index 89307926..b4807fac 100644 --- a/tools/cage/test/input/virtualCalls/0015.gtmcg +++ b/tools/cage/test/input/virtualCalls/0015.gtmcg @@ -1,88 +1,72 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN8MyClass23fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN8MyClass2C2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN8MyClass23fooEv" - ], - "overrides": [] - }, - "_ZN8MyClass23fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", - "systemInclude": false - }, - "numStatements": 0 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0015.cpp", - "systemInclude": false + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass23fooEv": { + "callees": {}, + "functionName": "_ZN8MyClass23fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass2C2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 4 + "functionName": "_ZN8MyClass2C2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0016.gtmcg b/tools/cage/test/input/virtualCalls/0016.gtmcg index 3970b748..aefd95cf 100644 --- a/tools/cage/test/input/virtualCalls/0016.gtmcg +++ b/tools/cage/test/input/virtualCalls/0016.gtmcg @@ -1,180 +1,80 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {}, + "_ZN8MyClass2C2Ev": {} + }, + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "_ZN8MyClass23fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "_ZThn8_N13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0016.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN7MyClass3fooEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 + "_ZN8MyClass23fooEv": { + "callees": {}, + "functionName": "_ZN8MyClass23fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass2C2Ev": { + "callees": {}, + "functionName": "_ZN8MyClass2C2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": { + "_ZN13MyClassDerive3fooEv": {} + }, + "functionName": "_ZThn8_N13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0017.gtmcg b/tools/cage/test/input/virtualCalls/0017.gtmcg index 54896f69..48d5e72b 100644 --- a/tools/cage/test/input/virtualCalls/0017.gtmcg +++ b/tools/cage/test/input/virtualCalls/0017.gtmcg @@ -1,180 +1,89 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN11MyClassStepC2Ev": { + "callees": { + "_ZN8MyClass2C2Ev": {} + }, + "functionName": "_ZN11MyClassStepC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "_ZN8MyClass23fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN11MyClassStepC2Ev": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "_ZThn8_N13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0017.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN7MyClass3fooEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass23fooEv": { + "callees": {}, + "functionName": "_ZN8MyClass23fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass2C2Ev": { + "callees": {}, + "functionName": "_ZN8MyClass2C2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": { + "_ZN13MyClassDerive3fooEv": {} + }, + "functionName": "_ZThn8_N13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0018.cpp b/tools/cage/test/input/virtualCalls/0018.cpp index 26e372c5..1167fe7d 100644 --- a/tools/cage/test/input/virtualCalls/0018.cpp +++ b/tools/cage/test/input/virtualCalls/0018.cpp @@ -7,7 +7,7 @@ class MyClass { class MyClass2 : public MyClass { public: - virtual void foo() override {} // TODO core cump if override is missing + virtual void foo() override {} }; class MyClassDerive : public MyClass, public MyClass2 { diff --git a/tools/cage/test/input/virtualCalls/0018.gtmcg b/tools/cage/test/input/virtualCalls/0018.gtmcg index 193766e8..0eca9553 100644 --- a/tools/cage/test/input/virtualCalls/0018.gtmcg +++ b/tools/cage/test/input/virtualCalls/0018.gtmcg @@ -1,183 +1,82 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {}, + "_ZN8MyClass2C2Ev": {} + }, + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZN8MyClass23fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "_ZN8MyClass23fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv", - "_ZThn8_N13MyClassDerive3fooEv" - ], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZThn8_N13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv", - "_ZN8MyClass23fooEv" - ] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 4 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0018.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN7MyClass3fooEv": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 1 - }, - "numStatements": 4 + "_ZN8MyClass23fooEv": { + "callees": {}, + "functionName": "_ZN8MyClass23fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN8MyClass2C2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} + }, + "functionName": "_ZN8MyClass2C2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZThn8_N13MyClassDerive3fooEv": { + "callees": { + "_ZN13MyClassDerive3fooEv": {} + }, + "functionName": "_ZThn8_N13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "fb0a2854b64e5ac27c0a2e8b3e2c1b413e79ab6d", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0019.gtmcg b/tools/cage/test/input/virtualCalls/0019.gtmcg index 3059d694..1d5e3cb0 100644 --- a/tools/cage/test/input/virtualCalls/0019.gtmcg +++ b/tools/cage/test/input/virtualCalls/0019.gtmcg @@ -1,68 +1,57 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN7MyClass3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0019.cpp", - "systemInclude": false - }, - "numStatements": 5 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {}, + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN7MyClass3fooEv": {}, + "_ZN7MyClassC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0020.gtmcg b/tools/cage/test/input/virtualCalls/0020.gtmcg index be2bd5cf..132fa264 100644 --- a/tools/cage/test/input/virtualCalls/0020.gtmcg +++ b/tools/cage/test/input/virtualCalls/0020.gtmcg @@ -1,68 +1,55 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN13MyClassDerive3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0020.cpp", - "systemInclude": false - }, - "numStatements": 5 + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {}, + "_ZN13MyClassDeriveC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0021.gtmcg b/tools/cage/test/input/virtualCalls/0021.gtmcg index 4668bd60..aa0d94b3 100644 --- a/tools/cage/test/input/virtualCalls/0021.gtmcg +++ b/tools/cage/test/input/virtualCalls/0021.gtmcg @@ -1,88 +1,73 @@ { "_CG": { - "_ZN13MyClassDerive3fooEv": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", - "systemInclude": false - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN13MyClassDerive3fooEv": { + "callees": {}, + "functionName": "_ZN13MyClassDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN19MyClassDeriveDerive3fooEv" - ], - "overrides": [ - "_ZN7MyClass3fooEv" - ] - }, - "_ZN19MyClassDeriveDerive3fooEv": { - "callees": [], - "callers": [], - "doesOverride": true, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", - "systemInclude": false + "_ZN13MyClassDeriveC2Ev": { + "callees": { + "_ZN7MyClassC2Ev": {} }, - "numStatements": 0 + "functionName": "_ZN13MyClassDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [ - "_ZN13MyClassDerive3fooEv" - ] - }, - "_ZN7MyClass3fooEv": { - "callees": [], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", - "systemInclude": false - }, - "numStatements": 0 + "_ZN19MyClassDeriveDerive3fooEv": { + "callees": {}, + "functionName": "_ZN19MyClassDeriveDerive3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [ - "_ZN13MyClassDerive3fooEv" - ], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN13MyClassDerive3fooEv" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/singleTU/0021.cpp", - "systemInclude": false + "_ZN19MyClassDeriveDeriveC2Ev": { + "callees": { + "_ZN13MyClassDeriveC2Ev": {} }, - "numStatements": 5 + "functionName": "_ZN19MyClassDeriveDeriveC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "_ZN7MyClassC2Ev": { + "callees": {}, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN13MyClassDerive3fooEv": {}, + "_ZN13MyClassDeriveC2Ev": {}, + "_ZN19MyClassDeriveDerive3fooEv": {}, + "_ZN19MyClassDeriveDeriveC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "a12c2adc9482ef0062fd27f104ab4dfd679cb91f", - "version": "0.2" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0022.gtmcg b/tools/cage/test/input/virtualCalls/0022.gtmcg index 30a3ff30..699c0a37 100644 --- a/tools/cage/test/input/virtualCalls/0022.gtmcg +++ b/tools/cage/test/input/virtualCalls/0022.gtmcg @@ -1,112 +1,56 @@ { "_CG": { - "_ZN8BaseUsedIiE5good1Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "meta": {}, + "nodes": { + "_ZN8BaseUsedIiE5good1Ev": { + "callees": {}, + "functionName": "_ZN8BaseUsedIiE5good1Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "_ZN9ChildUsedIiE5good2Ev": { - "callees": [], - "callers": [ - "main" - ], - "doesOverride": false, - "hasBody": true, - "isVirtual": true, - "meta": { - "codeStatistics": { - "numVars": 0 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": {}, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 0, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 0 - }, - "numStatements": 0 + "_ZN8BaseUsedIiEC2Ev": { + "callees": {}, + "functionName": "_ZN8BaseUsedIiEC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] - }, - "main": { - "callees": [ - "_ZN8BaseUsedIiE5good1Ev", - "_ZN9ChildUsedIiE5good2Ev" - ], - "callers": [], - "doesOverride": false, - "hasBody": true, - "isVirtual": false, - "meta": { - "codeStatistics": { - "numVars": 1 - }, - "fileProperties": { - "origin": "/opt/metacg/mcg-local/cgcollector/test/input/virtualCalls/0022.cpp", - "systemInclude": false - }, - "globalLoopDepth": 0, - "loopCallDepth": { - "_ZN8BaseUsedIiE5good1Ev": 0, - "_ZN9ChildUsedIiE5good2Ev": 0 - }, - "loopDepth": 0, - "mallocCollector": [], - "numConditionalBranches": 0, - "numOperations": { - "numberOfControlFlowOps": 7, - "numberOfFloatOps": 0, - "numberOfIntOps": 0, - "numberOfMemoryAccesses": 2 - }, - "numStatements": 4 + "_ZN9ChildUsedIiE5good2Ev": { + "callees": {}, + "functionName": "_ZN9ChildUsedIiE5good2Ev", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_ZN9ChildUsedIiEC2Ev": { + "callees": { + "_ZN8BaseUsedIiEC2Ev": {} + }, + "functionName": "_ZN9ChildUsedIiEC2Ev", + "hasBody": false, + "meta": {}, + "origin": null }, - "overriddenBy": [], - "overrides": [] + "main": { + "callees": { + "_ZN8BaseUsedIiE5good1Ev": {}, + "_ZN9ChildUsedIiE5good2Ev": {}, + "_ZN9ChildUsedIiEC2Ev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": null + } } }, "_MetaCG": { "generator": { - "name": "CGCollector", - "sha": "0087ee2b3f0bb856239a64cb407a4c6e81699b8b", - "version": "0.4" + "name": "CaGe", + "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "version": "0.1" }, - "version": "2.0" + "version": "4.0" } -} +} \ No newline at end of file diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index 6cc31b0f..33bd9188 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -6,41 +6,62 @@ build_dir="@CMAKE_BINARY_DIR@" cgdiff="$build_dir/tools/cgdiff/cgdiff" cgmerge="$build_dir/tools/cgmerge2/cgmerge2" +suite_pattern=".*" + mkdir -p log # Run single source test case. # Param 1: Path to the test case. # Param 2: Extra compile flags. -function runSingleTUTest { - testCaseFile=$1 - addFlags=$2 +# Param 3: multi TU. +# Param 4: re-generate gt. +function runTestCase { + testCaseName=$1 + testCasePath=$2 + addFlags=$3 + regenerate_gt=$4 fail=0 - # Set up the different data files, we need: - # - The test case - # - The groundtruth data for reconciling the CG constructed by MetaCG - tfile=$testCaseFile - tfilename=$(basename "$tfile") - - run_dir=$(dirname $(realpath --relative-to="$test_src_dir" "$tfile")) + run_dir=$(realpath --relative-to="$test_src_dir" "$testCasePath") mkdir -p $run_dir - cg_outfilename=${tfilename/cpp/mcg} + cg_outfilename=$testCaseName.mcg cg_outfile="$run_dir/$cg_outfilename" - cg_gtfile=${tfile/cpp/gtmcg} + cg_gtfile="$testCasePath/$testCaseName.gtmcg" diff_file=${cg_outfile/mcg/cgdiff} - tfile_out="$run_dir/$tfilename.o" - - rm -f "$cg_outfile" "$diff_file" "$tfile_out" - CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -o "$tfile_out" >> log/testrun.log 2>&1 + rm -f "$cg_outfile" "$diff_file" + + o_files=() + + for testTU in $(ls $testCasePath | grep "$testCaseName.*\.cpp"); do + tfile_out="$run_dir/$testTU.o" + rm -f "$tfile_out" + clang++ -c `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions "$testCasePath/$testTU" -o "$tfile_out" >> log/testrun.log 2>&1 + if [[ $? -ne 0 ]]; then + echo "Compilation failed!" + echo "Compile command: clang++ -c `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions $testCasePath/$testTU -o $tfile_out" + return 1 + fi + o_files+=($tfile_out) + done + + tfile_out="$run_dir/$testCaseName.exe" + rm -f "$tfile_out" + CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 if [[ $? -ne 0 ]]; then - echo "Compile command: CAGE_CG_NAME=$cg_outfile clang++ `$mcgconfig --cage --ldflags` ${addFlags} $tfile -o $tfile_out >> log/testrun.log 2>&1" + echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" if [[ ! -f "$cg_outfile" ]]; then - echo "Compilation failed! No call graph generated." + echo "Linking failed! No call graph generated." return 1 fi - echo "Compilation failed but call graph was generated." + echo "Linking failed but call graph was generated." + fi + + if [[ $regenerate_gt -eq 1 ]]; then + echo "Using $cg_outfile as new ground truth" + cp "$cg_outfile" "$cg_gtfile" + return 0 fi "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -o "$diff_file" -- >>log/testrun.log 2>&1 @@ -48,73 +69,80 @@ function runSingleTUTest { if [[ $fail -ne 0 ]]; then echo "Test failed! See $diff_file for diff." + return 1 + fi + + return 0 +} + +function runSingleFileTests { + suiteName=$1 + suitePath=$2 + addFlags=$3 + regenerateGt=$4 + + if [[ ! $suiteName =~ $suite_pattern ]]; then + echo "Skipping test suite '$suiteName'..." + return 0 fi - return $fail + echo " --- Running single file tests: $suiteName ---" + testGlob="$suitePath/*.cpp" + fails=0 + for tc in ${testGlob}; do + echo "Running test ${tc}" + tname=$(basename $tc) + tname=${tname%.*} + runTestCase $tname "$suitePath" "" $regenerateGt + fail=$? + fails=$((fails + fail)) + done + echo "Failures in single file test suite '$suiteName': $fails" + return $fails } -#function applyFileFormatTwoToMultiTU { -# fail=0 -# tc=$1 -# taFile=${tc}_a.cpp -# tbFile=${tc}_b.cpp -# -# # Result files -# ipcgTaFile="${taFile/cpp/ipcg}" -# ipcgTbFile="${tbFile/cpp/ipcg}" -# -# # Groundtruth files -# gtaFile="${taFile/cpp/gtmcg}" -# gtbFile="${tbFile/cpp/gtmcg}" -# gtCombFile="${tc}_combined.gtmcg" -# -# # Translation-unit-local -# # TODO: Ground truths currently only include numStatements metadata. Tests for old cgcollector also have fileProperties. -# # What should be the general MD set tested here? -# # -# $cgcollectorExe --NumStatements --OverrideMD --whole-program ./input/multiTU/$taFile -- >>log/testrun.log 2>&1 -# $cgcollectorExe --NumStatements --OverrideMD --whole-program ./input/multiTU/$tbFile -- >>log/testrun.log 2>&1 -# -# cat ./input/multiTU/${ipcgTaFile} | python3 -m json.tool >./input/multiTU/${ipcgTaFile}_ -# mv ./input/multiTU/${ipcgTaFile}_ ./input/multiTU/${ipcgTaFile} -# cat ./input/multiTU/${ipcgTbFile} | python3 -m json.tool >./input/multiTU/${ipcgTbFile}_ -# mv ./input/multiTU/${ipcgTbFile}_ ./input/multiTU/${ipcgTbFile} -# -# $testerExe ./input/multiTU/${ipcgTaFile} ./input/multiTU/${gtaFile} >>log/testrun.log 2>&1 -# aErr=$? -# $testerExe ./input/multiTU/${ipcgTbFile} ./input/multiTU/${gtbFile} >>log/testrun.log 2>&1 -# bErr=$? -# -# combFile=${tc}_combined.ipcg -# echo "null" >./input/multiTU/${combFile} -# -# ${cgmergeExe} ./input/multiTU/${combFile} ./input/multiTU/${ipcgTaFile} ./input/multiTU/${ipcgTbFile} >>log/testrun.log 2>&1 -# mErr=$? -# -# cat ./input/multiTU/${combFile} | python3 -m json.tool >./input/multiTU/${combFile}_ -# mv ./input/multiTU/${combFile}_ ./input/multiTU/${combFile} -# -# ${testerExe} ./input/multiTU/${combFile} ./input/multiTU/${gtCombFile} >>log/testrun.log 2>&1 -# cErr=$? -# -# echo "$aErr or $bErr or $mErr or $cErr" -# -# if [[ ${aErr} -ne 0 || ${bErr} -ne 0 || ${mErr} -ne 0 || ${cErr} -ne 0 ]]; then -# echo "Failure for file: $combFile. Keeping generated file for inspection" -# fail=$((fail + 1)) -# else -# #echo "Success for file: $combFile. Deleting generated file" -# rm ./input/multiTU/$combFile ./input/multiTU/${ipcgTaFile} ./input/multiTU/${ipcgTbFile} -# fi -# return $fail -#} - -while getopts ":h" opt; do +function runMultiFileTests { + suiteName=$1 + suitePath=$2 + addFlags=$3 + regenerateGt=$4 + + if [[ ! $suiteName =~ $suite_pattern ]]; then + echo "Skipping test suite '$suiteName'..." + return 0 + fi + + echo -e "\n --- Running multi file tests: $suiteName ---" + multiTests="" + for f in $suitePath/*.cpp; do + ff=$(basename $f) + ff="${ff%%_*}" + multiTests="$multiTests\n$ff" + done + echo $multiTests + fails=0 + for tc in $(echo -e $multiTests | uniq); do + echo "Running test ${tc}" + runTestCase "$tc" "$suitePath" "" $regenerateGt + fail=$? + fails=$((fails + fail)) + done + echo "Failures in multi file test suite '$suiteName': $fails" + return $fails +} + +while getopts ":hrs:" opt; do case $opt in h) echo "use -h to print this help" exit 0 ;; + r) + regenerate_gt=1 + ;; + s) + suite_pattern=$OPTARG + ;; \?) echo "Invalid option -$OPTARG" exit 1 @@ -122,43 +150,34 @@ while getopts ":h" opt; do esac done -#type -P $testerExe > /dev/null 2>&1 -#if [[ $? -eq 1 ]]; then -# echo "The CGSimpleTester2 binary (cgsimpletester2) could not be found in path, testing with relative path." -# stat ${PWD}/../../../${build_dir}/tools/cgcollector2/test/cgsimpletester2 >> log/testrun.log 2>&1 -# if [ $? -eq 1 ]; then -# echo "The file cgsimpletester2 seems also non-present in ../../../${build_dir}/tools/cgcollector2/test. Aborting test. Failure! Please build the tester first." -# exit 1 -# else -# testerExe=${PWD}/../../../${build_dir}/tools/cgcollector2/test/cgsimpletester2 -# fi -#fi - - -type -P $cgmerge > /dev/null 2>&1 -if [[ $? -eq 1 ]]; then - echo "No cgmerge2 in directory $(dirname $cgmerge)" - exit 1 +if [[ $regenerate_gt -eq 1 ]]; then + echo "Warning: you have chosen to regenerate the groundtruth files." + + read -p "Do you wish to continue? [yN]" yn + case $yn in + [Yy]* ) ;; + * ) echo "Aborting."; exit 1;; + esac fi -echo " --- Running single file tests ---" -echo " --- Running basic tests ---" -testGlob="$test_src_dir/input/singleTU/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - runSingleTUTest ${tc} "" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" +total_fails=0 -exit 0 +runSingleFileTests "basic" "$test_src_dir/input/singleTU" "" $regenerate_gt +fails=$? +total_fails=$((total_fails + fails)) +runSingleFileTests "virtualCalls" "$test_src_dir/input/virtualCalls" "" $regenerate_gt +fails=$? +total_fails=$((total_fails + fails)) -# Multi-file tests -multiTests=(0042 0043 0044 0050 0053 0060) +runMultiFileTests "basicMulti" "$test_src_dir/input/multiTU" "" $regenerate_gt +fails=$? +total_fails=$((total_fails + fails)) + +echo -e "---" +echo -e "\n$total_fails test failures occurred" +exit $total_fails -fails=0 echo " --- Running single file tests [file format version 2.0]---" echo " --- Running basic tests ---" @@ -221,16 +240,7 @@ done echo "Single file test failures: $fails" -# Single File virtualCalls -echo -e "\n --- Running single file virtualCalls tests ---" -testGlob="./input/virtualCalls/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - applyFileFormatTwoToSingleTU ${tc} "--whole-program --capture-ctors-dtors --NumStatements --OverrideMD" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" + # Multi File From 4f08a4669d6a669d66af52a9623b323e786b1e46 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 17:31:38 +0100 Subject: [PATCH 07/25] Adjust cage cxxflags --- utils/config/MCGConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index 8042a6cd..5088748c 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -62,13 +62,13 @@ int main(int argc, char** argv) { if (result.contains("cflags")) { if (useCaGe) { - std::cout << " -flto -fuse-ld=lld "; + std::cout << " -flto "; } } if (result.contains("cxxflags")) { if (useCaGe) { - std::cout << " -flto -fuse-ld=lld "; + std::cout << " -flto "; } } From f797adb7632a71968d8c1f59b6732bcc5af8b093 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 17:44:11 +0100 Subject: [PATCH 08/25] Fix cage test cmake formatting --- tools/CMakeLists.txt | 2 +- tools/cage/src/CMakeLists.txt | 3 +-- tools/cage/test/CMakeLists.txt | 9 +++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index cf75684d..42032916 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -#add_subdirectory(cgcollector2) +add_subdirectory(cgcollector2) add_subdirectory(cgmerge2) add_subdirectory(cgconvert) add_subdirectory(cgformat) diff --git a/tools/cage/src/CMakeLists.txt b/tools/cage/src/CMakeLists.txt index 39f30ba2..f9873c3a 100644 --- a/tools/cage/src/CMakeLists.txt +++ b/tools/cage/src/CMakeLists.txt @@ -1,8 +1,7 @@ include(AddLLVM) -#add_library(cage-plugin MODULE Plugin.cpp) + add_llvm_pass_plugin(cage-plugin Plugin.cpp) target_include_directories(cage-plugin PRIVATE $) -#target_include_directories(cage-plugin PRIVATE $) target_link_libraries(cage-plugin PRIVATE cage) add_subdirectory(generator) diff --git a/tools/cage/test/CMakeLists.txt b/tools/cage/test/CMakeLists.txt index 2baadeb6..2efe0a4e 100644 --- a/tools/cage/test/CMakeLists.txt +++ b/tools/cage/test/CMakeLists.txt @@ -1,7 +1,8 @@ set(METACG_CONFIG "${CMAKE_BINARY_DIR}/utils/config/metacg-config") set(TEST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - -configure_file(runCaGeTests.sh.in - ${CMAKE_CURRENT_BINARY_DIR}/runCaGeTests.sh - @ONLY) \ No newline at end of file +configure_file( + runCaGeTests.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/runCaGeTests.sh + @ONLY +) From 8fe601b7e1ad3ca033433ce3e19c3ed7e827811d Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 18:10:51 +0100 Subject: [PATCH 09/25] Fix metacg-config --- utils/config/MCGConfig.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index 5088748c..fb5d7b40 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -9,6 +9,11 @@ #include "cxxopts.hpp" +// Setting default to prevent build errors when graph tools are not available. +#ifndef CAGE_PLUGIN +#define CAGE_PLUGIN +#endif + int main(int argc, char** argv) { cxxopts::Options options("metacg-config", "MetaCG configuration tool"); options.add_options("commands")("v,version", "Prints the version of this MetaCG installation")( From ac511fcab6676115b68d25acedf29b208b76d277 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 18:11:09 +0100 Subject: [PATCH 10/25] Add CaGe tests to CI --- .github/workflows/mcg-ci.yml | 7 +++++++ .gitlab-ci.yml | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/mcg-ci.yml b/.github/workflows/mcg-ci.yml index 15014527..00b27900 100644 --- a/.github/workflows/mcg-ci.yml +++ b/.github/workflows/mcg-ci.yml @@ -124,6 +124,13 @@ jobs: run: | cd /opt/metacg/tools/cgcollector2/test bash testBase.sh + - name: Run CaGe tests + uses: addnab/docker-run-action@v3 + with: + image: metacg-devel:latest + run: | + cd /opt/metacg/build/tools/cage/test + ./runCaGeTests.sh - name: Run cgvalidate tests uses: addnab/docker-run-action@v3 with: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23ad546e..9f051a71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -270,6 +270,15 @@ test-cgcollector2: - cd tools/cgcollector2/test/ - ./testBase.sh -b $MCG_BUILD +test-cage: + <<: *job-setup + stage: integration-test + needs: ["build-mcg"] + script: + - module load clang/$LLVM + - cd $MCG_BUILD/tools/cage/test + - ./runCaGeTests.sh + test-basic-pgis: <<: *job-setup stage: integration-test From 2710e6469253e0f77da92bc9f54730ffeffb9be9 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Wed, 17 Dec 2025 18:14:52 +0100 Subject: [PATCH 11/25] fixup! Fix metacg-config --- utils/config/MCGConfig.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index fb5d7b40..dbd96f07 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -78,9 +78,11 @@ int main(int argc, char** argv) { } if (result.contains("ldflags")) { +#ifdef HAVE_GRAPH_TOOLS if (useCaGe) { std::cout << " -flto -fuse-ld=lld -Wl,--load-pass-plugin=" << CAGE_PLUGIN << " "; } +#endif } return EXIT_SUCCESS; From 567fbc2a57fc38b16b3eedc5a5e6a3502bc11305 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 10:07:06 +0100 Subject: [PATCH 12/25] Clean up cage test script and add -g for tests --- tools/cage/test/runCaGeTests.sh.in | 88 ++---------------------------- 1 file changed, 4 insertions(+), 84 deletions(-) diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index 33bd9188..ed4484e1 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -37,10 +37,10 @@ function runTestCase { for testTU in $(ls $testCasePath | grep "$testCaseName.*\.cpp"); do tfile_out="$run_dir/$testTU.o" rm -f "$tfile_out" - clang++ -c `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions "$testCasePath/$testTU" -o "$tfile_out" >> log/testrun.log 2>&1 + clang++ -c -g `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions "$testCasePath/$testTU" -o "$tfile_out" >> log/testrun.log 2>&1 if [[ $? -ne 0 ]]; then echo "Compilation failed!" - echo "Compile command: clang++ -c `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions $testCasePath/$testTU -o $tfile_out" + echo "Compile command: clang++ -c -g `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions $testCasePath/$testTU -o $tfile_out" return 1 fi o_files+=($tfile_out) @@ -48,9 +48,9 @@ function runTestCase { tfile_out="$run_dir/$testCaseName.exe" rm -f "$tfile_out" - CAGE_CG_NAME="$cg_outfile" clang++ `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 + CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 if [[ $? -ne 0 ]]; then - echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" + echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" if [[ ! -f "$cg_outfile" ]]; then echo "Linking failed! No call graph generated." return 1 @@ -177,83 +177,3 @@ total_fails=$((total_fails + fails)) echo -e "---" echo -e "\n$total_fails test failures occurred" exit $total_fails - - -echo " --- Running single file tests [file format version 2.0]---" -echo " --- Running basic tests ---" -testGlob="./input/singleTU/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" - -# Single File and full Ctor/Dtor coverage -echo -e "\n --- Running single file full ctor/dtor tests ---" -testGlob="./input/allCtorDtor/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - #we need to capture implicits here, as some calls are to implicit constructors/destructors - applyFileFormatTwoToSingleTU ${tc} "--capture-ctors-dtors --capture-new-delete-calls --capture-implicits --infer-ctors-dtors --whole-program --prune --NumStatements" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" - -# Single File and for CXXRecordCalls -echo -e "\n --- Running single file CXXRecord call tests ---" -testGlob="./input/cxxRecordCalls/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - #we need to capture implicits here, as some calls are to implicit constructors/destructors - applyFileFormatTwoToSingleTU ${tc} "--capture-ctors-dtors --capture-new-delete-calls --capture-implicits --infer-ctors-dtors --whole-program --prune --NumStatements" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" - - -# Single File and functionPointers -echo -e "\n --- Running single file functionPointers tests ---" -testGlob="./input/functionPointers/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" - fail=$? - fails=$((fails + fail)) -done -echo "Single file test failures: $fails" - - - -# Single File metaCollectors -echo -e "\n --- Running single file metaCollectors tests ---" -testGlob="./input/metaCollectors/numStatements/*.cpp" -for tc in ${testGlob}; do - echo "Running test ${tc}" - applyFileFormatTwoToSingleTU ${tc} "--whole-program --NumStatements" - fail=$? - fails=$((fails + fail)) -done - -echo "Single file test failures: $fails" - - - - -# Multi File -fails=0 -echo -e "\n --- Running multi file tests ---" -for tc in "${multiTests[@]}"; do - echo "Running test ${tc}" - # Input files - applyFileFormatTwoToMultiTU ${tc} "" - fail=$? - fails=$((fails + fail)) -done -echo "Multi file test failures: $fails" - -echo -e "$fails failures occured when running tests" -exit $fails From 8f26041a6f13610b4ca709814b3a98adc06add1f Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 11:35:24 +0100 Subject: [PATCH 13/25] Add verbosity option to cage test runner --- tools/cage/test/runCaGeTests.sh.in | 48 ++++++++++++++++++------------ 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index ed4484e1..b915390c 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -7,6 +7,7 @@ cgdiff="$build_dir/tools/cgdiff/cgdiff" cgmerge="$build_dir/tools/cgmerge2/cgmerge2" suite_pattern=".*" +verbose=0 mkdir -p log @@ -35,34 +36,40 @@ function runTestCase { o_files=() for testTU in $(ls $testCasePath | grep "$testCaseName.*\.cpp"); do + failed=0 tfile_out="$run_dir/$testTU.o" rm -f "$tfile_out" - clang++ -c -g `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions "$testCasePath/$testTU" -o "$tfile_out" >> log/testrun.log 2>&1 - if [[ $? -ne 0 ]]; then - echo "Compilation failed!" + clang++ -c -g `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions "$testCasePath/$testTU" -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 + if [[ $failed -ne 0 ]] || [[ $verbose -eq 1 ]]; then echo "Compile command: clang++ -c -g `$mcgconfig --cage --cxxflags` ${addFlags} -fno-exceptions $testCasePath/$testTU -o $tfile_out" + fi + if [[ $failed -ne 0 ]]; then + echo "Compilation failed!" return 1 fi o_files+=($tfile_out) done + failed=0 tfile_out="$run_dir/$testCaseName.exe" rm -f "$tfile_out" - CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 - if [[ $? -ne 0 ]]; then - echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" - if [[ ! -f "$cg_outfile" ]]; then - echo "Linking failed! No call graph generated." - return 1 - fi - echo "Linking failed but call graph was generated." - fi - - if [[ $regenerate_gt -eq 1 ]]; then - echo "Using $cg_outfile as new ground truth" - cp "$cg_outfile" "$cg_gtfile" - return 0 - fi + CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 + if [[ $failed -ne 0 ]] || [[ $verbose -eq 1 ]]; then + echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" + fi + if [[ $failed -ne 0 ]]; then + if [[ ! -f "$cg_outfile" ]]; then + echo "Linking failed! No call graph generated." + return 1 + fi + echo "Linking failed but call graph was generated." + fi + + if [[ $regenerate_gt -eq 1 ]]; then + echo "Using $cg_outfile as new ground truth" + cp "$cg_outfile" "$cg_gtfile" + return 0 + fi "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -o "$diff_file" -- >>log/testrun.log 2>&1 fail=$? @@ -131,12 +138,15 @@ function runMultiFileTests { return $fails } -while getopts ":hrs:" opt; do +while getopts ":hvrs:" opt; do case $opt in h) echo "use -h to print this help" exit 0 ;; + v) + verbose=1 + ;; r) regenerate_gt=1 ;; From 8fae42ad91249bda9b8dd940063735ee5167fe12 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 11:37:39 +0100 Subject: [PATCH 14/25] Fix empty linkage name bug --- graph/src/Callgraph.cpp | 1 + tools/cage/src/generator/CallGraphGenerator.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/graph/src/Callgraph.cpp b/graph/src/Callgraph.cpp index 0cd10ed8..8dcd4ee1 100644 --- a/graph/src/Callgraph.cpp +++ b/graph/src/Callgraph.cpp @@ -42,6 +42,7 @@ CgNode* Callgraph::getMain(bool forceRecompute) const { CgNode& Callgraph::insert(const std::string& function, std::optional origin, bool isVirtual, bool hasBody) { + assert(!function.empty() && "Function name must not be empty"); NodeId id = nodes.size(); // Note: Can't use make_unique here because make_unqiue is not (and should not be) a friend of the CgNode constructor. nodes.emplace_back(new CgNode(id, function, std::move(origin), isVirtual, hasBody)); diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 61f1af24..ad75baed 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -53,8 +53,6 @@ struct CallBaseVisitor : public llvm::InstVisitor { } ~CallBaseVisitor() { - - errs() << "CBV destroyed\n"; } void visitCallBase(llvm::CallBase& I) { @@ -73,10 +71,17 @@ struct CallBaseVisitor : public llvm::InstVisitor { // Was function pointer, where we can not get the called function const auto& possibleFuncs = signatureFunctionMap[I.getFunctionType()]; for (const auto& func : possibleFuncs) { - metacg::CgNode& childNode = (metaDataAvail && functionInfoMap[func] != nullptr - ? mcg->getOrInsertNode(functionInfoMap[func]->getLinkageName().str(), - functionInfoMap[func]->getFilename().str()) - : mcg->getOrInsertNode(func->getName().str())); + StringRef nameToUse = func->getName(); + std::optional origin{}; + if (metaDataAvail && functionInfoMap[func] != nullptr) { + auto linkageName = functionInfoMap[func]->getLinkageName(); + if (!linkageName.empty()) { + nameToUse = linkageName; + } + origin = functionInfoMap[func]->getFilename().str(); + } + metacg::CgNode& childNode = mcg->getOrInsertNode(nameToUse.str(), + std::move(origin)); mcg->addEdge(currentNode, childNode); } } From 3ea516e480f6fb78e2a48908795ff662b029bcb1 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 13:25:44 +0100 Subject: [PATCH 15/25] [CaGe] Add option for handling indirect calls --- .../cage/generator/CallgraphGenerator.h | 5 +- tools/cage/src/Plugin.cpp | 15 ++++- .../cage/src/generator/CallGraphGenerator.cpp | 60 +++++++++++-------- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/tools/cage/include/cage/generator/CallgraphGenerator.h b/tools/cage/include/cage/generator/CallgraphGenerator.h index b1dd01c3..46ace384 100644 --- a/tools/cage/include/cage/generator/CallgraphGenerator.h +++ b/tools/cage/include/cage/generator/CallgraphGenerator.h @@ -12,15 +12,18 @@ namespace cage { +enum PTAType { No, All }; + class Generator { public: - Generator() = default; + Generator(PTAType ptaType) : ptaType(ptaType) {}; void addConsumer(std::unique_ptr consumer) { consumers.push_back(std::move(consumer)); } bool run(llvm::Module& M, llvm::ModuleAnalysisManager* MA); private: + PTAType ptaType; std::vector> consumers; }; diff --git a/tools/cage/src/Plugin.cpp b/tools/cage/src/Plugin.cpp index 1cfd032a..22f8cbff 100644 --- a/tools/cage/src/Plugin.cpp +++ b/tools/cage/src/Plugin.cpp @@ -14,9 +14,22 @@ using namespace llvm; +using namespace llvm::cl; + +static OptionCategory cageOpts("CaGe"); + +static opt pta( + "", desc("Points-to analysis of indirect calls:"), + values(clEnumVal(cage::PTAType::No, "Ignore indirect calls"), + clEnumVal( + cage::PTAType::All, + "Treat all available valid function signatures for a given function pointer as potential call target ")), + cat(cageOpts), init(cage::PTAType::No)); + + namespace cage { PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { - Generator gen; + Generator gen(pta); gen.addConsumer(std::make_unique()); if (!gen.run(M, &MA)) diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index ad75baed..5a63b232 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -29,7 +29,7 @@ using namespace llvm; namespace cage { struct CallBaseVisitor : public llvm::InstVisitor { - CallBaseVisitor(llvm::CallGraph* lcg) : lcg(lcg), mcg(std::make_unique()) { + CallBaseVisitor(llvm::CallGraph* lcg, PTAType pta) : lcg(lcg), pta(pta), mcg(std::make_unique()) { const Module& m = lcg->getModule(); llvm::DebugInfoFinder dbg_finder{}; dbg_finder.processModule(m); @@ -47,14 +47,19 @@ struct CallBaseVisitor : public llvm::InstVisitor { } } - for (const auto& func : m.getFunctionList()) { - signatureFunctionMap[func.getFunctionType()].push_back(&func.getFunction()); + // Only build signature map if required for PTA + if (pta == All) { + for (const auto& func : m.getFunctionList()) { + signatureFunctionMap[func.getFunctionType()].push_back(&func.getFunction()); + } } } ~CallBaseVisitor() { } + + void visitCallBase(llvm::CallBase& I) { if (I.getCalledFunction() != nullptr && I.getCalledFunction()->isIntrinsic()) return; @@ -69,20 +74,13 @@ struct CallBaseVisitor : public llvm::InstVisitor { if (I.getCalledFunction() == nullptr) { // Was function pointer, where we can not get the called function - const auto& possibleFuncs = signatureFunctionMap[I.getFunctionType()]; - for (const auto& func : possibleFuncs) { - StringRef nameToUse = func->getName(); - std::optional origin{}; - if (metaDataAvail && functionInfoMap[func] != nullptr) { - auto linkageName = functionInfoMap[func]->getLinkageName(); - if (!linkageName.empty()) { - nameToUse = linkageName; - } - origin = functionInfoMap[func]->getFilename().str(); + if (pta == PTAType::All) { + const auto& possibleFuncs = signatureFunctionMap[I.getFunctionType()]; + for (const auto& func : possibleFuncs) { + assert(func); + auto& childNode = getOrInsertNode(func); + mcg->addEdge(currentNode, childNode); } - metacg::CgNode& childNode = mcg->getOrInsertNode(nameToUse.str(), - std::move(origin)); - mcg->addEdge(currentNode, childNode); } } } @@ -91,13 +89,11 @@ struct CallBaseVisitor : public llvm::InstVisitor { if (F.isIntrinsic()) return; llvm::outs() << "Processing function " << F.getName() << "\n"; - const std::string& funcName = F.getName().str(); - metacg::CgNode& currentNode = (metaDataAvail && functionInfoMap[&F] != nullptr - ? mcg->getOrInsertNode(funcName, functionInfoMap[&F]->getFilename().str()) - : mcg->getOrInsertNode(funcName)); + + auto& currentNode = getOrInsertNode(&F); auto* lcgNode = lcg->operator[](&F); - for (auto [key, elem] : *lcgNode) { + for (auto& [key, elem] : *lcgNode) { if (!key.has_value()) continue; if (elem->getFunction() == nullptr) @@ -106,10 +102,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { continue; const Function* childFunc = elem->getFunction(); assert(childFunc->hasName()); - metacg::CgNode& childNode = - (metaDataAvail && functionInfoMap[childFunc] != nullptr - ? mcg->getOrInsertNode(childFunc->getName().str(), functionInfoMap[childFunc]->getFilename().str()) - : mcg->getOrInsertNode(childFunc->getName().str())); + metacg::CgNode& childNode = getOrInsertNode(childFunc); mcg->addEdge(currentNode, childNode); } } @@ -139,8 +132,23 @@ struct CallBaseVisitor : public llvm::InstVisitor { #endif } + metacg::CgNode& getOrInsertNode(const llvm::Function* F) { + StringRef nameToUse = F->getName(); + std::optional origin{}; + if (metaDataAvail && functionInfoMap[F] != nullptr) { + auto linkageName = functionInfoMap[F]->getLinkageName(); + if (!linkageName.empty()) { + nameToUse = linkageName; + } + origin = functionInfoMap[F]->getFilename().str(); + } + return mcg->getOrInsertNode(nameToUse.str(), + std::move(origin)); + } + std::unique_ptr mcg; llvm::CallGraph* lcg; + PTAType pta; bool metaDataAvail = false; std::unordered_map functionInfoMap; std::unordered_map> signatureFunctionMap; @@ -149,7 +157,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { bool Generator::run(Module& M, ModuleAnalysisManager* MA) { { auto& cgResult = MA->getResult(M); - auto cbv = CallBaseVisitor(&cgResult); + auto cbv = CallBaseVisitor(&cgResult, ptaType); cbv.visit(M); // Take resulting metacg call graph From 0fdd40726357128df4f8ffbe21b51b4b7e80875b Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 15:25:51 +0100 Subject: [PATCH 16/25] [CaGe] Add PTA pass options --- .../include/cage/generator/CallgraphGenerator.h | 2 +- tools/cage/src/Plugin.cpp | 16 ++++++++++++---- tools/cage/src/generator/CallGraphGenerator.cpp | 4 ++-- utils/config/MCGConfig.cpp | 16 +++++++++++++--- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/tools/cage/include/cage/generator/CallgraphGenerator.h b/tools/cage/include/cage/generator/CallgraphGenerator.h index 46ace384..69755372 100644 --- a/tools/cage/include/cage/generator/CallgraphGenerator.h +++ b/tools/cage/include/cage/generator/CallgraphGenerator.h @@ -12,7 +12,7 @@ namespace cage { -enum PTAType { No, All }; +enum PTAType { No, BySignature }; class Generator { public: diff --git a/tools/cage/src/Plugin.cpp b/tools/cage/src/Plugin.cpp index 22f8cbff..7e6c98eb 100644 --- a/tools/cage/src/Plugin.cpp +++ b/tools/cage/src/Plugin.cpp @@ -18,17 +18,24 @@ using namespace llvm::cl; static OptionCategory cageOpts("CaGe"); +static cl::opt cageVerbose("cage-verbose", cl::desc("Print debugging output"), cl::init(false)); + static opt pta( - "", desc("Points-to analysis of indirect calls:"), - values(clEnumVal(cage::PTAType::No, "Ignore indirect calls"), - clEnumVal( - cage::PTAType::All, + "pta", desc("Points-to analysis of indirect calls:"), + values(clEnumValN(cage::PTAType::No, "no", "Ignore indirect calls"), + clEnumValN( + cage::PTAType::BySignature, "signature", "Treat all available valid function signatures for a given function pointer as potential call target ")), cat(cageOpts), init(cage::PTAType::No)); namespace cage { PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { + + if (cageVerbose) { + outs() << "Running in verbose mode\n"; + } + Generator gen(pta); gen.addConsumer(std::make_unique()); @@ -72,6 +79,7 @@ llvm::PassPluginLibraryInfo getPluginInfo() { }}; } + extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo llvmGetPassPluginInfo() { #ifndef NDEBUG outs() << "Loading debug version of CaGe-Plugin\n"; diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 5a63b232..8da39db1 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -48,7 +48,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { } // Only build signature map if required for PTA - if (pta == All) { + if (pta == BySignature) { for (const auto& func : m.getFunctionList()) { signatureFunctionMap[func.getFunctionType()].push_back(&func.getFunction()); } @@ -74,7 +74,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { if (I.getCalledFunction() == nullptr) { // Was function pointer, where we can not get the called function - if (pta == PTAType::All) { + if (pta == PTAType::BySignature) { const auto& possibleFuncs = signatureFunctionMap[I.getFunctionType()]; for (const auto& func : possibleFuncs) { assert(func); diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index dbd96f07..7e49717d 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -16,13 +16,14 @@ int main(int argc, char** argv) { cxxopts::Options options("metacg-config", "MetaCG configuration tool"); - options.add_options("commands")("v,version", "Prints the version of this MetaCG installation")( + options.add_options("commands")("v,version", "Prints the version of this MetaCG installation.")( "revision", "Prints the revision hash of this MetaCG installation")( "prefix", "Prints the installation prefix of this MetaCG installation.")( "ldflags", "Prints the necessary ld flags.")( "cflags", "Prints the necessary C compile flags.")( "cxxflags", "Prints the necessary C++ compile flags.")( - "cage", "Enables the CaGe LTO plugin (requires graph tools)")( + "cage", "Enables the CaGe LTO plugin (requires graph tools).")( + "pass-option", "Sets a pass option", cxxopts::value>())( "h,help", "Print help"); const cxxopts::ParseResult result = options.parse(argc, argv); @@ -65,6 +66,15 @@ int main(int argc, char** argv) { return EXIT_SUCCESS; } + std::stringstream passOptsStream; + if (result.count("pass-option")) { + const auto& passOpts = result["pass-option"].as>(); + for (auto& opt : passOpts) { + passOptsStream << " -Wl,-mllvm=" << opt << " "; + } + } + std::string processedPassOpts = passOptsStream.str(); + if (result.contains("cflags")) { if (useCaGe) { std::cout << " -flto "; @@ -80,7 +90,7 @@ int main(int argc, char** argv) { if (result.contains("ldflags")) { #ifdef HAVE_GRAPH_TOOLS if (useCaGe) { - std::cout << " -flto -fuse-ld=lld -Wl,--load-pass-plugin=" << CAGE_PLUGIN << " "; + std::cout << " -flto -fuse-ld=lld -Wl,-mllvm=-load=" << CAGE_PLUGIN << " -Wl,--load-pass-plugin=" << CAGE_PLUGIN << processedPassOpts << " "; } #endif } From 6d1776a1375a13cf22b91b5863e467d824761583 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 15:27:06 +0100 Subject: [PATCH 17/25] [CaGe] Add test variants for different PTA modes and fix tests --- tools/cage/test/input/multiTU/0050.gtmcg | 1 - tools/cage/test/input/multiTU/0053.gtmcg | 9 ++- tools/cage/test/input/singleTU/0001.gtmcg | 2 +- .../input/singleTU/0001.pta-signature.gtmcg | 22 +++++++ tools/cage/test/input/singleTU/0002.gtmcg | 4 +- .../input/singleTU/0002.pta-signature.gtmcg | 31 +++++++++ tools/cage/test/input/singleTU/0003.gtmcg | 6 +- .../input/singleTU/0003.pta-signature.gtmcg | 40 +++++++++++ tools/cage/test/input/singleTU/0004.gtmcg | 4 +- .../input/singleTU/0004.pta-signature.gtmcg | 29 ++++++++ tools/cage/test/input/singleTU/0005.gtmcg | 6 +- .../input/singleTU/0005.pta-signature.gtmcg | 39 +++++++++++ tools/cage/test/input/singleTU/0013.gtmcg | 8 +-- .../input/singleTU/0013.pta-signature.gtmcg | 49 ++++++++++++++ tools/cage/test/input/singleTU/0014.gtmcg | 8 +-- .../input/singleTU/0014.pta-signature.gtmcg | 50 ++++++++++++++ tools/cage/test/input/singleTU/0065.gtmcg | 12 ++-- .../input/singleTU/0065.pta-signature.gtmcg | 47 +++++++++++++ tools/cage/test/input/singleTU/0066.gtmcg | 4 +- .../input/singleTU/0066.pta-signature.gtmcg | 31 +++++++++ tools/cage/test/input/singleTU/0230.gtmcg | 7 +- .../input/singleTU/0230.pta-signature.gtmcg | 39 +++++++++++ tools/cage/test/input/singleTU/0232.gtmcg | 12 ++-- .../input/singleTU/0232.pta-signature.gtmcg | 64 ++++++++++++++++++ tools/cage/test/input/singleTU/0233.gtmcg | 2 +- .../input/singleTU/0233.pta-signature.gtmcg | 31 +++++++++ tools/cage/test/input/singleTU/0234.gtmcg | 12 ++-- .../input/singleTU/0234.pta-signature.gtmcg | 56 ++++++++++++++++ tools/cage/test/input/singleTU/0235.cpp | 3 + tools/cage/test/input/singleTU/0235.gtmcg | 14 ++-- .../input/singleTU/0235.pta-signature.gtmcg | 47 +++++++++++++ tools/cage/test/input/singleTU/0237.gtmcg | 18 ++--- .../input/singleTU/0237.pta-signature.gtmcg | 66 +++++++++++++++++++ tools/cage/test/input/virtualCalls/0019.gtmcg | 3 +- tools/cage/test/input/virtualCalls/0021.gtmcg | 1 - tools/cage/test/runCaGeTests.sh.in | 56 ++++++++++------ 36 files changed, 747 insertions(+), 86 deletions(-) create mode 100644 tools/cage/test/input/singleTU/0001.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0002.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0003.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0004.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0005.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0013.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0014.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0065.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0066.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0230.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0232.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0233.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0234.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0235.pta-signature.gtmcg create mode 100644 tools/cage/test/input/singleTU/0237.pta-signature.gtmcg diff --git a/tools/cage/test/input/multiTU/0050.gtmcg b/tools/cage/test/input/multiTU/0050.gtmcg index 8a760ef7..552556b0 100644 --- a/tools/cage/test/input/multiTU/0050.gtmcg +++ b/tools/cage/test/input/multiTU/0050.gtmcg @@ -42,7 +42,6 @@ "main": { "callees": { "_ZN4Base3fooEv": {}, - "_ZN4BaseC2Ev": {}, "_ZN6Derive3fooEv": {}, "_ZN6DeriveC2Ev": {}, "_Znwm": {} diff --git a/tools/cage/test/input/multiTU/0053.gtmcg b/tools/cage/test/input/multiTU/0053.gtmcg index 7f2e7226..1aa82c16 100644 --- a/tools/cage/test/input/multiTU/0053.gtmcg +++ b/tools/cage/test/input/multiTU/0053.gtmcg @@ -41,6 +41,13 @@ "meta": {}, "origin": null }, + "_ZN7MyClass3fooEv": { + "callees": {}, + "functionName": "_ZN7MyClass3fooEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/multiTU/0053.h" + }, "_Znwm": { "callees": {}, "functionName": "_Znwm", @@ -57,8 +64,8 @@ }, "main": { "callees": { + "_ZN7MyClass3fooEv": {}, "_ZN13MyClassDerive3fooEv": {}, - "_ZN14MyClassDeriveD3fooEv": {}, "_ZN14MyClassDeriveDC2Ev": {}, "_Znwm": {} }, diff --git a/tools/cage/test/input/singleTU/0001.gtmcg b/tools/cage/test/input/singleTU/0001.gtmcg index 4e3702b9..327f597a 100644 --- a/tools/cage/test/input/singleTU/0001.gtmcg +++ b/tools/cage/test/input/singleTU/0001.gtmcg @@ -7,7 +7,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0001.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg new file mode 100644 index 00000000..d89d3726 --- /dev/null +++ b/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg @@ -0,0 +1,22 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0001.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0002.gtmcg b/tools/cage/test/input/singleTU/0002.gtmcg index 8bc1daad..44977882 100644 --- a/tools/cage/test/input/singleTU/0002.gtmcg +++ b/tools/cage/test/input/singleTU/0002.gtmcg @@ -7,7 +7,7 @@ "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0002.cpp" }, "main": { "callees": { @@ -16,7 +16,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0002.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg new file mode 100644 index 00000000..c83af0d6 --- /dev/null +++ b/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg @@ -0,0 +1,31 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0002.cpp" + }, + "main": { + "callees": { + "_Z3foov": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0002.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0003.gtmcg b/tools/cage/test/input/singleTU/0003.gtmcg index ed6cecfe..e793998b 100644 --- a/tools/cage/test/input/singleTU/0003.gtmcg +++ b/tools/cage/test/input/singleTU/0003.gtmcg @@ -7,7 +7,7 @@ "functionName": "_Z3barv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0003.cpp" }, "_Z3foov": { "callees": { @@ -16,7 +16,7 @@ "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0003.cpp" }, "main": { "callees": { @@ -25,7 +25,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0003.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg new file mode 100644 index 00000000..fb763b2e --- /dev/null +++ b/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg @@ -0,0 +1,40 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3barv": { + "callees": {}, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0003.cpp" + }, + "_Z3foov": { + "callees": { + "_Z3barv": {} + }, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0003.cpp" + }, + "main": { + "callees": { + "_Z3foov": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0003.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0004.gtmcg b/tools/cage/test/input/singleTU/0004.gtmcg index 811b90c0..f25ce672 100644 --- a/tools/cage/test/input/singleTU/0004.gtmcg +++ b/tools/cage/test/input/singleTU/0004.gtmcg @@ -7,14 +7,14 @@ "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0004.cpp" }, "main": { "callees": {}, "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0004.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg new file mode 100644 index 00000000..2f590115 --- /dev/null +++ b/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg @@ -0,0 +1,29 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0004.cpp" + }, + "main": { + "callees": {}, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0004.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0005.gtmcg b/tools/cage/test/input/singleTU/0005.gtmcg index e266deb2..7accf147 100644 --- a/tools/cage/test/input/singleTU/0005.gtmcg +++ b/tools/cage/test/input/singleTU/0005.gtmcg @@ -7,14 +7,14 @@ "functionName": "_Z8childOnev", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0005.cpp" }, "_Z8childTwov": { "callees": {}, "functionName": "_Z8childTwov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0005.cpp" }, "main": { "callees": { @@ -24,7 +24,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0005.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg new file mode 100644 index 00000000..a05fad45 --- /dev/null +++ b/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg @@ -0,0 +1,39 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z8childOnev": { + "callees": {}, + "functionName": "_Z8childOnev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0005.cpp" + }, + "_Z8childTwov": { + "callees": {}, + "functionName": "_Z8childTwov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0005.cpp" + }, + "main": { + "callees": { + "_Z8childOnev": {}, + "_Z8childTwov": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0005.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0013.gtmcg b/tools/cage/test/input/singleTU/0013.gtmcg index 0c4f5847..7670862d 100644 --- a/tools/cage/test/input/singleTU/0013.gtmcg +++ b/tools/cage/test/input/singleTU/0013.gtmcg @@ -9,7 +9,7 @@ "functionName": "_Z6middlev", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0013.cpp" }, "_Z7middle2v": { "callees": { @@ -18,14 +18,14 @@ "functionName": "_Z7middle2v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0013.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0013.cpp" }, "main": { "callees": { @@ -34,7 +34,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0013.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg new file mode 100644 index 00000000..31166cc7 --- /dev/null +++ b/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg @@ -0,0 +1,49 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z6middlev": { + "callees": { + "_Z9lastChildv": {} + }, + "functionName": "_Z6middlev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0013.cpp" + }, + "_Z7middle2v": { + "callees": { + "_Z9lastChildv": {} + }, + "functionName": "_Z7middle2v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0013.cpp" + }, + "_Z9lastChildv": { + "callees": {}, + "functionName": "_Z9lastChildv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0013.cpp" + }, + "main": { + "callees": { + "_Z6middlev": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0013.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0014.gtmcg b/tools/cage/test/input/singleTU/0014.gtmcg index 5d844d49..988b3b71 100644 --- a/tools/cage/test/input/singleTU/0014.gtmcg +++ b/tools/cage/test/input/singleTU/0014.gtmcg @@ -9,7 +9,7 @@ "functionName": "_Z6middlev", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0014.cpp" }, "_Z7middle2v": { "callees": { @@ -18,14 +18,14 @@ "functionName": "_Z7middle2v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0014.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0014.cpp" }, "main": { "callees": { @@ -35,7 +35,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0014.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg new file mode 100644 index 00000000..f01d3cfc --- /dev/null +++ b/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg @@ -0,0 +1,50 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z6middlev": { + "callees": { + "_Z7middle2v": {} + }, + "functionName": "_Z6middlev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0014.cpp" + }, + "_Z7middle2v": { + "callees": { + "_Z9lastChildv": {} + }, + "functionName": "_Z7middle2v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0014.cpp" + }, + "_Z9lastChildv": { + "callees": {}, + "functionName": "_Z9lastChildv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0014.cpp" + }, + "main": { + "callees": { + "_Z6middlev": {}, + "_Z9lastChildv": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0014.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0065.gtmcg b/tools/cage/test/input/singleTU/0065.gtmcg index db78fd4e..097b7fe5 100644 --- a/tools/cage/test/input/singleTU/0065.gtmcg +++ b/tools/cage/test/input/singleTU/0065.gtmcg @@ -7,32 +7,30 @@ "functionName": "_Z12get_func_ptri", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func2v": { "callees": {}, "functionName": "_Z5func2v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "main": { "callees": { - "_Z12get_func_ptri": {}, - "_Z5func1v": {}, - "_Z5func2v": {} + "_Z12get_func_ptri": {} }, "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0065.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg new file mode 100644 index 00000000..c6593868 --- /dev/null +++ b/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg @@ -0,0 +1,47 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z12get_func_ptri": { + "callees": {}, + "functionName": "_Z12get_func_ptri", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0065.cpp" + }, + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0065.cpp" + }, + "_Z5func2v": { + "callees": {}, + "functionName": "_Z5func2v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0065.cpp" + }, + "main": { + "callees": { + "_Z12get_func_ptri": {}, + "_Z5func1v": {}, + "_Z5func2v": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0065.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0066.gtmcg b/tools/cage/test/input/singleTU/0066.gtmcg index 8bc1daad..f3d91b21 100644 --- a/tools/cage/test/input/singleTU/0066.gtmcg +++ b/tools/cage/test/input/singleTU/0066.gtmcg @@ -7,7 +7,7 @@ "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0066.cpp" }, "main": { "callees": { @@ -16,7 +16,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0066.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg new file mode 100644 index 00000000..c55daac2 --- /dev/null +++ b/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg @@ -0,0 +1,31 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0066.cpp" + }, + "main": { + "callees": { + "_Z3foov": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0066.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0230.gtmcg b/tools/cage/test/input/singleTU/0230.gtmcg index c9e064ea..43ead5e0 100644 --- a/tools/cage/test/input/singleTU/0230.gtmcg +++ b/tools/cage/test/input/singleTU/0230.gtmcg @@ -7,24 +7,23 @@ "functionName": "_Z1fv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0230.cpp" }, "_ZN1A14memberFunctionEv": { "callees": {}, "functionName": "_ZN1A14memberFunctionEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0230.cpp" }, "main": { "callees": { - "_Z1fv": {}, "_ZN1A14memberFunctionEv": {} }, "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0230.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg new file mode 100644 index 00000000..62ebc9e6 --- /dev/null +++ b/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg @@ -0,0 +1,39 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z1fv": { + "callees": {}, + "functionName": "_Z1fv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0230.cpp" + }, + "_ZN1A14memberFunctionEv": { + "callees": {}, + "functionName": "_ZN1A14memberFunctionEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0230.cpp" + }, + "main": { + "callees": { + "_Z1fv": {}, + "_ZN1A14memberFunctionEv": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0230.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0232.gtmcg b/tools/cage/test/input/singleTU/0232.gtmcg index 1fca52a5..12157d70 100644 --- a/tools/cage/test/input/singleTU/0232.gtmcg +++ b/tools/cage/test/input/singleTU/0232.gtmcg @@ -7,23 +7,21 @@ "functionName": "_Z5func1v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZN1XD2Ev": { - "callees": { - "_Z5func1v": {} - }, + "callees": {}, "functionName": "_ZN1XD2Ev", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZdlPvm": { "callees": {}, @@ -49,7 +47,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0232.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg new file mode 100644 index 00000000..db453787 --- /dev/null +++ b/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg @@ -0,0 +1,64 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0232.cpp" + }, + "_ZN1XC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1XC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0232.cpp" + }, + "_ZN1XD2Ev": { + "callees": { + "_Z5func1v": {} + }, + "functionName": "_ZN1XD2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0232.cpp" + }, + "_ZdlPvm": { + "callees": {}, + "functionName": "_ZdlPvm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN1XC2EPFvvE": {}, + "_ZN1XD2Ev": {}, + "_ZdlPvm": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0232.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0233.gtmcg b/tools/cage/test/input/singleTU/0233.gtmcg index f6d2a6fb..ed2598b0 100644 --- a/tools/cage/test/input/singleTU/0233.gtmcg +++ b/tools/cage/test/input/singleTU/0233.gtmcg @@ -16,7 +16,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0233.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg new file mode 100644 index 00000000..68384a87 --- /dev/null +++ b/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg @@ -0,0 +1,31 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0233.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0234.gtmcg b/tools/cage/test/input/singleTU/0234.gtmcg index 8df978bd..b4119d65 100644 --- a/tools/cage/test/input/singleTU/0234.gtmcg +++ b/tools/cage/test/input/singleTU/0234.gtmcg @@ -7,23 +7,21 @@ "functionName": "_Z5func1v", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_ZN1XD2Ev": { - "callees": { - "_Z5func1v": {} - }, + "callees": {}, "functionName": "_ZN1XD2Ev", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_Znwm": { "callees": {}, @@ -41,7 +39,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0234.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg new file mode 100644 index 00000000..65c51d30 --- /dev/null +++ b/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg @@ -0,0 +1,56 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z5func1v": { + "callees": {}, + "functionName": "_Z5func1v", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0234.cpp" + }, + "_ZN1XC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1XC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0234.cpp" + }, + "_ZN1XD2Ev": { + "callees": { + "_Z5func1v": {} + }, + "functionName": "_ZN1XD2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0234.cpp" + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN1XC2EPFvvE": {}, + "_ZN1XD2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0234.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0235.cpp b/tools/cage/test/input/singleTU/0235.cpp index f59da652..edfe2495 100644 --- a/tools/cage/test/input/singleTU/0235.cpp +++ b/tools/cage/test/input/singleTU/0235.cpp @@ -4,6 +4,9 @@ typedef void (*Function)(); void foo() {} +__attribute__((retain)) +void bar() {} + class C { public: C(Function F) : member(F) {}; diff --git a/tools/cage/test/input/singleTU/0235.gtmcg b/tools/cage/test/input/singleTU/0235.gtmcg index 84179290..faaca99b 100644 --- a/tools/cage/test/input/singleTU/0235.gtmcg +++ b/tools/cage/test/input/singleTU/0235.gtmcg @@ -2,29 +2,35 @@ "_CG": { "meta": {}, "nodes": { + "_Z3barv": { + "callees": {}, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0235.cpp" + }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "_ZN1CC2EPFvvE": { "callees": {}, "functionName": "_ZN1CC2EPFvvE", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "main": { "callees": { - "_Z3foov": {}, "_ZN1CC2EPFvvE": {} }, "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0235.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg new file mode 100644 index 00000000..d4e1c033 --- /dev/null +++ b/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg @@ -0,0 +1,47 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3barv": { + "callees": {}, + "functionName": "_Z3barv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0235.cpp" + }, + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0235.cpp" + }, + "_ZN1CC2EPFvvE": { + "callees": {}, + "functionName": "_ZN1CC2EPFvvE", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0235.cpp" + }, + "main": { + "callees": { + "_Z3barv": {}, + "_Z3foov": {}, + "_ZN1CC2EPFvvE": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0235.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0237.gtmcg b/tools/cage/test/input/singleTU/0237.gtmcg index 0435e08e..73c3a594 100644 --- a/tools/cage/test/input/singleTU/0237.gtmcg +++ b/tools/cage/test/input/singleTU/0237.gtmcg @@ -7,32 +7,28 @@ "functionName": "_Z3boov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1BC2EPFivE": { "callees": {}, "functionName": "_ZN1BC2EPFivE", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1C4workEv": { - "callees": { - "_Z3boov": {}, - "_Z3foov": {}, - "main": {} - }, + "callees": {}, "functionName": "_ZN1C4workEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1CC2EPFivES1_": { "callees": { @@ -41,7 +37,7 @@ "functionName": "_ZN1CC2EPFivES1_", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "main": { "callees": { @@ -51,7 +47,7 @@ "functionName": "main", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/singleTU/0237.cpp" } } }, diff --git a/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg new file mode 100644 index 00000000..26e4cfa5 --- /dev/null +++ b/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg @@ -0,0 +1,66 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_Z3boov": { + "callees": {}, + "functionName": "_Z3boov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + }, + "_Z3foov": { + "callees": {}, + "functionName": "_Z3foov", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + }, + "_ZN1BC2EPFivE": { + "callees": {}, + "functionName": "_ZN1BC2EPFivE", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + }, + "_ZN1C4workEv": { + "callees": { + "_Z3boov": {}, + "_Z3foov": {}, + "main": {} + }, + "functionName": "_ZN1C4workEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + }, + "_ZN1CC2EPFivES1_": { + "callees": { + "_ZN1BC2EPFivE": {} + }, + "functionName": "_ZN1CC2EPFivES1_", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + }, + "main": { + "callees": { + "_ZN1C4workEv": {}, + "_ZN1CC2EPFivES1_": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0237.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/virtualCalls/0019.gtmcg b/tools/cage/test/input/virtualCalls/0019.gtmcg index 1d5e3cb0..60f4f9f0 100644 --- a/tools/cage/test/input/virtualCalls/0019.gtmcg +++ b/tools/cage/test/input/virtualCalls/0019.gtmcg @@ -36,8 +36,7 @@ "callees": { "_ZN13MyClassDerive3fooEv": {}, "_ZN13MyClassDeriveC2Ev": {}, - "_ZN7MyClass3fooEv": {}, - "_ZN7MyClassC2Ev": {} + "_ZN7MyClass3fooEv": {} }, "functionName": "main", "hasBody": false, diff --git a/tools/cage/test/input/virtualCalls/0021.gtmcg b/tools/cage/test/input/virtualCalls/0021.gtmcg index aa0d94b3..5ed971f3 100644 --- a/tools/cage/test/input/virtualCalls/0021.gtmcg +++ b/tools/cage/test/input/virtualCalls/0021.gtmcg @@ -51,7 +51,6 @@ "main": { "callees": { "_ZN13MyClassDerive3fooEv": {}, - "_ZN13MyClassDeriveC2Ev": {}, "_ZN19MyClassDeriveDerive3fooEv": {}, "_ZN19MyClassDeriveDeriveC2Ev": {} }, diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index b915390c..8b6bfc59 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -12,23 +12,32 @@ verbose=0 mkdir -p log # Run single source test case. -# Param 1: Path to the test case. -# Param 2: Extra compile flags. -# Param 3: multi TU. +# Param 1: Name of the test case. +# Param 2: Path to the test case. +# Param 3: Variant name. +# Param 3: Extra compile flags. # Param 4: re-generate gt. function runTestCase { testCaseName=$1 testCasePath=$2 - addFlags=$3 - regenerate_gt=$4 + variant=$3 + addOptions=$4 + addFlags=$5 + regenerate_gt=$6 fail=0 run_dir=$(realpath --relative-to="$test_src_dir" "$testCasePath") mkdir -p $run_dir - cg_outfilename=$testCaseName.mcg + + extendedName=$testCaseName + if [[ -n "$variant" ]]; then + extendedName="$testCaseName.$variant" + fi + + cg_outfilename=$extendedName.mcg cg_outfile="$run_dir/$cg_outfilename" - cg_gtfile="$testCasePath/$testCaseName.gtmcg" + cg_gtfile="$testCasePath/$extendedName.gtmcg" diff_file=${cg_outfile/mcg/cgdiff} rm -f "$cg_outfile" "$diff_file" @@ -53,9 +62,9 @@ function runTestCase { failed=0 tfile_out="$run_dir/$testCaseName.exe" rm -f "$tfile_out" - CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 + CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 if [[ $failed -ne 0 ]] || [[ $verbose -eq 1 ]]; then - echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" + echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" fi if [[ $failed -ne 0 ]]; then if [[ ! -f "$cg_outfile" ]]; then @@ -85,8 +94,10 @@ function runTestCase { function runSingleFileTests { suiteName=$1 suitePath=$2 - addFlags=$3 - regenerateGt=$4 + variant=$3 + addOptions=$4 + addFlags=$5 + regenerateGt=$6 if [[ ! $suiteName =~ $suite_pattern ]]; then echo "Skipping test suite '$suiteName'..." @@ -100,7 +111,7 @@ function runSingleFileTests { echo "Running test ${tc}" tname=$(basename $tc) tname=${tname%.*} - runTestCase $tname "$suitePath" "" $regenerateGt + runTestCase $tname "$suitePath" "$variant" "$addOptions" "$addFlags" $regenerateGt fail=$? fails=$((fails + fail)) done @@ -111,8 +122,10 @@ function runSingleFileTests { function runMultiFileTests { suiteName=$1 suitePath=$2 - addFlags=$3 - regenerateGt=$4 + variant=$3 + addOptions=$4 + addFlags=$5 + regenerateGt=$6 if [[ ! $suiteName =~ $suite_pattern ]]; then echo "Skipping test suite '$suiteName'..." @@ -126,11 +139,10 @@ function runMultiFileTests { ff="${ff%%_*}" multiTests="$multiTests\n$ff" done - echo $multiTests fails=0 for tc in $(echo -e $multiTests | uniq); do echo "Running test ${tc}" - runTestCase "$tc" "$suitePath" "" $regenerateGt + runTestCase "$tc" "$suitePath" "$variant" "$addOptions" "$addFlags" $regenerateGt fail=$? fails=$((fails + fail)) done @@ -172,15 +184,21 @@ fi total_fails=0 -runSingleFileTests "basic" "$test_src_dir/input/singleTU" "" $regenerate_gt +# Default variant +runSingleFileTests "basic" "$test_src_dir/input/singleTU" "" "" "" $regenerate_gt +fails=$? +total_fails=$((total_fails + fails)) + +runSingleFileTests "virtual-calls" "$test_src_dir/input/virtualCalls" "" "" "" $regenerate_gt fails=$? total_fails=$((total_fails + fails)) -runSingleFileTests "virtualCalls" "$test_src_dir/input/virtualCalls" "" $regenerate_gt +runMultiFileTests "basic-multi" "$test_src_dir/input/multiTU" "" "" "" $regenerate_gt fails=$? total_fails=$((total_fails + fails)) -runMultiFileTests "basicMulti" "$test_src_dir/input/multiTU" "" $regenerate_gt +# PTA set to 'signature' +runSingleFileTests "basic-pta-by-signature" "$test_src_dir/input/singleTU" "pta-signature" "--pass-option -pta=signature" "" $regenerate_gt fails=$? total_fails=$((total_fails + fails)) From c8642d7649764281bdbb582415161064fd444f32 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 15:29:58 +0100 Subject: [PATCH 18/25] Formatting --- .../cage/generator/CallGraphConsumer.h | 2 +- tools/cage/src/Plugin.cpp | 59 +++++++++---------- .../cage/src/generator/CallGraphGenerator.cpp | 9 +-- tools/cage/test/01_simple/bar.cpp | 4 +- tools/cage/test/01_simple/main.cpp | 4 +- tools/cage/test/input/ctorDtor/0004.cpp | 2 +- tools/cage/test/input/ctorDtor/0005.cpp | 2 +- tools/cage/test/input/ctorDtor/0006.cpp | 2 +- tools/cage/test/input/ctorDtor/0007.cpp | 2 +- tools/cage/test/input/ctorDtor/0008.cpp | 2 +- tools/cage/test/input/multiTU/0042_a.cpp | 6 +- tools/cage/test/input/multiTU/0042_b.cpp | 6 +- tools/cage/test/input/multiTU/0043_a.cpp | 6 +- tools/cage/test/input/multiTU/0043_b.cpp | 6 +- tools/cage/test/input/multiTU/0044_a.cpp | 3 +- tools/cage/test/input/multiTU/0044_b.cpp | 3 +- tools/cage/test/input/singleTU/0004.cpp | 3 +- tools/cage/test/input/singleTU/0013.cpp | 3 +- tools/cage/test/input/singleTU/0235.cpp | 3 +- utils/config/MCGConfig.cpp | 8 ++- 20 files changed, 58 insertions(+), 77 deletions(-) diff --git a/tools/cage/include/cage/generator/CallGraphConsumer.h b/tools/cage/include/cage/generator/CallGraphConsumer.h index accddb91..379f299d 100644 --- a/tools/cage/include/cage/generator/CallGraphConsumer.h +++ b/tools/cage/include/cage/generator/CallGraphConsumer.h @@ -6,7 +6,7 @@ #ifndef METACG_CALLGRAPHCONSUMER_H #define METACG_CALLGRAPHCONSUMER_H -namespace metacg{ +namespace metacg { class Callgraph; } diff --git a/tools/cage/src/Plugin.cpp b/tools/cage/src/Plugin.cpp index 7e6c98eb..66be67da 100644 --- a/tools/cage/src/Plugin.cpp +++ b/tools/cage/src/Plugin.cpp @@ -28,10 +28,8 @@ static opt pta( "Treat all available valid function signatures for a given function pointer as potential call target ")), cat(cageOpts), init(cage::PTAType::No)); - namespace cage { PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { - if (cageVerbose) { outs() << "Running in verbose mode\n"; } @@ -47,39 +45,40 @@ PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { } // namespace cage llvm::PassPluginLibraryInfo getPluginInfo() { - return {LLVM_PLUGIN_API_VERSION, "CaGe", "0.2", [](PassBuilder& PB) { - // allow registration via optlevel (non-lto) + return { + LLVM_PLUGIN_API_VERSION, "CaGe", "0.2", [](PassBuilder& PB) { + // allow registration via optlevel (non-lto) #if LLVM_VERSION_MAJOR >= 20 - PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel, ThinOrFullLTOPhase) { + PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel, ThinOrFullLTOPhase) { #else - PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel) { + PB.registerOptimizerLastEPCallback([](ModulePassManager& PM, OptimizationLevel) { #endif - outs() << "Registering CaGe to run during opt\n"; - PM.addPass(cage::CaGe()); - }); - - // registering via optlevel during lto appears to still be broken - PB.registerFullLinkTimeOptimizationLastEPCallback([](ModulePassManager& PM, OptimizationLevel o) { - outs() << "Registering CaGe to run during full LTO\n"; - PM.addPass(cage::CaGe()); - }); - - // allow registration via pipeline parser - PB.registerPipelineParsingCallback( - [](StringRef Name, ModulePassManager& MPM, ArrayRef) { - if (Name == "CaGe") { - outs() << "Registering CaGe to run as pipeline described\n"; - MPM.addPass(cage::CaGe()); - return true; - } else { - outs() << "Did not register CaGe\n"; - } - return false; - }); - }}; + outs() << "Registering CaGe to run during opt\n"; + PM.addPass(cage::CaGe()); + }); + + // registering via optlevel during lto appears to still be broken + PB.registerFullLinkTimeOptimizationLastEPCallback([](ModulePassManager& PM, OptimizationLevel o) { + outs() << "Registering CaGe to run during full LTO\n"; + PM.addPass(cage::CaGe()); + }); + + // allow registration via pipeline parser + PB.registerPipelineParsingCallback( + [](StringRef Name, ModulePassManager& MPM, ArrayRef) { + if (Name == "CaGe") { + outs() << "Registering CaGe to run as pipeline described\n"; + MPM.addPass(cage::CaGe()); + return true; + } else { + outs() << "Did not register CaGe\n"; + } + return false; + }); + } + }; } - extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo llvmGetPassPluginInfo() { #ifndef NDEBUG outs() << "Loading debug version of CaGe-Plugin\n"; diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 8da39db1..4fc50df7 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -55,10 +55,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { } } - ~CallBaseVisitor() { - } - - + ~CallBaseVisitor() {} void visitCallBase(llvm::CallBase& I) { if (I.getCalledFunction() != nullptr && I.getCalledFunction()->isIntrinsic()) @@ -142,8 +139,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { } origin = functionInfoMap[F]->getFilename().str(); } - return mcg->getOrInsertNode(nameToUse.str(), - std::move(origin)); + return mcg->getOrInsertNode(nameToUse.str(), std::move(origin)); } std::unique_ptr mcg; @@ -167,7 +163,6 @@ bool Generator::run(Module& M, ModuleAnalysisManager* MA) { for (auto& consumer : consumers) { consumer->consumeCallGraph(*mcg); } - } return false; } diff --git a/tools/cage/test/01_simple/bar.cpp b/tools/cage/test/01_simple/bar.cpp index 68511679..8a8e8968 100644 --- a/tools/cage/test/01_simple/bar.cpp +++ b/tools/cage/test/01_simple/bar.cpp @@ -1,3 +1 @@ -void bar() { - -} \ No newline at end of file +void bar() {} \ No newline at end of file diff --git a/tools/cage/test/01_simple/main.cpp b/tools/cage/test/01_simple/main.cpp index 7b01de01..3e8730db 100644 --- a/tools/cage/test/01_simple/main.cpp +++ b/tools/cage/test/01_simple/main.cpp @@ -1,9 +1,7 @@ void bar(); -void foo() { - bar(); -} +void foo() { bar(); } int main() { foo(); diff --git a/tools/cage/test/input/ctorDtor/0004.cpp b/tools/cage/test/input/ctorDtor/0004.cpp index 0ed36ebc..d3b15bfe 100644 --- a/tools/cage/test/input/ctorDtor/0004.cpp +++ b/tools/cage/test/input/ctorDtor/0004.cpp @@ -5,7 +5,7 @@ struct A { }; struct B : A { - ~B(){}; + ~B() {}; }; void foo() { diff --git a/tools/cage/test/input/ctorDtor/0005.cpp b/tools/cage/test/input/ctorDtor/0005.cpp index d7a23586..873c791c 100644 --- a/tools/cage/test/input/ctorDtor/0005.cpp +++ b/tools/cage/test/input/ctorDtor/0005.cpp @@ -5,7 +5,7 @@ struct A { }; struct B : A { - ~B(){}; + ~B() {}; }; void foo() { B b; } diff --git a/tools/cage/test/input/ctorDtor/0006.cpp b/tools/cage/test/input/ctorDtor/0006.cpp index f19d14f6..aff22ca6 100644 --- a/tools/cage/test/input/ctorDtor/0006.cpp +++ b/tools/cage/test/input/ctorDtor/0006.cpp @@ -5,7 +5,7 @@ struct A { }; struct B : A { - ~B(){}; + ~B() {}; }; B makeB() { return B(); } diff --git a/tools/cage/test/input/ctorDtor/0007.cpp b/tools/cage/test/input/ctorDtor/0007.cpp index 07305472..fe6d3c46 100644 --- a/tools/cage/test/input/ctorDtor/0007.cpp +++ b/tools/cage/test/input/ctorDtor/0007.cpp @@ -5,7 +5,7 @@ struct A { }; struct B : A { - ~B(){}; + ~B() {}; }; void foo() { diff --git a/tools/cage/test/input/ctorDtor/0008.cpp b/tools/cage/test/input/ctorDtor/0008.cpp index 55d3e4aa..c36fa09a 100644 --- a/tools/cage/test/input/ctorDtor/0008.cpp +++ b/tools/cage/test/input/ctorDtor/0008.cpp @@ -6,7 +6,7 @@ struct A { struct B { // ~A() should be called here. - ~B(){}; + ~B() {}; A a; }; diff --git a/tools/cage/test/input/multiTU/0042_a.cpp b/tools/cage/test/input/multiTU/0042_a.cpp index 50ed00b5..1219c918 100644 --- a/tools/cage/test/input/multiTU/0042_a.cpp +++ b/tools/cage/test/input/multiTU/0042_a.cpp @@ -1,7 +1,5 @@ -__attribute__((retain)) -int foo() { return 42; } +__attribute__((retain)) int foo() { return 42; } -__attribute__((retain)) -int baz() { return foo(); } +__attribute__((retain)) int baz() { return foo(); } int main() { return 0; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042_b.cpp b/tools/cage/test/input/multiTU/0042_b.cpp index 41b939e2..a618e12b 100644 --- a/tools/cage/test/input/multiTU/0042_b.cpp +++ b/tools/cage/test/input/multiTU/0042_b.cpp @@ -1,9 +1,7 @@ -__attribute__((retain)) -int boo() { +__attribute__((retain)) int boo() { int a = 1; int b = 0; return a + b; } -__attribute__((retain)) -int bar() { return boo(); } +__attribute__((retain)) int bar() { return boo(); } diff --git a/tools/cage/test/input/multiTU/0043_a.cpp b/tools/cage/test/input/multiTU/0043_a.cpp index 3efe82c0..c4e589f4 100644 --- a/tools/cage/test/input/multiTU/0043_a.cpp +++ b/tools/cage/test/input/multiTU/0043_a.cpp @@ -1,7 +1,5 @@ -__attribute__((retain)) -int foo() { return 1; } +__attribute__((retain)) int foo() { return 1; } -__attribute__((retain)) -int bar() { return 2; } +__attribute__((retain)) int bar() { return 2; } int main() { return 0; } diff --git a/tools/cage/test/input/multiTU/0043_b.cpp b/tools/cage/test/input/multiTU/0043_b.cpp index bf12126b..5b521808 100644 --- a/tools/cage/test/input/multiTU/0043_b.cpp +++ b/tools/cage/test/input/multiTU/0043_b.cpp @@ -1,7 +1,5 @@ extern int bar(); -__attribute__((retain)) -int har() { return 4; } +__attribute__((retain)) int har() { return 4; } -__attribute__((retain)) -int goo() { return bar(); } +__attribute__((retain)) int goo() { return bar(); } diff --git a/tools/cage/test/input/multiTU/0044_a.cpp b/tools/cage/test/input/multiTU/0044_a.cpp index e826489d..d4c995be 100644 --- a/tools/cage/test/input/multiTU/0044_a.cpp +++ b/tools/cage/test/input/multiTU/0044_a.cpp @@ -2,7 +2,6 @@ extern int foo(); int bar() { return foo(); } -__attribute__((retain)) -int har() { return bar(); } +__attribute__((retain)) int har() { return bar(); } int main() { return 0; } \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0044_b.cpp b/tools/cage/test/input/multiTU/0044_b.cpp index 422846c4..610fd28f 100644 --- a/tools/cage/test/input/multiTU/0044_b.cpp +++ b/tools/cage/test/input/multiTU/0044_b.cpp @@ -1,4 +1,3 @@ int foo() { return 2; } -__attribute__((retain)) -int hf() { return foo(); } +__attribute__((retain)) int hf() { return foo(); } diff --git a/tools/cage/test/input/singleTU/0004.cpp b/tools/cage/test/input/singleTU/0004.cpp index 16f30fce..22ad639e 100644 --- a/tools/cage/test/input/singleTU/0004.cpp +++ b/tools/cage/test/input/singleTU/0004.cpp @@ -1,8 +1,7 @@ // no call // but a second function -__attribute__((retain)) -int foo() { +__attribute__((retain)) int foo() { int a = 0; for (int i = 0; i < 5; ++i) { a += 2; diff --git a/tools/cage/test/input/singleTU/0013.cpp b/tools/cage/test/input/singleTU/0013.cpp index eb9f6337..331bf228 100644 --- a/tools/cage/test/input/singleTU/0013.cpp +++ b/tools/cage/test/input/singleTU/0013.cpp @@ -4,8 +4,7 @@ int lastChild() { return 1; } int middle() { return lastChild(); } -__attribute__((retain)) -int middle2() { return lastChild(); } +__attribute__((retain)) int middle2() { return lastChild(); } int main(int argc, char* argv[]) { middle(); diff --git a/tools/cage/test/input/singleTU/0235.cpp b/tools/cage/test/input/singleTU/0235.cpp index edfe2495..2dd98573 100644 --- a/tools/cage/test/input/singleTU/0235.cpp +++ b/tools/cage/test/input/singleTU/0235.cpp @@ -4,8 +4,7 @@ typedef void (*Function)(); void foo() {} -__attribute__((retain)) -void bar() {} +__attribute__((retain)) void bar() {} class C { public: diff --git a/utils/config/MCGConfig.cpp b/utils/config/MCGConfig.cpp index 7e49717d..da2509ab 100644 --- a/utils/config/MCGConfig.cpp +++ b/utils/config/MCGConfig.cpp @@ -16,6 +16,7 @@ int main(int argc, char** argv) { cxxopts::Options options("metacg-config", "MetaCG configuration tool"); + // clang-format off options.add_options("commands")("v,version", "Prints the version of this MetaCG installation.")( "revision", "Prints the revision hash of this MetaCG installation")( "prefix", "Prints the installation prefix of this MetaCG installation.")( @@ -25,6 +26,7 @@ int main(int argc, char** argv) { "cage", "Enables the CaGe LTO plugin (requires graph tools).")( "pass-option", "Sets a pass option", cxxopts::value>())( "h,help", "Print help"); + // clang-format on const cxxopts::ParseResult result = options.parse(argc, argv); @@ -34,7 +36,8 @@ int main(int argc, char** argv) { } // Exactly one of these is allowed at the same time - int optCount = result.count("version") + result.count("revision") + result.count("prefix") + result.count("ldflags") +result.count("cflags") + result.count("cxxflags"); + int optCount = result.count("version") + result.count("revision") + result.count("prefix") + result.count("ldflags") + + result.count("cflags") + result.count("cxxflags"); if (optCount == 0) { std::cerr << "Error: No command specified.\n"; return EXIT_FAILURE; @@ -90,7 +93,8 @@ int main(int argc, char** argv) { if (result.contains("ldflags")) { #ifdef HAVE_GRAPH_TOOLS if (useCaGe) { - std::cout << " -flto -fuse-ld=lld -Wl,-mllvm=-load=" << CAGE_PLUGIN << " -Wl,--load-pass-plugin=" << CAGE_PLUGIN << processedPassOpts << " "; + std::cout << " -flto -fuse-ld=lld -Wl,-mllvm=-load=" << CAGE_PLUGIN << " -Wl,--load-pass-plugin=" << CAGE_PLUGIN + << processedPassOpts << " "; } #endif } From 3d2c51dee0f8d51d50c706b8a724bacd40b71170 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 15:52:19 +0100 Subject: [PATCH 19/25] [CaGe] Add another test --- tools/cage/test/input/singleTU/0300.cpp | 15 ++++ tools/cage/test/input/singleTU/0300.gtmcg | 71 +++++++++++++++++++ .../input/singleTU/0300.pta-signature.gtmcg | 71 +++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 tools/cage/test/input/singleTU/0300.cpp create mode 100644 tools/cage/test/input/singleTU/0300.gtmcg create mode 100644 tools/cage/test/input/singleTU/0300.pta-signature.gtmcg diff --git a/tools/cage/test/input/singleTU/0300.cpp b/tools/cage/test/input/singleTU/0300.cpp new file mode 100644 index 00000000..5cf36250 --- /dev/null +++ b/tools/cage/test/input/singleTU/0300.cpp @@ -0,0 +1,15 @@ +// Checking that the call target overapproximation is not used on already resolved virtual calls. +struct Base { + virtual void foo() {}; + virtual void bar() {}; +}; + +struct Derived: public Base { + void foo() override {} +}; + +int main() { + Base* b = new Derived; + b->foo(); + return 0; +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0300.gtmcg b/tools/cage/test/input/singleTU/0300.gtmcg new file mode 100644 index 00000000..08187d51 --- /dev/null +++ b/tools/cage/test/input/singleTU/0300.gtmcg @@ -0,0 +1,71 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_ZN4Base3barEv": { + "callees": {}, + "functionName": "_ZN4Base3barEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN4Base3fooEv": { + "callees": {}, + "functionName": "_ZN4Base3fooEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN4BaseC2Ev": { + "callees": {}, + "functionName": "_ZN4BaseC2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN7Derived3fooEv": { + "callees": {}, + "functionName": "_ZN7Derived3fooEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN7DerivedC2Ev": { + "callees": { + "_ZN4BaseC2Ev": {} + }, + "functionName": "_ZN7DerivedC2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN4Base3fooEv": {}, + "_ZN7Derived3fooEv": {}, + "_ZN7DerivedC2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "c8642d7649764281bdbb582415161064fd444f32", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file diff --git a/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg new file mode 100644 index 00000000..08187d51 --- /dev/null +++ b/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg @@ -0,0 +1,71 @@ +{ + "_CG": { + "meta": {}, + "nodes": { + "_ZN4Base3barEv": { + "callees": {}, + "functionName": "_ZN4Base3barEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN4Base3fooEv": { + "callees": {}, + "functionName": "_ZN4Base3fooEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN4BaseC2Ev": { + "callees": {}, + "functionName": "_ZN4BaseC2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN7Derived3fooEv": { + "callees": {}, + "functionName": "_ZN7Derived3fooEv", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_ZN7DerivedC2Ev": { + "callees": { + "_ZN4BaseC2Ev": {} + }, + "functionName": "_ZN7DerivedC2Ev", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + }, + "_Znwm": { + "callees": {}, + "functionName": "_Znwm", + "hasBody": false, + "meta": {}, + "origin": null + }, + "main": { + "callees": { + "_ZN4Base3fooEv": {}, + "_ZN7Derived3fooEv": {}, + "_ZN7DerivedC2Ev": {}, + "_Znwm": {} + }, + "functionName": "main", + "hasBody": false, + "meta": {}, + "origin": "tools/cage/test/input/singleTU/0300.cpp" + } + } + }, + "_MetaCG": { + "generator": { + "name": "CaGe", + "sha": "c8642d7649764281bdbb582415161064fd444f32", + "version": "0.1" + }, + "version": "4.0" + } +} \ No newline at end of file From dee09d9ccf3d15c47c2c267400e84a61641b9ec6 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 16:13:49 +0100 Subject: [PATCH 20/25] [CaGe] Set 'hasBody' correctly --- .../cage/src/generator/CallGraphGenerator.cpp | 3 +- tools/cage/test/01_simple/Makefile.in | 23 ----------- tools/cage/test/01_simple/bar.cpp | 1 - tools/cage/test/01_simple/main.cpp | 9 ----- tools/cage/test/input/multiTU/0042.gtmcg | 22 +++++------ tools/cage/test/input/multiTU/0043.gtmcg | 22 +++++------ tools/cage/test/input/multiTU/0044.gtmcg | 22 +++++------ tools/cage/test/input/multiTU/0050.gtmcg | 18 ++++----- tools/cage/test/input/multiTU/0053.gtmcg | 36 +++++++++--------- tools/cage/test/input/multiTU/0060.gtmcg | 30 +++++++-------- tools/cage/test/input/singleTU/0001.gtmcg | 4 +- .../input/singleTU/0001.pta-signature.gtmcg | 4 +- tools/cage/test/input/singleTU/0002.gtmcg | 6 +-- .../input/singleTU/0002.pta-signature.gtmcg | 6 +-- tools/cage/test/input/singleTU/0003.gtmcg | 8 ++-- .../input/singleTU/0003.pta-signature.gtmcg | 8 ++-- tools/cage/test/input/singleTU/0004.gtmcg | 6 +-- .../input/singleTU/0004.pta-signature.gtmcg | 6 +-- tools/cage/test/input/singleTU/0005.gtmcg | 8 ++-- .../input/singleTU/0005.pta-signature.gtmcg | 8 ++-- tools/cage/test/input/singleTU/0013.gtmcg | 10 ++--- .../input/singleTU/0013.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0014.gtmcg | 10 ++--- .../input/singleTU/0014.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0065.gtmcg | 10 ++--- .../input/singleTU/0065.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0066.gtmcg | 6 +-- .../input/singleTU/0066.pta-signature.gtmcg | 6 +-- tools/cage/test/input/singleTU/0230.gtmcg | 8 ++-- .../input/singleTU/0230.pta-signature.gtmcg | 8 ++-- tools/cage/test/input/singleTU/0232.gtmcg | 10 ++--- .../input/singleTU/0232.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0233.gtmcg | 4 +- .../input/singleTU/0233.pta-signature.gtmcg | 4 +- tools/cage/test/input/singleTU/0234.gtmcg | 10 ++--- .../input/singleTU/0234.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0235.gtmcg | 10 ++--- .../input/singleTU/0235.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/singleTU/0237.gtmcg | 14 +++---- .../input/singleTU/0237.pta-signature.gtmcg | 14 +++---- tools/cage/test/input/singleTU/0300.gtmcg | 10 ++--- .../input/singleTU/0300.pta-signature.gtmcg | 10 ++--- tools/cage/test/input/virtualCalls/0006.gtmcg | 10 ++--- tools/cage/test/input/virtualCalls/0007.gtmcg | 18 ++++----- tools/cage/test/input/virtualCalls/0008.gtmcg | 22 +++++------ tools/cage/test/input/virtualCalls/0009.gtmcg | 22 +++++------ tools/cage/test/input/virtualCalls/0010.gtmcg | 34 ++++++++--------- tools/cage/test/input/virtualCalls/0011.gtmcg | 10 ++--- tools/cage/test/input/virtualCalls/0012.gtmcg | 10 ++--- tools/cage/test/input/virtualCalls/0015.gtmcg | 30 +++++++-------- tools/cage/test/input/virtualCalls/0016.gtmcg | 34 ++++++++--------- tools/cage/test/input/virtualCalls/0017.gtmcg | 38 +++++++++---------- tools/cage/test/input/virtualCalls/0018.gtmcg | 34 ++++++++--------- tools/cage/test/input/virtualCalls/0019.gtmcg | 20 +++++----- tools/cage/test/input/virtualCalls/0020.gtmcg | 22 +++++------ tools/cage/test/input/virtualCalls/0021.gtmcg | 28 +++++++------- tools/cage/test/input/virtualCalls/0022.gtmcg | 22 +++++------ tools/cage/test/runCaGeTests.sh.in | 7 ++-- 58 files changed, 392 insertions(+), 423 deletions(-) delete mode 100644 tools/cage/test/01_simple/Makefile.in delete mode 100644 tools/cage/test/01_simple/bar.cpp delete mode 100644 tools/cage/test/01_simple/main.cpp diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 4fc50df7..8071a770 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -130,6 +130,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { } metacg::CgNode& getOrInsertNode(const llvm::Function* F) { + bool hasBody = !F->isDeclaration(); StringRef nameToUse = F->getName(); std::optional origin{}; if (metaDataAvail && functionInfoMap[F] != nullptr) { @@ -139,7 +140,7 @@ struct CallBaseVisitor : public llvm::InstVisitor { } origin = functionInfoMap[F]->getFilename().str(); } - return mcg->getOrInsertNode(nameToUse.str(), std::move(origin)); + return mcg->getOrInsertNode(nameToUse.str(), std::move(origin), false, hasBody); } std::unique_ptr mcg; diff --git a/tools/cage/test/01_simple/Makefile.in b/tools/cage/test/01_simple/Makefile.in deleted file mode 100644 index 7657ba07..00000000 --- a/tools/cage/test/01_simple/Makefile.in +++ /dev/null @@ -1,23 +0,0 @@ -# Compiler and flags -CXX := clang++ -CXXFLAGS := -Wall -Wextra -O2 -std=c++17 -METACG_CONFIG := @METACG_CONFIG@ - -# Sources and target -SRCS := @TEST_SRC_DIR@/main.cpp @TEST_SRC_DIR@/bar.cpp -OBJS := $(SRCS:.cpp=.o) -TARGET := 01_simple - -# Link step -$(TARGET): $(OBJS) - $(CXX) `$(METACG_CONFIG) --cage --ldflags` $(OBJS) -o $@ - -# Compile step -%.o: %.cpp - $(CXX) $(CXXFLAGS) `$(METACG_CONFIG) --cage --cxxflags` -c $< -o $@ - -# Clean up build artifacts -clean: - rm -f $(OBJS) $(TARGET) - -.PHONY: all clean \ No newline at end of file diff --git a/tools/cage/test/01_simple/bar.cpp b/tools/cage/test/01_simple/bar.cpp deleted file mode 100644 index 8a8e8968..00000000 --- a/tools/cage/test/01_simple/bar.cpp +++ /dev/null @@ -1 +0,0 @@ -void bar() {} \ No newline at end of file diff --git a/tools/cage/test/01_simple/main.cpp b/tools/cage/test/01_simple/main.cpp deleted file mode 100644 index 3e8730db..00000000 --- a/tools/cage/test/01_simple/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -void bar(); - -void foo() { bar(); } - -int main() { - foo(); - return 0; -} \ No newline at end of file diff --git a/tools/cage/test/input/multiTU/0042.gtmcg b/tools/cage/test/input/multiTU/0042.gtmcg index 9efa6e6c..0a10eabc 100644 --- a/tools/cage/test/input/multiTU/0042.gtmcg +++ b/tools/cage/test/input/multiTU/0042.gtmcg @@ -7,46 +7,46 @@ "_Z3boov": {} }, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0042_b.cpp" }, "_Z3bazv": { "callees": { "_Z3foov": {} }, "functionName": "_Z3bazv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0042_a.cpp" }, "_Z3boov": { "callees": {}, "functionName": "_Z3boov", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0042_b.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0042_a.cpp" }, "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0042_a.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/multiTU/0043.gtmcg b/tools/cage/test/input/multiTU/0043.gtmcg index 8f309c3d..15d0c6ae 100644 --- a/tools/cage/test/input/multiTU/0043.gtmcg +++ b/tools/cage/test/input/multiTU/0043.gtmcg @@ -5,46 +5,46 @@ "_Z3barv": { "callees": {}, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0043_a.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0043_a.cpp" }, "_Z3goov": { "callees": { "_Z3barv": {} }, "functionName": "_Z3goov", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0043_b.cpp" }, "_Z3harv": { "callees": {}, "functionName": "_Z3harv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0043_b.cpp" }, "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0043_a.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/multiTU/0044.gtmcg b/tools/cage/test/input/multiTU/0044.gtmcg index 9dc16b56..3fe414e4 100644 --- a/tools/cage/test/input/multiTU/0044.gtmcg +++ b/tools/cage/test/input/multiTU/0044.gtmcg @@ -7,48 +7,48 @@ "_Z3foov": {} }, "functionName": "_Z2hfv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0044_b.cpp" }, "_Z3barv": { "callees": { "_Z3foov": {} }, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0044_a.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0044_b.cpp" }, "_Z3harv": { "callees": { "_Z3barv": {} }, "functionName": "_Z3harv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0044_a.cpp" }, "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0044_a.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/multiTU/0050.gtmcg b/tools/cage/test/input/multiTU/0050.gtmcg index 552556b0..3da2aa08 100644 --- a/tools/cage/test/input/multiTU/0050.gtmcg +++ b/tools/cage/test/input/multiTU/0050.gtmcg @@ -7,30 +7,30 @@ "functionName": "_ZN4Base3fooEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0050.h" }, "_ZN4BaseC2Ev": { "callees": {}, "functionName": "_ZN4BaseC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0050.h" }, "_ZN6Derive3fooEv": { "callees": {}, "functionName": "_ZN6Derive3fooEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0050.h" }, "_ZN6DeriveC2Ev": { "callees": { "_ZN4BaseC2Ev": {} }, "functionName": "_ZN6DeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0050.h" }, "_Znwm": { "callees": {}, @@ -47,16 +47,16 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0050_a.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/multiTU/0053.gtmcg b/tools/cage/test/input/multiTU/0053.gtmcg index 1aa82c16..7c7c6def 100644 --- a/tools/cage/test/input/multiTU/0053.gtmcg +++ b/tools/cage/test/input/multiTU/0053.gtmcg @@ -5,46 +5,46 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053.h" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053.h" }, "_ZN14MyClassDeriveD3fooEv": { "callees": {}, "functionName": "_ZN14MyClassDeriveD3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053_b.cpp" }, "_ZN14MyClassDeriveDC2Ev": { "callees": { "_ZN13MyClassDeriveC2Ev": {} }, "functionName": "_ZN14MyClassDeriveDC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053_b.cpp" }, - "_ZN7MyClassC2Ev": { + "_ZN7MyClass3fooEv": { "callees": {}, - "functionName": "_ZN7MyClassC2Ev", + "functionName": "_ZN7MyClass3fooEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053.h" }, - "_ZN7MyClass3fooEv": { + "_ZN7MyClassC2Ev": { "callees": {}, - "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "functionName": "_ZN7MyClassC2Ev", + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/multiTU/0053.h" }, @@ -64,22 +64,22 @@ }, "main": { "callees": { - "_ZN7MyClass3fooEv": {}, "_ZN13MyClassDerive3fooEv": {}, "_ZN14MyClassDeriveDC2Ev": {}, + "_ZN7MyClass3fooEv": {}, "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0053_b.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/multiTU/0060.gtmcg b/tools/cage/test/input/multiTU/0060.gtmcg index 3b113432..44ad1a71 100644 --- a/tools/cage/test/input/multiTU/0060.gtmcg +++ b/tools/cage/test/input/multiTU/0060.gtmcg @@ -8,43 +8,43 @@ "_Z4loopv": {} }, "functionName": "_Z1xv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" }, "_Z4leafv": { "callees": {}, "functionName": "_Z4leafv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" }, "_Z4leftv": { "callees": { "_Z1xv": {} }, "functionName": "_Z4leftv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" }, "_Z4loopv": { "callees": { "_Z5splitv": {} }, "functionName": "_Z4loopv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_b.cpp" }, "_Z5rightv": { "callees": { "_Z1xv": {} }, "functionName": "_Z5rightv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" }, "_Z5splitv": { "callees": { @@ -52,25 +52,25 @@ "_Z5rightv": {} }, "functionName": "_Z5splitv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" }, "main": { "callees": { "_Z5splitv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/multiTU/0060_a.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0001.gtmcg b/tools/cage/test/input/singleTU/0001.gtmcg index 327f597a..5f741a3d 100644 --- a/tools/cage/test/input/singleTU/0001.gtmcg +++ b/tools/cage/test/input/singleTU/0001.gtmcg @@ -5,7 +5,7 @@ "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0001.cpp" } @@ -14,7 +14,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg index d89d3726..5f741a3d 100644 --- a/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0001.pta-signature.gtmcg @@ -5,7 +5,7 @@ "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0001.cpp" } @@ -14,7 +14,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0002.gtmcg b/tools/cage/test/input/singleTU/0002.gtmcg index 44977882..dcf5b02d 100644 --- a/tools/cage/test/input/singleTU/0002.gtmcg +++ b/tools/cage/test/input/singleTU/0002.gtmcg @@ -5,7 +5,7 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0002.cpp" }, @@ -14,7 +14,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0002.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg index c83af0d6..dcf5b02d 100644 --- a/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0002.pta-signature.gtmcg @@ -5,7 +5,7 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0002.cpp" }, @@ -14,7 +14,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0002.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0003.gtmcg b/tools/cage/test/input/singleTU/0003.gtmcg index e793998b..2d3323bd 100644 --- a/tools/cage/test/input/singleTU/0003.gtmcg +++ b/tools/cage/test/input/singleTU/0003.gtmcg @@ -5,7 +5,7 @@ "_Z3barv": { "callees": {}, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" }, @@ -14,7 +14,7 @@ "_Z3barv": {} }, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" }, @@ -23,7 +23,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" } @@ -32,7 +32,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg index fb763b2e..2d3323bd 100644 --- a/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0003.pta-signature.gtmcg @@ -5,7 +5,7 @@ "_Z3barv": { "callees": {}, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" }, @@ -14,7 +14,7 @@ "_Z3barv": {} }, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" }, @@ -23,7 +23,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0003.cpp" } @@ -32,7 +32,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0004.gtmcg b/tools/cage/test/input/singleTU/0004.gtmcg index f25ce672..3c26fea6 100644 --- a/tools/cage/test/input/singleTU/0004.gtmcg +++ b/tools/cage/test/input/singleTU/0004.gtmcg @@ -5,14 +5,14 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0004.cpp" }, "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0004.cpp" } @@ -21,7 +21,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg index 2f590115..3c26fea6 100644 --- a/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0004.pta-signature.gtmcg @@ -5,14 +5,14 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0004.cpp" }, "main": { "callees": {}, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0004.cpp" } @@ -21,7 +21,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0005.gtmcg b/tools/cage/test/input/singleTU/0005.gtmcg index 7accf147..bf678f94 100644 --- a/tools/cage/test/input/singleTU/0005.gtmcg +++ b/tools/cage/test/input/singleTU/0005.gtmcg @@ -5,14 +5,14 @@ "_Z8childOnev": { "callees": {}, "functionName": "_Z8childOnev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" }, "_Z8childTwov": { "callees": {}, "functionName": "_Z8childTwov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" }, @@ -22,7 +22,7 @@ "_Z8childTwov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" } @@ -31,7 +31,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg index a05fad45..bf678f94 100644 --- a/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0005.pta-signature.gtmcg @@ -5,14 +5,14 @@ "_Z8childOnev": { "callees": {}, "functionName": "_Z8childOnev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" }, "_Z8childTwov": { "callees": {}, "functionName": "_Z8childTwov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" }, @@ -22,7 +22,7 @@ "_Z8childTwov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0005.cpp" } @@ -31,7 +31,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0013.gtmcg b/tools/cage/test/input/singleTU/0013.gtmcg index 7670862d..ad831e83 100644 --- a/tools/cage/test/input/singleTU/0013.gtmcg +++ b/tools/cage/test/input/singleTU/0013.gtmcg @@ -7,7 +7,7 @@ "_Z9lastChildv": {} }, "functionName": "_Z6middlev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, @@ -16,14 +16,14 @@ "_Z9lastChildv": {} }, "functionName": "_Z7middle2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, @@ -32,7 +32,7 @@ "_Z6middlev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" } @@ -41,7 +41,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg index 31166cc7..ad831e83 100644 --- a/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0013.pta-signature.gtmcg @@ -7,7 +7,7 @@ "_Z9lastChildv": {} }, "functionName": "_Z6middlev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, @@ -16,14 +16,14 @@ "_Z9lastChildv": {} }, "functionName": "_Z7middle2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" }, @@ -32,7 +32,7 @@ "_Z6middlev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0013.cpp" } @@ -41,7 +41,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0014.gtmcg b/tools/cage/test/input/singleTU/0014.gtmcg index 988b3b71..9227bacb 100644 --- a/tools/cage/test/input/singleTU/0014.gtmcg +++ b/tools/cage/test/input/singleTU/0014.gtmcg @@ -7,7 +7,7 @@ "_Z7middle2v": {} }, "functionName": "_Z6middlev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, @@ -16,14 +16,14 @@ "_Z9lastChildv": {} }, "functionName": "_Z7middle2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, @@ -33,7 +33,7 @@ "_Z9lastChildv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" } @@ -42,7 +42,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg index f01d3cfc..9227bacb 100644 --- a/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0014.pta-signature.gtmcg @@ -7,7 +7,7 @@ "_Z7middle2v": {} }, "functionName": "_Z6middlev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, @@ -16,14 +16,14 @@ "_Z9lastChildv": {} }, "functionName": "_Z7middle2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, "_Z9lastChildv": { "callees": {}, "functionName": "_Z9lastChildv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" }, @@ -33,7 +33,7 @@ "_Z9lastChildv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0014.cpp" } @@ -42,7 +42,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0065.gtmcg b/tools/cage/test/input/singleTU/0065.gtmcg index 097b7fe5..6f965c8e 100644 --- a/tools/cage/test/input/singleTU/0065.gtmcg +++ b/tools/cage/test/input/singleTU/0065.gtmcg @@ -5,21 +5,21 @@ "_Z12get_func_ptri": { "callees": {}, "functionName": "_Z12get_func_ptri", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func2v": { "callees": {}, "functionName": "_Z5func2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, @@ -28,7 +28,7 @@ "_Z12get_func_ptri": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" } @@ -37,7 +37,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg index c6593868..9a16e16c 100644 --- a/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0065.pta-signature.gtmcg @@ -5,21 +5,21 @@ "_Z12get_func_ptri": { "callees": {}, "functionName": "_Z12get_func_ptri", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, "_Z5func2v": { "callees": {}, "functionName": "_Z5func2v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" }, @@ -30,7 +30,7 @@ "_Z5func2v": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0065.cpp" } @@ -39,7 +39,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0066.gtmcg b/tools/cage/test/input/singleTU/0066.gtmcg index f3d91b21..7d6ebd13 100644 --- a/tools/cage/test/input/singleTU/0066.gtmcg +++ b/tools/cage/test/input/singleTU/0066.gtmcg @@ -5,7 +5,7 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0066.cpp" }, @@ -14,7 +14,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0066.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg index c55daac2..7d6ebd13 100644 --- a/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0066.pta-signature.gtmcg @@ -5,7 +5,7 @@ "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0066.cpp" }, @@ -14,7 +14,7 @@ "_Z3foov": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0066.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0230.gtmcg b/tools/cage/test/input/singleTU/0230.gtmcg index 43ead5e0..9fadcbba 100644 --- a/tools/cage/test/input/singleTU/0230.gtmcg +++ b/tools/cage/test/input/singleTU/0230.gtmcg @@ -5,14 +5,14 @@ "_Z1fv": { "callees": {}, "functionName": "_Z1fv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" }, "_ZN1A14memberFunctionEv": { "callees": {}, "functionName": "_ZN1A14memberFunctionEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" }, @@ -21,7 +21,7 @@ "_ZN1A14memberFunctionEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" } @@ -30,7 +30,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg index 62ebc9e6..f0f9fdcf 100644 --- a/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0230.pta-signature.gtmcg @@ -5,14 +5,14 @@ "_Z1fv": { "callees": {}, "functionName": "_Z1fv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" }, "_ZN1A14memberFunctionEv": { "callees": {}, "functionName": "_ZN1A14memberFunctionEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" }, @@ -22,7 +22,7 @@ "_ZN1A14memberFunctionEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0230.cpp" } @@ -31,7 +31,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0232.gtmcg b/tools/cage/test/input/singleTU/0232.gtmcg index 12157d70..1c4426c9 100644 --- a/tools/cage/test/input/singleTU/0232.gtmcg +++ b/tools/cage/test/input/singleTU/0232.gtmcg @@ -5,21 +5,21 @@ "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZN1XD2Ev": { "callees": {}, "functionName": "_ZN1XD2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, @@ -45,7 +45,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" } @@ -54,7 +54,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg index db453787..88e00fd2 100644 --- a/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0232.pta-signature.gtmcg @@ -5,14 +5,14 @@ "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, @@ -21,7 +21,7 @@ "_Z5func1v": {} }, "functionName": "_ZN1XD2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" }, @@ -47,7 +47,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0232.cpp" } @@ -56,7 +56,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0233.gtmcg b/tools/cage/test/input/singleTU/0233.gtmcg index ed2598b0..dda3c58d 100644 --- a/tools/cage/test/input/singleTU/0233.gtmcg +++ b/tools/cage/test/input/singleTU/0233.gtmcg @@ -14,7 +14,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0233.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg index 68384a87..dda3c58d 100644 --- a/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0233.pta-signature.gtmcg @@ -14,7 +14,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0233.cpp" } @@ -23,7 +23,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0234.gtmcg b/tools/cage/test/input/singleTU/0234.gtmcg index b4119d65..3c2f8ae9 100644 --- a/tools/cage/test/input/singleTU/0234.gtmcg +++ b/tools/cage/test/input/singleTU/0234.gtmcg @@ -5,21 +5,21 @@ "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_ZN1XD2Ev": { "callees": {}, "functionName": "_ZN1XD2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, @@ -37,7 +37,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" } @@ -46,7 +46,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg index 65c51d30..4e985ea7 100644 --- a/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0234.pta-signature.gtmcg @@ -5,14 +5,14 @@ "_Z5func1v": { "callees": {}, "functionName": "_Z5func1v", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, "_ZN1XC2EPFvvE": { "callees": {}, "functionName": "_ZN1XC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, @@ -21,7 +21,7 @@ "_Z5func1v": {} }, "functionName": "_ZN1XD2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" }, @@ -39,7 +39,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0234.cpp" } @@ -48,7 +48,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0235.gtmcg b/tools/cage/test/input/singleTU/0235.gtmcg index faaca99b..c8480f7c 100644 --- a/tools/cage/test/input/singleTU/0235.gtmcg +++ b/tools/cage/test/input/singleTU/0235.gtmcg @@ -5,21 +5,21 @@ "_Z3barv": { "callees": {}, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "_ZN1CC2EPFvvE": { "callees": {}, "functionName": "_ZN1CC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, @@ -28,7 +28,7 @@ "_ZN1CC2EPFvvE": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" } @@ -37,7 +37,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg index d4e1c033..1a576041 100644 --- a/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0235.pta-signature.gtmcg @@ -5,21 +5,21 @@ "_Z3barv": { "callees": {}, "functionName": "_Z3barv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, "_ZN1CC2EPFvvE": { "callees": {}, "functionName": "_ZN1CC2EPFvvE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" }, @@ -30,7 +30,7 @@ "_ZN1CC2EPFvvE": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0235.cpp" } @@ -39,7 +39,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0237.gtmcg b/tools/cage/test/input/singleTU/0237.gtmcg index 73c3a594..d46bf518 100644 --- a/tools/cage/test/input/singleTU/0237.gtmcg +++ b/tools/cage/test/input/singleTU/0237.gtmcg @@ -5,28 +5,28 @@ "_Z3boov": { "callees": {}, "functionName": "_Z3boov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1BC2EPFivE": { "callees": {}, "functionName": "_ZN1BC2EPFivE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1C4workEv": { "callees": {}, "functionName": "_ZN1C4workEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, @@ -35,7 +35,7 @@ "_ZN1BC2EPFivE": {} }, "functionName": "_ZN1CC2EPFivES1_", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, @@ -45,7 +45,7 @@ "_ZN1CC2EPFivES1_": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" } @@ -54,7 +54,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg index 26e4cfa5..c35b414f 100644 --- a/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0237.pta-signature.gtmcg @@ -5,21 +5,21 @@ "_Z3boov": { "callees": {}, "functionName": "_Z3boov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_Z3foov": { "callees": {}, "functionName": "_Z3foov", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, "_ZN1BC2EPFivE": { "callees": {}, "functionName": "_ZN1BC2EPFivE", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, @@ -30,7 +30,7 @@ "main": {} }, "functionName": "_ZN1C4workEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, @@ -39,7 +39,7 @@ "_ZN1BC2EPFivE": {} }, "functionName": "_ZN1CC2EPFivES1_", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" }, @@ -49,7 +49,7 @@ "_ZN1CC2EPFivES1_": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0237.cpp" } @@ -58,7 +58,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "3ea516e480f6fb78e2a48908795ff662b029bcb1", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0300.gtmcg b/tools/cage/test/input/singleTU/0300.gtmcg index 08187d51..9c52250a 100644 --- a/tools/cage/test/input/singleTU/0300.gtmcg +++ b/tools/cage/test/input/singleTU/0300.gtmcg @@ -5,7 +5,7 @@ "_ZN4Base3barEv": { "callees": {}, "functionName": "_ZN4Base3barEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -19,7 +19,7 @@ "_ZN4BaseC2Ev": { "callees": {}, "functionName": "_ZN4BaseC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -35,7 +35,7 @@ "_ZN4BaseC2Ev": {} }, "functionName": "_ZN7DerivedC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -54,7 +54,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" } @@ -63,7 +63,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "c8642d7649764281bdbb582415161064fd444f32", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg b/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg index 08187d51..9c52250a 100644 --- a/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg +++ b/tools/cage/test/input/singleTU/0300.pta-signature.gtmcg @@ -5,7 +5,7 @@ "_ZN4Base3barEv": { "callees": {}, "functionName": "_ZN4Base3barEv", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -19,7 +19,7 @@ "_ZN4BaseC2Ev": { "callees": {}, "functionName": "_ZN4BaseC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -35,7 +35,7 @@ "_ZN4BaseC2Ev": {} }, "functionName": "_ZN7DerivedC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" }, @@ -54,7 +54,7 @@ "_Znwm": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, "origin": "tools/cage/test/input/singleTU/0300.cpp" } @@ -63,7 +63,7 @@ "_MetaCG": { "generator": { "name": "CaGe", - "sha": "c8642d7649764281bdbb582415161064fd444f32", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0006.gtmcg b/tools/cage/test/input/virtualCalls/0006.gtmcg index bb778d58..a657202f 100644 --- a/tools/cage/test/input/virtualCalls/0006.gtmcg +++ b/tools/cage/test/input/virtualCalls/0006.gtmcg @@ -5,25 +5,25 @@ "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0006.cpp" }, "main": { "callees": { "_ZN7MyClass3fooEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0006.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0007.gtmcg b/tools/cage/test/input/virtualCalls/0007.gtmcg index a5743786..c3f877ad 100644 --- a/tools/cage/test/input/virtualCalls/0007.gtmcg +++ b/tools/cage/test/input/virtualCalls/0007.gtmcg @@ -5,9 +5,9 @@ "_ZN7MyClassC2Ei": { "callees": {}, "functionName": "_ZN7MyClassC2Ei", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0007.cpp" }, "_ZN7MyClassD0Ev": { "callees": { @@ -15,16 +15,16 @@ "_ZdlPvm": {} }, "functionName": "_ZN7MyClassD0Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0007.cpp" }, "_ZN7MyClassD2Ev": { "callees": {}, "functionName": "_ZN7MyClassD2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0007.cpp" }, "_ZdlPvm": { "callees": {}, @@ -39,16 +39,16 @@ "_ZN7MyClassD2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0007.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0008.gtmcg b/tools/cage/test/input/virtualCalls/0008.gtmcg index a8e33ddd..375d0171 100644 --- a/tools/cage/test/input/virtualCalls/0008.gtmcg +++ b/tools/cage/test/input/virtualCalls/0008.gtmcg @@ -5,32 +5,32 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0008.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0008.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0008.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0008.cpp" }, "main": { "callees": { @@ -39,16 +39,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0008.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0009.gtmcg b/tools/cage/test/input/virtualCalls/0009.gtmcg index 1105a215..e00a37be 100644 --- a/tools/cage/test/input/virtualCalls/0009.gtmcg +++ b/tools/cage/test/input/virtualCalls/0009.gtmcg @@ -5,32 +5,32 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0009.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0009.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0009.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0009.cpp" }, "main": { "callees": { @@ -39,16 +39,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0009.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0010.gtmcg b/tools/cage/test/input/virtualCalls/0010.gtmcg index f8fbc251..429c206f 100644 --- a/tools/cage/test/input/virtualCalls/0010.gtmcg +++ b/tools/cage/test/input/virtualCalls/0010.gtmcg @@ -7,53 +7,53 @@ "_ZN13MyClassDerive3barEv": {} }, "functionName": "_Z8callsBarR13MyClassDerive", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN13MyClassDerive3barEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3barEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN7MyClass3barEv": { "callees": {}, "functionName": "_ZN7MyClass3barEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" }, "main": { "callees": { @@ -64,16 +64,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0010.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0011.gtmcg b/tools/cage/test/input/virtualCalls/0011.gtmcg index c61c9ff0..2f94c5e3 100644 --- a/tools/cage/test/input/virtualCalls/0011.gtmcg +++ b/tools/cage/test/input/virtualCalls/0011.gtmcg @@ -5,25 +5,25 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0011.cpp" }, "main": { "callees": { "_ZN13MyClassDerive3fooEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0011.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0012.gtmcg b/tools/cage/test/input/virtualCalls/0012.gtmcg index 3a93b52b..cc08ecbe 100644 --- a/tools/cage/test/input/virtualCalls/0012.gtmcg +++ b/tools/cage/test/input/virtualCalls/0012.gtmcg @@ -5,25 +5,25 @@ "_ZN14MyClassDeriveD3fooEv": { "callees": {}, "functionName": "_ZN14MyClassDeriveD3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0012.cpp" }, "main": { "callees": { "_ZN14MyClassDeriveD3fooEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0012.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0015.gtmcg b/tools/cage/test/input/virtualCalls/0015.gtmcg index b4807fac..4282cba0 100644 --- a/tools/cage/test/input/virtualCalls/0015.gtmcg +++ b/tools/cage/test/input/virtualCalls/0015.gtmcg @@ -5,48 +5,48 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN8MyClass2C2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "_ZN8MyClass23fooEv": { "callees": {}, "functionName": "_ZN8MyClass23fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "_ZN8MyClass2C2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN8MyClass2C2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" }, "main": { "callees": { @@ -55,16 +55,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0015.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0016.gtmcg b/tools/cage/test/input/virtualCalls/0016.gtmcg index aefd95cf..8f3eb0f6 100644 --- a/tools/cage/test/input/virtualCalls/0016.gtmcg +++ b/tools/cage/test/input/virtualCalls/0016.gtmcg @@ -5,9 +5,9 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { @@ -15,46 +15,46 @@ "_ZN8MyClass2C2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZN8MyClass23fooEv": { "callees": {}, "functionName": "_ZN8MyClass23fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZN8MyClass2C2Ev": { "callees": {}, "functionName": "_ZN8MyClass2C2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "_ZThn8_N13MyClassDerive3fooEv": { "callees": { "_ZN13MyClassDerive3fooEv": {} }, "functionName": "_ZThn8_N13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" }, "main": { "callees": { @@ -63,16 +63,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0016.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0017.gtmcg b/tools/cage/test/input/virtualCalls/0017.gtmcg index 48d5e72b..0dae68f6 100644 --- a/tools/cage/test/input/virtualCalls/0017.gtmcg +++ b/tools/cage/test/input/virtualCalls/0017.gtmcg @@ -7,16 +7,16 @@ "_ZN8MyClass2C2Ev": {} }, "functionName": "_ZN11MyClassStepC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { @@ -24,46 +24,46 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN8MyClass23fooEv": { "callees": {}, "functionName": "_ZN8MyClass23fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZN8MyClass2C2Ev": { "callees": {}, "functionName": "_ZN8MyClass2C2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "_ZThn8_N13MyClassDerive3fooEv": { "callees": { "_ZN13MyClassDerive3fooEv": {} }, "functionName": "_ZThn8_N13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" }, "main": { "callees": { @@ -72,16 +72,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0017.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0018.gtmcg b/tools/cage/test/input/virtualCalls/0018.gtmcg index 0eca9553..48d881d4 100644 --- a/tools/cage/test/input/virtualCalls/0018.gtmcg +++ b/tools/cage/test/input/virtualCalls/0018.gtmcg @@ -5,9 +5,9 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { @@ -15,48 +15,48 @@ "_ZN8MyClass2C2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZN8MyClass23fooEv": { "callees": {}, "functionName": "_ZN8MyClass23fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZN8MyClass2C2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN8MyClass2C2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "_ZThn8_N13MyClassDerive3fooEv": { "callees": { "_ZN13MyClassDerive3fooEv": {} }, "functionName": "_ZThn8_N13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" }, "main": { "callees": { @@ -65,16 +65,16 @@ "_ZN7MyClassC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0018.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0019.gtmcg b/tools/cage/test/input/virtualCalls/0019.gtmcg index 60f4f9f0..33465941 100644 --- a/tools/cage/test/input/virtualCalls/0019.gtmcg +++ b/tools/cage/test/input/virtualCalls/0019.gtmcg @@ -5,32 +5,32 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0019.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0019.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0019.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0019.cpp" }, "main": { "callees": { @@ -39,16 +39,16 @@ "_ZN7MyClass3fooEv": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0019.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0020.gtmcg b/tools/cage/test/input/virtualCalls/0020.gtmcg index 132fa264..99b91871 100644 --- a/tools/cage/test/input/virtualCalls/0020.gtmcg +++ b/tools/cage/test/input/virtualCalls/0020.gtmcg @@ -5,32 +5,32 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0020.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0020.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0020.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0020.cpp" }, "main": { "callees": { @@ -38,16 +38,16 @@ "_ZN13MyClassDeriveC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0020.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0021.gtmcg b/tools/cage/test/input/virtualCalls/0021.gtmcg index 5ed971f3..ff0918ba 100644 --- a/tools/cage/test/input/virtualCalls/0021.gtmcg +++ b/tools/cage/test/input/virtualCalls/0021.gtmcg @@ -5,48 +5,48 @@ "_ZN13MyClassDerive3fooEv": { "callees": {}, "functionName": "_ZN13MyClassDerive3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "_ZN13MyClassDeriveC2Ev": { "callees": { "_ZN7MyClassC2Ev": {} }, "functionName": "_ZN13MyClassDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "_ZN19MyClassDeriveDerive3fooEv": { "callees": {}, "functionName": "_ZN19MyClassDeriveDerive3fooEv", "hasBody": false, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "_ZN19MyClassDeriveDeriveC2Ev": { "callees": { "_ZN13MyClassDeriveC2Ev": {} }, "functionName": "_ZN19MyClassDeriveDeriveC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "_ZN7MyClass3fooEv": { "callees": {}, "functionName": "_ZN7MyClass3fooEv", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "_ZN7MyClassC2Ev": { "callees": {}, "functionName": "_ZN7MyClassC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" }, "main": { "callees": { @@ -55,16 +55,16 @@ "_ZN19MyClassDeriveDeriveC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0021.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/input/virtualCalls/0022.gtmcg b/tools/cage/test/input/virtualCalls/0022.gtmcg index 699c0a37..be068141 100644 --- a/tools/cage/test/input/virtualCalls/0022.gtmcg +++ b/tools/cage/test/input/virtualCalls/0022.gtmcg @@ -5,32 +5,32 @@ "_ZN8BaseUsedIiE5good1Ev": { "callees": {}, "functionName": "_ZN8BaseUsedIiE5good1Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0022.cpp" }, "_ZN8BaseUsedIiEC2Ev": { "callees": {}, "functionName": "_ZN8BaseUsedIiEC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0022.cpp" }, "_ZN9ChildUsedIiE5good2Ev": { "callees": {}, "functionName": "_ZN9ChildUsedIiE5good2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0022.cpp" }, "_ZN9ChildUsedIiEC2Ev": { "callees": { "_ZN8BaseUsedIiEC2Ev": {} }, "functionName": "_ZN9ChildUsedIiEC2Ev", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0022.cpp" }, "main": { "callees": { @@ -39,16 +39,16 @@ "_ZN9ChildUsedIiEC2Ev": {} }, "functionName": "main", - "hasBody": false, + "hasBody": true, "meta": {}, - "origin": null + "origin": "tools/cage/test/input/virtualCalls/0022.cpp" } } }, "_MetaCG": { "generator": { "name": "CaGe", - "sha": "b63f2e8be7b99e4bae8400006037d57b7d183f01", + "sha": "3d2c51dee0f8d51d50c706b8a724bacd40b71170", "version": "0.1" }, "version": "4.0" diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index 8b6bfc59..a5de8327 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -15,8 +15,9 @@ mkdir -p log # Param 1: Name of the test case. # Param 2: Path to the test case. # Param 3: Variant name. -# Param 3: Extra compile flags. -# Param 4: re-generate gt. +# Param 4: MCGConfig options. +# Param 5: Extra compile flags. +# Param 6: re-generate gt. function runTestCase { testCaseName=$1 testCasePath=$2 @@ -80,7 +81,7 @@ function runTestCase { return 0 fi - "$cgdiff" --ignore-hasBody --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -o "$diff_file" -- >>log/testrun.log 2>&1 + "$cgdiff" --ignore-md --ignore-edge-md "$cg_outfile" "$cg_gtfile" -o "$diff_file" -- >>log/testrun.log 2>&1 fail=$? if [[ $fail -ne 0 ]]; then From 1f990f3bdd3f2240f0d7b272da8e95af85ed2e63 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Thu, 18 Dec 2025 16:57:16 +0100 Subject: [PATCH 21/25] [CaGe] Implement first metadata collector --- .../include/cage/generator/MetaCollector.h | 38 +++++++++++ .../cage/generator/NumInstructionsCollector.h | 23 +++++++ .../cage/generator/NumInstructionsMD.h | 64 +++++++++++++++++++ .../cage/src/generator/CallGraphGenerator.cpp | 5 ++ 4 files changed, 130 insertions(+) create mode 100644 tools/cage/include/cage/generator/MetaCollector.h create mode 100644 tools/cage/include/cage/generator/NumInstructionsCollector.h create mode 100644 tools/cage/include/cage/generator/NumInstructionsMD.h diff --git a/tools/cage/include/cage/generator/MetaCollector.h b/tools/cage/include/cage/generator/MetaCollector.h new file mode 100644 index 00000000..2c763900 --- /dev/null +++ b/tools/cage/include/cage/generator/MetaCollector.h @@ -0,0 +1,38 @@ +/** +* File: MetaCollector.h +* License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at +* https://github.com/tudasc/metacg/LICENSE.txt +*/ +#ifndef METACG_METACOLLECTOR_H +#define METACG_METACOLLECTOR_H + +#include "llvm/IR/Module.h" +#include "Callgraph.h" + +namespace cage { + +class MetaCollector { + public: + virtual void run(llvm::Module&, metacg::Callgraph&) = 0; +}; + +class FunctionLocalMetaCollector: public MetaCollector { + public: + virtual std::unique_ptr runOnFunction(llvm::Function&) = 0; + + void run(llvm::Module& M, metacg::Callgraph& cg) override { + for (auto& F: M) { + auto node = cg.getFirstNode(F.getName().str()); + if (!node) { + continue; + } + if (auto md = runOnFunction(F)) { + node->addMetaData(std::move(md)); + } + } + } +}; + +} + +#endif // METACG_METACOLLECTOR_H diff --git a/tools/cage/include/cage/generator/NumInstructionsCollector.h b/tools/cage/include/cage/generator/NumInstructionsCollector.h new file mode 100644 index 00000000..62586fdf --- /dev/null +++ b/tools/cage/include/cage/generator/NumInstructionsCollector.h @@ -0,0 +1,23 @@ +/** +* File: NumInstructionsCollector.h +* License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at +* https://github.com/tudasc/metacg/LICENSE.txt + */ + +#ifndef METACG_NUMINSTRUCTIONSCOLLECTOR_H +#define METACG_NUMINSTRUCTIONSCOLLECTOR_H + +#include "MetaCollector.h" +#include "NumInstructionsMD.h" + +namespace cage { + +class NumInstructionsCollector: public FunctionLocalMetaCollector { + public: + std::unique_ptr runOnFunction(llvm::Function& F) override { + return std::make_unique(F.getInstructionCount()); + } +}; + +} +#endif \ No newline at end of file diff --git a/tools/cage/include/cage/generator/NumInstructionsMD.h b/tools/cage/include/cage/generator/NumInstructionsMD.h new file mode 100644 index 00000000..b3bad285 --- /dev/null +++ b/tools/cage/include/cage/generator/NumInstructionsMD.h @@ -0,0 +1,64 @@ +/** + * File: NumInstructionsMD.h + * License: Part of the MetaCG project. Licensed under BSD 3 clause license. See LICENSE.txt file at + * https://github.com/tudasc/metacg/LICENSE.txt + */ +#ifndef CAGE_NUMINSTRUCTIONSMD_H +#define CAGE_NUMINSTRUCTIONSMD_H + +#include "metadata/MetaData.h" + +using namespace metacg; + +namespace cage { + +class NumInstructionsMD : public metacg::MetaData::Registrar { + public: + static constexpr const char* key = "numInstructions"; + NumInstructionsMD() = default; + explicit NumInstructionsMD(const nlohmann::json& j, StrToNodeMapping&) { + metacg::MCGLogger::instance().getConsole()->trace("Reading NumInstructionsMD from json"); + if (j.is_null()) { + metacg::MCGLogger::instance().getConsole()->trace("Could not retrieve meta data for {}", "NumInstructionsMD"); + return; + } + auto jsonnumInstructions = j.get(); + setNumberOfInstructions(jsonnumInstructions); + } + + explicit NumInstructionsMD(int num) : numInstructions(num) {} + + private: + NumInstructionsMD(const NumInstructionsMD& other) : numInstructions(other.numInstructions) {} + + public: + nlohmann::json toJson(NodeToStrMapping&) const final { return getNumberOfInstructions(); } + + const char* getKey() const override { return key; } + + void merge(const MetaData& toMerge, std::optional, const GraphMapping&) final { + assert(toMerge.getKey() == getKey() && "Trying to merge NumInstructionsMD with meta data of different types"); + + const NumInstructionsMD* toMergeDerived = static_cast(&toMerge); + + if (numInstructions != 0 && toMergeDerived->getNumberOfInstructions() != 0 && + numInstructions != toMergeDerived->getNumberOfInstructions()) { + metacg::MCGLogger::instance().getErrConsole()->warn( + "Same function defined with different number of instructions found on merge."); + } + numInstructions = std::max(numInstructions, toMergeDerived->getNumberOfInstructions()); + } + + std::unique_ptr clone() const final { return std::unique_ptr(new NumInstructionsMD(*this)); } + + void applyMapping(const GraphMapping&) override {} + + void setNumberOfInstructions(int numInstructions) { this->numInstructions = numInstructions; } + int getNumberOfInstructions() const { return this->numInstructions; } + + private: + int numInstructions{0}; +}; +} // namespace metacg + +#endif // CAGE_NUMINSTRUCTIONSMD_H diff --git a/tools/cage/src/generator/CallGraphGenerator.cpp b/tools/cage/src/generator/CallGraphGenerator.cpp index 8071a770..122c7978 100644 --- a/tools/cage/src/generator/CallGraphGenerator.cpp +++ b/tools/cage/src/generator/CallGraphGenerator.cpp @@ -4,6 +4,7 @@ * https://github.com/tudasc/metacg/LICENSE.txt */ #include "cage/generator/CallgraphGenerator.h" +#include "cage/generator/NumInstructionsCollector.h" #include "Callgraph.h" @@ -160,6 +161,10 @@ bool Generator::run(Module& M, ModuleAnalysisManager* MA) { // Take resulting metacg call graph auto mcg = cbv.takeResult(); + // Run metadata collectors + NumInstructionsCollector nic; + nic.run(M, *mcg); + // Run registered consumers for (auto& consumer : consumers) { consumer->consumeCallGraph(*mcg); From ef046bb12848e8be147bd893f047f8cd6f664ca1 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Fri, 19 Dec 2025 14:38:44 +0100 Subject: [PATCH 22/25] [CaGe] Make export file configurable via pass option --- .../include/cage/generator/FileExporter.h | 6 ++++++ tools/cage/src/Plugin.cpp | 20 +++++++++++++++++-- tools/cage/src/generator/FileExporter.cpp | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/cage/include/cage/generator/FileExporter.h b/tools/cage/include/cage/generator/FileExporter.h index 2eadf28c..0aed0584 100644 --- a/tools/cage/include/cage/generator/FileExporter.h +++ b/tools/cage/include/cage/generator/FileExporter.h @@ -8,10 +8,16 @@ #include "cage/generator/CallGraphConsumer.h" +#include + namespace cage { class FileExporter : public CallGraphConsumer { + public: + FileExporter(std::string outfile) : outfile(outfile) {} void consumeCallGraph(metacg::Callgraph&) override; + private: + std::string outfile; }; } // namespace cage diff --git a/tools/cage/src/Plugin.cpp b/tools/cage/src/Plugin.cpp index 66be67da..ffabbe2d 100644 --- a/tools/cage/src/Plugin.cpp +++ b/tools/cage/src/Plugin.cpp @@ -18,7 +18,7 @@ using namespace llvm::cl; static OptionCategory cageOpts("CaGe"); -static cl::opt cageVerbose("cage-verbose", cl::desc("Print debugging output"), cl::init(false)); +static opt cageVerbose("cage-verbose", desc("Print debugging output"), cat(cageOpts), init(false)); static opt pta( "pta", desc("Points-to analysis of indirect calls:"), @@ -28,14 +28,30 @@ static opt pta( "Treat all available valid function signatures for a given function pointer as potential call target ")), cat(cageOpts), init(cage::PTAType::No)); +static opt cgout("cg-file", desc("Output file for the generated call graph"), cat(cageOpts), init("")); + + namespace cage { PreservedAnalyses CaGe::run(Module& M, ModuleAnalysisManager& MA) { if (cageVerbose) { outs() << "Running in verbose mode\n"; } + // First check explicit option + std::string outfile = cgout.getValue(); + if (outfile.empty()) { + // If empty, check environment variable + const auto* cgNameEnv = std::getenv("CAGE_CG"); + if (cgNameEnv) { + outfile = cgNameEnv; + } else { + // Default output file + outfile = "cage_callgraph.mcg"; + } + } + Generator gen(pta); - gen.addConsumer(std::make_unique()); + gen.addConsumer(std::make_unique(cgout)); if (!gen.run(M, &MA)) return PreservedAnalyses::all(); diff --git a/tools/cage/src/generator/FileExporter.cpp b/tools/cage/src/generator/FileExporter.cpp index 4e254744..44c1a209 100644 --- a/tools/cage/src/generator/FileExporter.cpp +++ b/tools/cage/src/generator/FileExporter.cpp @@ -15,8 +15,8 @@ void FileExporter::consumeCallGraph(metacg::Callgraph& graph) { metacg::io::JsonSink jsSink; metacg::io::VersionFourMCGWriter mcgw({{4, 0}, {"CaGe", 0, 1, MetaCG_GIT_SHA}}, true, true); mcgw.write(&graph, jsSink); - const auto* cgName = std::getenv("CAGE_CG_NAME"); - std::ofstream out(cgName ? cgName : "cage_callgraph.mcg"); + + std::ofstream out(outfile); out << jsSink.getJson().dump(4); out.flush(); out.close(); From cc36cebce42395f66d323097ef31c8398ab007bf Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Fri, 19 Dec 2025 14:49:26 +0100 Subject: [PATCH 23/25] [CaGe] Use seperate metacg-config for test purposes --- tools/cage/src/generator/FileExporter.cpp | 3 +++ tools/cage/test/CMakeLists.txt | 2 +- tools/cage/test/runCaGeTests.sh.in | 4 ++-- utils/config/CMakeLists.txt | 25 +++++++++++++++++------ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/cage/src/generator/FileExporter.cpp b/tools/cage/src/generator/FileExporter.cpp index 44c1a209..e598cf2e 100644 --- a/tools/cage/src/generator/FileExporter.cpp +++ b/tools/cage/src/generator/FileExporter.cpp @@ -5,6 +5,8 @@ */ #include "cage/generator/FileExporter.h" +#include "llvm/Support/raw_ostream.h" + #include "config.h" #include "io/MCGWriter.h" #include "io/VersionFourMCGWriter.h" @@ -16,6 +18,7 @@ void FileExporter::consumeCallGraph(metacg::Callgraph& graph) { metacg::io::VersionFourMCGWriter mcgw({{4, 0}, {"CaGe", 0, 1, MetaCG_GIT_SHA}}, true, true); mcgw.write(&graph, jsSink); + llvm::outs() << "Writing generated call graph to: " << outfile << "\n"; std::ofstream out(outfile); out << jsSink.getJson().dump(4); out.flush(); diff --git a/tools/cage/test/CMakeLists.txt b/tools/cage/test/CMakeLists.txt index 2efe0a4e..7d6186d9 100644 --- a/tools/cage/test/CMakeLists.txt +++ b/tools/cage/test/CMakeLists.txt @@ -1,4 +1,4 @@ -set(METACG_CONFIG "${CMAKE_BINARY_DIR}/utils/config/metacg-config") +set(METACG_CONFIG "${CMAKE_BINARY_DIR}/utils/config/metacg-build-config") set(TEST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") configure_file( diff --git a/tools/cage/test/runCaGeTests.sh.in b/tools/cage/test/runCaGeTests.sh.in index a5de8327..73d1af7b 100755 --- a/tools/cage/test/runCaGeTests.sh.in +++ b/tools/cage/test/runCaGeTests.sh.in @@ -63,9 +63,9 @@ function runTestCase { failed=0 tfile_out="$run_dir/$testCaseName.exe" rm -f "$tfile_out" - CAGE_CG_NAME="$cg_outfile" clang++ -g `$mcgconfig --cage --ldflags ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 + clang++ -g `$mcgconfig --cage --ldflags --pass-option "-cg-file=${cg_outfile}" ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o "$tfile_out" >> log/testrun.log 2>&1 || failed=1 if [[ $failed -ne 0 ]] || [[ $verbose -eq 1 ]]; then - echo "Link command: CAGE_CG_NAME=$cg_outfile clang++ -g `$mcgconfig --cage --ldflags ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" + echo "Link command: clang++ -g `$mcgconfig --cage --ldflags --pass-option "-cg-file=${cg_outfile}" ${addOptions}` ${addFlags} -fno-exceptions ${o_files[@]} -o $tfile_out" fi if [[ $failed -ne 0 ]]; then if [[ ! -f "$cg_outfile" ]]; then diff --git a/utils/config/CMakeLists.txt b/utils/config/CMakeLists.txt index aa61f96c..9c06dcce 100644 --- a/utils/config/CMakeLists.txt +++ b/utils/config/CMakeLists.txt @@ -1,13 +1,26 @@ -add_executable(metacg-config MCGConfig.cpp) -add_config_include(metacg-config) -add_cxxopts(metacg-config) +function(add_mcgconfig target) + cmake_parse_arguments(ARG "" "" "DEFINITIONS" ${ARGN}) + add_executable(${target} MCGConfig.cpp) + add_config_include(${target}) + add_cxxopts(${target}) + target_compile_definitions(${target} PRIVATE + INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" + ${ARG_DEFINITIONS}) +endfunction() + +# Build two versions of metacg-config: one to use inside the build tree (e.g. for tests) and one for the install tree, +# to be used by external tools. +set(MCGCONFIG_BUILD_DEFS "") +set(MCGCONFIG_INSTALL_DEFS "") -target_compile_definitions(metacg-config PRIVATE INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") if (${METACG_BUILD_GRAPH_TOOLS}) - # TODO: Currently only uses build variables - target_compile_definitions(metacg-config PRIVATE HAVE_GRAPH_TOOLS CAGE_PLUGIN="$") + list(APPEND MCGCONFIG_BUILD_DEFS HAVE_GRAPH_TOOLS CAGE_PLUGIN="$") + list(APPEND MCGCONFIG_INSTALL_DEFS HAVE_GRAPH_TOOLS + CAGE_PLUGIN="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/$") endif() +add_mcgconfig(metacg-build-config DEFINITIONS ${MCGCONFIG_BUILD_DEFS}) +add_mcgconfig(metacg-config DEFINITIONS ${MCGCONFIG_INSTALL_DEFS}) install(TARGETS metacg-config DESTINATION ${CMAKE_INSTALL_BINDIR}) From 8878f522c9340532d1a26443de19ee60175f5b57 Mon Sep 17 00:00:00 2001 From: Sebastian Kreutzer Date: Fri, 19 Dec 2025 15:27:19 +0100 Subject: [PATCH 24/25] [CaGe] Update tools README --- tools/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tools/README.md b/tools/README.md index 9a1bec46..0a6356e1 100644 --- a/tools/README.md +++ b/tools/README.md @@ -2,6 +2,49 @@ This folder contains tools for creating and merging call graphs using the MetaCG graph library. +## CaGe + +CaGe is MetaCG's link-time call graph generator. +To use it, the target applications needs to be built with (full) LTO using the LLD linker. + +### Basic Usage +Let's consider a project that consists of two source files, `example_a.cpp` and `example_b.cpp`. +A standard build process consists of a compile and a link step: +``` +# Compile step +clang++ example_a.cpp -o example_a.o +clang++ example_b.cpp -o example_b.o + +# Link step +clang++ example_a.o example_b.o -o example +``` + +Modifying this build process to generate a call graph with CaGe is straightforward. +All necessary compile flags can be generated with `metacg-config`: + +``` +# Compile step +clang++ $(metacg-config --cage --cxxflags) example_a.cpp -o example_a.o +clang++ $(metacg-config --cage --cxxflags) example_b.cpp -o example_b.o + +# Link step +clang++ $(metacg-config --cage --ldflags --pass-option -cg-file=example.mcg) example_a.o example_b.o -o example +``` + +### Build system integration +Integrating CaGe into build systems, e.g. Make and CMake, is simple. +Many Make projects already define `CXXFLAGS` and `LDFLAGS` variables, which can be extended with the respective +`metacg-config` output. +For CMake projects, the relevant options are `CMAKE_CXX_FLAGS`, `CMAKE_EXE_LINKER_FLAGS` and `CMAKE_SHARED_LINKER_FLAGS`. + +### Pass options +Pass options can be set by passing `--pass-option