Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 0 additions & 138 deletions rocq-brick-libstdcpp/proof/cpp2v-dune-gen.sh

This file was deleted.

1 change: 1 addition & 0 deletions rocq-brick-libstdcpp/proof/cpp2v-dune-gen.sh
18 changes: 9 additions & 9 deletions rocq-brick-libstdcpp/proof/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(alias test_ast)
(deps (:input inc_cassert.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cassert_cpp.v.stderr (run cpp2v -v %{input} -o inc_cassert_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cassert_cpp.v.stderr (run cpp2v -v %{input} -o inc_cassert_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cassert.cpp))
)
(subdir cctype
Expand All @@ -14,7 +14,7 @@
(alias test_ast)
(deps (:input inc_cctype.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cctype_cpp.v.stderr (run cpp2v -v %{input} -o inc_cctype_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cctype_cpp.v.stderr (run cpp2v -v %{input} -o inc_cctype_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cctype.cpp))
)
(subdir cstdlib
Expand All @@ -23,7 +23,7 @@
(alias test_ast)
(deps (:input inc_cstdlib.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_cstdlib_cpp.v.stderr (run cpp2v -v %{input} -o inc_cstdlib_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_cstdlib_cpp.v.stderr (run cpp2v -v %{input} -o inc_cstdlib_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_cstdlib.cpp))
)
(subdir mutex
Expand All @@ -32,7 +32,7 @@
(alias test_ast)
(deps (:input demo.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps demo.cpp))
)
(subdir mutex
Expand All @@ -41,7 +41,7 @@
(alias test_ast)
(deps (:input inc.hpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc.hpp))
)
(subdir mutex
Expand All @@ -50,7 +50,7 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir new
Expand All @@ -59,7 +59,7 @@
(alias test_ast)
(deps (:input inc_new.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_new_cpp.v.stderr (run cpp2v -v %{input} -o inc_new_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_new_cpp.v.stderr (run cpp2v -v %{input} -o inc_new_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc_new.cpp))
)
(subdir semaphore
Expand All @@ -68,7 +68,7 @@
(alias test_ast)
(deps (:input inc.hpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to inc_hpp.v.stderr (run cpp2v -v %{input} -o inc_hpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps inc.hpp))
)
(subdir semaphore
Expand All @@ -77,6 +77,6 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
2 changes: 1 addition & 1 deletion rocq-brick-libstdcpp/test/cpp2v-dune-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ outRule() {
if [ "$system" = 1 ]; then
universe=" (universe)"
fi
local cpp2v="cpp2v -v %{input} -o ${module}"
local cpp2v="cpp2v -v %{input} -o ${module} --no-elaborate"

if [ "$gen_names" = 1 ]; then
local names="${name}_${ext}_names.v"
Expand Down
105 changes: 102 additions & 3 deletions rocq-brick-libstdcpp/test/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir cstdlib
Expand All @@ -14,15 +14,114 @@
(alias test_ast)
(deps (:input test.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to test_cpp.v.stderr (run cpp2v -v %{input} -o test_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps test.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N12_area_cpp.v.stderr N12_area_cpp.v)
(alias test_ast)
(deps (:input N12_area.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N12_area_cpp.v.stderr (run cpp2v -v %{input} -o N12_area_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N12_area.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N1_hello_world_cpp.v.stderr N1_hello_world_cpp.v)
(alias test_ast)
(deps (:input N1_hello_world.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N1_hello_world_cpp.v.stderr (run cpp2v -v %{input} -o N1_hello_world_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N1_hello_world.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N3_input_cpp.v.stderr N3_input_cpp.v)
(alias test_ast)
(deps (:input N3_input.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N3_input_cpp.v.stderr (run cpp2v -v %{input} -o N3_input_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N3_input.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N4_sum_cpp.v.stderr N4_sum_cpp.v)
(alias test_ast)
(deps (:input N4_sum.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N4_sum_cpp.v.stderr (run cpp2v -v %{input} -o N4_sum_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N4_sum.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N4_sum_a_cpp.v.stderr N4_sum_a_cpp.v)
(alias test_ast)
(deps (:input N4_sum_a.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N4_sum_a_cpp.v.stderr (run cpp2v -v %{input} -o N4_sum_a_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N4_sum_a.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N5_swap_cpp.v.stderr N5_swap_cpp.v)
(alias test_ast)
(deps (:input N5_swap.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N5_swap_cpp.v.stderr (run cpp2v -v %{input} -o N5_swap_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N5_swap.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N5_swap_a_cpp.v.stderr N5_swap_a_cpp.v)
(alias test_ast)
(deps (:input N5_swap_a.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N5_swap_a_cpp.v.stderr (run cpp2v -v %{input} -o N5_swap_a_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N5_swap_a.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N6_print_sizeof_cpp.v.stderr N6_print_sizeof_cpp.v)
(alias test_ast)
(deps (:input N6_print_sizeof.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N6_print_sizeof_cpp.v.stderr (run cpp2v -v %{input} -o N6_print_sizeof_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N6_print_sizeof.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N8_ascii_value_cast_cpp.v.stderr N8_ascii_value_cast_cpp.v)
(alias test_ast)
(deps (:input N8_ascii_value_cast.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N8_ascii_value_cast_cpp.v.stderr (run cpp2v -v %{input} -o N8_ascii_value_cast_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N8_ascii_value_cast.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets N8_ascii_value_printf_cpp.v.stderr N8_ascii_value_printf_cpp.v)
(alias test_ast)
(deps (:input N8_ascii_value_printf.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to N8_ascii_value_printf_cpp.v.stderr (run cpp2v -v %{input} -o N8_ascii_value_printf_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps N8_ascii_value_printf.cpp))
)
(subdir geeks_for_geeks_examples
(rule
(targets iostream_cpp.v.stderr iostream_cpp.v)
(alias test_ast)
(deps (:input iostream.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to iostream_cpp.v.stderr (run cpp2v -v %{input} -o iostream_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps iostream.cpp))
)
(subdir new
(rule
(targets demo_cpp.v.stderr demo_cpp.v)
(alias test_ast)
(deps (:input demo.cpp) (glob_files_rec ../*.hpp) (universe))
(action
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v -- -std=c++20 -stdlib=libstdc++ ))))
(with-stderr-to demo_cpp.v.stderr (run cpp2v -v %{input} -o demo_cpp.v --no-elaborate -- -std=c++20 -stdlib=libstdc++ ))))
(alias (name srcs) (deps demo.cpp))
)
30 changes: 30 additions & 0 deletions rocq-brick-libstdcpp/test/geeks_for_geeks_examples/N12_area.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// C++ program to find area
// and perimeter of rectangle
#include<iostream>
using namespace std;

// Utility function
int areaRectangle(int a, int b)
{
int area = a * b;
return area;
}

int perimeterRectangle(int a, int b)
{
int perimeter = 2*(a + b);
return perimeter;
}

// Driver code
int main()
{
int a = 5;
int b = 6;
cout << "Area = " <<
areaRectangle(a, b) <<
endl;
cout << "Perimeter = " <<
perimeterRectangle(a, b);
return 0;
}
Loading