Skip to content

Commit

Permalink
UTBot code analysis add tests and codeAnalysis information
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-utkin authored Jul 28, 2022
1 parent b272039 commit 577e8e4
Show file tree
Hide file tree
Showing 17 changed files with 2,570 additions and 0 deletions.
858 changes: 858 additions & 0 deletions codeAnalysis/project_code_analysis.sarif

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions tests/lib/__libfunc_obj.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org

$(shell mkdir -p $(BUILD_DIR) >/dev/null)
$(shell mkdir -p $(BUILD_DIR)/dependencies >/dev/null)
.FORCE :

# gtest
$(BUILD_DIR)/googletest/gtest-all.cc.o : $(GTEST)/googletest/src/gtest-all.cc
mkdir -p $(BUILD_DIR)/googletest && $(CLANGXX) -I$(GTEST)/googletest/include -I$(GTEST)/googletest -o $(BUILD_DIR)/googletest/gtest-all.cc.o -c -std=c++11 -fPIC $(GTEST)/googletest/src/gtest-all.cc
export GTEST_ALL = $(BUILD_DIR)/googletest/gtest-all.cc.o
$(BUILD_DIR)/googletest/gtest_main.cc.o : $(GTEST)/googletest/src/gtest_main.cc
mkdir -p $(BUILD_DIR)/googletest && $(CLANGXX) -I$(GTEST)/googletest/include -I$(GTEST)/googletest -o $(BUILD_DIR)/googletest/gtest_main.cc.o -c -std=c++11 -fPIC $(GTEST)/googletest/src/gtest_main.cc
export GTEST_MAIN = $(BUILD_DIR)/googletest/gtest_main.cc.o
# /gtest
$(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o : $(PROJECT_DIR)/tests/wrapper/src/main_wrapper.c $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.d
mkdir -p $(BUILD_DIR)/dependencies/tests/wrapper/src
mkdir -p $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src && C_INCLUDE_PATH=$UTBOT_LAUNCH_INCLUDE_PATH $(CLANG) -iquote$(PROJECT_DIR)/src -MT $@ -MMD -MP -MF $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.Td -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -fno-sanitize-recover=all -fprofile-instr-generate -fcoverage-mapping -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -O0 -c -std=gnu11 -o $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(PROJECT_DIR)/tests/wrapper/src/main_wrapper.c
mv -f $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.Td $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.d
$(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o : $(PROJECT_DIR)/tests/wrapper/lib/libfunc_wrapper.c $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.d
mkdir -p $(BUILD_DIR)/dependencies/tests/wrapper/lib
mkdir -p $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir && C_INCLUDE_PATH=$UTBOT_LAUNCH_INCLUDE_PATH $(CLANG) -iquote$(PROJECT_DIR)/lib -MT $@ -MMD -MP -MF $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.Td -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -fno-sanitize-recover=all -fprofile-instr-generate -fcoverage-mapping -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -O0 -c -std=gnu11 -o $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o $(PROJECT_DIR)/tests/wrapper/lib/libfunc_wrapper.c
mv -f $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.Td $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.d
$(BUILD_DIR)/recompiled/lib/liblib.a : $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o
rm -f $(BUILD_DIR)/recompiled/lib/liblib.a
mkdir -p $(BUILD_DIR)/recompiled/lib && $(AR) qc -o $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o
$(BUILD_DIR)/recompiled/c-example-mini.o : $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o
rm -f $(BUILD_DIR)/recompiled/c-example-mini.o
mkdir -p $(BUILD_DIR)/recompiled && $(LD) -r $(LDFLAGS) -fuse-ld=gold -o $(BUILD_DIR)/recompiled/c-example-mini.o $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(BUILD_DIR)/recompiled/lib/liblib.a && objcopy --redefine-sym main=main__ $(BUILD_DIR)/recompiled/c-example-mini.o
$(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o : $(PROJECT_DIR)/tests/lib/libfunc_dot_c_test.cpp
mkdir -p $(BUILD_DIR)/test_objects/lib && $(CLANGXX) -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -I$(GTEST)/googletest/include -O0 -c -o $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(PROJECT_DIR)/tests/lib/libfunc_dot_c_test.cpp
$(BUILD_DIR)/recompiled/lib/libfunc : $(GTEST_MAIN) $(GTEST_ALL) $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/c-example-mini.o $(BUILD_DIR)/recompiled/lib/liblib.a
mkdir -p $(BUILD_DIR)/recompiled/lib && $(CLANGXX) $(LDFLAGS) -L$(BUILD_DIR)/recompiled $(GTEST_MAIN) $(GTEST_ALL) $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/c-example-mini.o $(BUILD_DIR)/recompiled/lib/liblib.a -lpthread -fprofile-instr-generate -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -O0 -fuse-ld=gold -o $(BUILD_DIR)/recompiled/lib/libfunc
bin : .FORCE
echo $(BUILD_DIR)/recompiled/lib/libfunc
build : $(BUILD_DIR)/recompiled/lib/libfunc

run : build
cd "$(BUILD_DIR)" && PATH=$$PATH:$(pwd) UBSAN_OPTIONS=print_stacktrace=1,report_error_type=1 ASAN_OPTIONS=debug=1,detect_odr_violation=1,detect_stack_use_after_return=1,detect_leaks=0 $(BUILD_DIR)/recompiled/lib/libfunc $(GTEST_FLAGS)
clean :
rm -rf $(BUILD_DIR) $(BUILD_DIR)/dependencies $(BUILD_DIR)/googletest/gtest-all.cc.o $(BUILD_DIR)/googletest/gtest_main.cc.o $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/c-example-mini.o $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/lib/libfunc
.PRECIOUS: $(BUILD_DIR)/dependencies/%.d
$(BUILD_DIR)/dependencies/%.d: ;

-include $(BUILD_DIR)/dependencies/*.Td $(BUILD_DIR)/dependencies/*.d

45 changes: 45 additions & 0 deletions tests/lib/__libfunc_shared.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org

$(shell mkdir -p $(BUILD_DIR) >/dev/null)
$(shell mkdir -p $(BUILD_DIR)/dependencies >/dev/null)
.FORCE :

# gtest
$(BUILD_DIR)/googletest/gtest-all.cc.o : $(GTEST)/googletest/src/gtest-all.cc
mkdir -p $(BUILD_DIR)/googletest && $(CLANGXX) -I$(GTEST)/googletest/include -I$(GTEST)/googletest -o $(BUILD_DIR)/googletest/gtest-all.cc.o -c -std=c++11 -fPIC $(GTEST)/googletest/src/gtest-all.cc
export GTEST_ALL = $(BUILD_DIR)/googletest/gtest-all.cc.o
$(BUILD_DIR)/googletest/gtest_main.cc.o : $(GTEST)/googletest/src/gtest_main.cc
mkdir -p $(BUILD_DIR)/googletest && $(CLANGXX) -I$(GTEST)/googletest/include -I$(GTEST)/googletest -o $(BUILD_DIR)/googletest/gtest_main.cc.o -c -std=c++11 -fPIC $(GTEST)/googletest/src/gtest_main.cc
export GTEST_MAIN = $(BUILD_DIR)/googletest/gtest_main.cc.o
# /gtest
$(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o : $(PROJECT_DIR)/tests/wrapper/src/main_wrapper.c $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.d
mkdir -p $(BUILD_DIR)/dependencies/tests/wrapper/src
mkdir -p $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src && C_INCLUDE_PATH=$UTBOT_LAUNCH_INCLUDE_PATH $(CLANG) -iquote$(PROJECT_DIR)/src -MT $@ -MMD -MP -MF $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.Td -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -fno-sanitize-recover=all -fprofile-instr-generate -fcoverage-mapping -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -O0 -c -std=gnu11 -o $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(PROJECT_DIR)/tests/wrapper/src/main_wrapper.c
mv -f $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.Td $(BUILD_DIR)/dependencies/tests/wrapper/src/main_wrapper.c.d
$(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o : $(PROJECT_DIR)/tests/wrapper/lib/libfunc_wrapper.c $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.d
mkdir -p $(BUILD_DIR)/dependencies/tests/wrapper/lib
mkdir -p $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir && C_INCLUDE_PATH=$UTBOT_LAUNCH_INCLUDE_PATH $(CLANG) -iquote$(PROJECT_DIR)/lib -MT $@ -MMD -MP -MF $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.Td -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -fno-sanitize-recover=all -fprofile-instr-generate -fcoverage-mapping -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -O0 -c -std=gnu11 -o $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o $(PROJECT_DIR)/tests/wrapper/lib/libfunc_wrapper.c
mv -f $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.Td $(BUILD_DIR)/dependencies/tests/wrapper/lib/libfunc_wrapper.c.d
$(BUILD_DIR)/recompiled/lib/liblib.a : $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o
rm -f $(BUILD_DIR)/recompiled/lib/liblib.a
mkdir -p $(BUILD_DIR)/recompiled/lib && $(AR) qc -o $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o
$(BUILD_DIR)/recompiled/libc-example-mini.so : $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o
rm -f $(BUILD_DIR)/recompiled/libc-example-mini.so
mkdir -p $(BUILD_DIR)/recompiled && $(CLANG) -shared $(LDFLAGS) -O0 -Wl,--allow-multiple-definition -fprofile-instr-generate -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -Wl,--whole-archive -fuse-ld=gold -o $(BUILD_DIR)/recompiled/libc-example-mini.so $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(BUILD_DIR)/recompiled/lib/liblib.a -Wl,--no-whole-archive
$(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o : $(PROJECT_DIR)/tests/lib/libfunc_dot_c_test.cpp
mkdir -p $(BUILD_DIR)/test_objects/lib && $(CLANGXX) -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fPIC -I$(GTEST)/googletest/include -O0 -c -o $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(PROJECT_DIR)/tests/lib/libfunc_dot_c_test.cpp
$(BUILD_DIR)/recompiled/lib/libfunc : $(GTEST_MAIN) $(GTEST_ALL) $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/libc-example-mini.so $(BUILD_DIR)/recompiled/lib/liblib.a
mkdir -p $(BUILD_DIR)/recompiled/lib && $(CLANGXX) $(LDFLAGS) -L$(BUILD_DIR)/recompiled $(GTEST_MAIN) $(GTEST_ALL) $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/libc-example-mini.so $(BUILD_DIR)/recompiled/lib/liblib.a -lpthread -fprofile-instr-generate -fsanitize=alignment,builtin,bounds,enum,float-cast-overflow,float-divide-by-zero,implicit-unsigned-integer-truncation,implicit-signed-integer-truncation,implicit-integer-sign-change,integer-divide-by-zero,nonnull-attribute,null,nullability-arg,nullability-assign,nullability-return,pointer-overflow,return,returns-nonnull-attribute,shift,unreachable,vla-bound -fsanitize=address -O0 -fuse-ld=gold -o $(BUILD_DIR)/recompiled/lib/libfunc
bin : .FORCE
echo $(BUILD_DIR)/recompiled/libc-example-mini.so
build : $(BUILD_DIR)/recompiled/lib/libfunc

run : build
cd "$(BUILD_DIR)" && PATH=$$PATH:$(pwd) UBSAN_OPTIONS=print_stacktrace=1,report_error_type=1 ASAN_OPTIONS=debug=1,detect_odr_violation=1,detect_stack_use_after_return=1,detect_leaks=0 $(BUILD_DIR)/recompiled/lib/libfunc $(GTEST_FLAGS)
clean :
rm -rf $(BUILD_DIR) $(BUILD_DIR)/dependencies $(BUILD_DIR)/googletest/gtest-all.cc.o $(BUILD_DIR)/googletest/gtest_main.cc.o $(BUILD_DIR)/recompiled/CMakeFiles/c-example-mini.dir/src/main.c.o $(BUILD_DIR)/recompiled/lib/CMakeFiles/lib.dir/libfunc.c.o $(BUILD_DIR)/recompiled/lib/liblib.a $(BUILD_DIR)/recompiled/libc-example-mini.so $(BUILD_DIR)/test_objects/lib/libfunc_dot_c_test.cpp.o $(BUILD_DIR)/recompiled/lib/libfunc
.PRECIOUS: $(BUILD_DIR)/dependencies/%.d
$(BUILD_DIR)/dependencies/%.d: ;

-include $(BUILD_DIR)/dependencies/*.Td $(BUILD_DIR)/dependencies/*.d

49 changes: 49 additions & 0 deletions tests/lib/libfunc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org

# This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org

export PROJECT_DIR_RELATIVE_TO_MAKEFILE = ../..
export MAKEFILE_DIR = $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
export PROJECT_DIR = $(MAKEFILE_DIR)/$(PROJECT_DIR_RELATIVE_TO_MAKEFILE)
export BUILD_RELATIVE = build/utbot_build
export BUILD_DIR = $(PROJECT_DIR)/$(BUILD_RELATIVE)
# This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org

ifndef UTBOT_ALL
export UTBOT_ALL = $(PROJECT_DIR)/utbot-release-2022.7.3/utbot_distr
endif
export UTBOT_INSTALL = $(UTBOT_ALL)/install
export ACCESS_PRIVATE_LIB = $(UTBOT_ALL)/access_private/include
export UTBOT_DEBS_INSTALL_DIR = $(UTBOT_ALL)/debs-install
export ASAN_LIB = $(UTBOT_DEBS_INSTALL_DIR)/usr/lib/x86_64-linux-gnu/libasan.so.5.0.0
ifneq ("$(wildcard $(UTBOT_INSTALL)/bin/clang-10)\", "")
export CLANG = $(UTBOT_INSTALL)/bin/clang-10
endif
ifneq ("$(wildcard $(UTBOT_INSTALL)/bin/clang++)\", "")
export CLANGXX = $(UTBOT_INSTALL)/bin/clang++
endif
export GCC = gcc
export GXX = g++
ifndef AR
export AR = $(UTBOT_DEBS_INSTALL_DIR)/usr/bin/x86_64-linux-gnu-ar
endif
ifndef LD_GOLD
export LD_GOLD = $(UTBOT_DEBS_INSTALL_DIR)/usr/bin/x86_64-linux-gnu-ld.gold
endif
ifndef LD
export LD = $(UTBOT_DEBS_INSTALL_DIR)/usr/bin/x86_64-linux-gnu-ld.bfd
endif
ifneq ("$(wildcard $(UTBOT_ALL)/gtest)\", "")
export GTEST = $(UTBOT_ALL)/gtest
endif
.FORCE :

bin : .FORCE
$(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_shared.mk bin
build : .FORCE
$(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_shared.mk build || $(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_obj.mk build
run : .FORCE
$(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_shared.mk build && { $(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_shared.mk run; exit $$?; } || { $(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_obj.mk build && { $(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_obj.mk run; exit $$?; } }
clean : .FORCE
$(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_shared.mk clean
$(MAKE) -f $(PROJECT_DIR)/tests/lib/__libfunc_obj.mk clean
27 changes: 27 additions & 0 deletions tests/lib/libfunc_dot_c_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org
*/

#include "libfunc_dot_c_test.h"

#include "gtest/gtest.h"
namespace UTBot {
static const float utbot_abs_error = 1e-6;


#pragma region regression
TEST(regression, libfunc_test_1)
{
int actual = libfunc(1);
EXPECT_EQ(1, actual);
}

#pragma endregion
#pragma region error
TEST(error, libfunc_test_2)
{
libfunc(0);
}

#pragma endregion
}
148 changes: 148 additions & 0 deletions tests/lib/libfunc_dot_c_test.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/*
* This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org
*/

namespace UTBot {
#define typeid typeid_
#define throw throw_
#define true true_
#define thread_local thread_local_
#define template template_
#define static_cast static_cast_
#define requires requires_
#define public public_
#define protected protected_
#define reflexpr reflexpr_
#define operator operator_
#define noexcept noexcept_
#define new new_
#define namespace namespace_
#define mutable mutable_
#define try try_
#define private private_
#define friend friend_
#define false false_
#define virtual virtual_
#define nullptr nullptr_
#define export export_
#define this this_
#define explicit explicit_
#define typename typename_
#define delete delete_
#define decltype decltype_
#define co_yield co_yield_
#define co_return co_return_
#define co_await co_await_
#define const_cast const_cast_
#define constinit constinit_
#define consteval consteval_
#define class class_
#define synchronized synchronized_
#define char32_t char32_t_
#define constexpr constexpr_
#define char8_t char8_t_
#define catch catch_
#define using using_
#define char16_t char16_t_
#define atomic_noexcept atomic_noexcept_
#define concept concept_
#define atomic_commit atomic_commit_
#define static_assert static_assert_
#define atomic_cancel atomic_cancel_
#define dynamic_cast dynamic_cast_
#define asm asm_
#define reinterpret_cast reinterpret_cast_
#define alignof alignof_
#define alignas alignas_
#define _Alignas(x)
#define _Atomic(x) x
#define _Bool bool
#define _Noreturn
#define _Thread_local thread_local

struct __va_list_tag;

extern "C" int libfunc_lib_libfunc_c(int a);
static int libfunc(int a) {
return libfunc_lib_libfunc_c(a);
}

#ifdef wchar_t
#undef wchar_t
#endif

}
#undef typeid
#undef throw
#undef true
#undef thread_local
#undef template
#undef static_cast
#undef requires
#undef public
#undef protected
#undef reflexpr
#undef operator
#undef noexcept
#undef new
#undef namespace
#undef mutable
#undef try
#undef private
#undef friend
#undef false
#undef virtual
#undef nullptr
#undef export
#undef this
#undef explicit
#undef typename
#undef delete
#undef decltype
#undef co_yield
#undef co_return
#undef co_await
#undef const_cast
#undef constinit
#undef consteval
#undef class
#undef synchronized
#undef char32_t
#undef constexpr
#undef char8_t
#undef catch
#undef using
#undef char16_t
#undef atomic_noexcept
#undef concept
#undef atomic_commit
#undef static_assert
#undef atomic_cancel
#undef dynamic_cast
#undef asm
#undef reinterpret_cast
#undef alignof
#undef alignas
#include <cstring>

#include <unistd.h>


void utbot_redirect_stdin(const char* buf, int &res) {
int fds[2];
if (pipe(fds) == -1) {
res = -1;
return;
}
close(STDIN_FILENO);
dup2(fds[0], STDIN_FILENO);
write(fds[1], buf, 64);
close(fds[1]);
}

template<typename T, size_t N>
T from_bytes(const char (&bytes)[N]) {
T result;
std::memcpy(&result, bytes, sizeof(result));
return result;
}
Loading

0 comments on commit 577e8e4

Please sign in to comment.