From dabe5769dd3595119dfbd33daf418d0b8f839250 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 28 Aug 2022 20:22:48 +0200 Subject: [PATCH] More programs for test. --- .github/workflows/main.yml | 35 ++++++++++++++++++++++++++ resources/examples/hello_world_many.c3 | 19 ++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 resources/examples/hello_world_many.c3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 231e1c7eb..e6d5d63c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,13 @@ jobs: cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build --config ${{ matrix.build_type }} + - name: Compile and run some examples + run: | + cd resources + ..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\hello_world_many.c3 + ..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\fannkuch-redux.c3 + ..\build\${{ matrix.build_type }}\c3c.exe compile-run examples\contextfree\boolerr.c3 + - name: Build testproject run: | cd resources/testproject @@ -79,6 +86,13 @@ jobs: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build + - name: Compile and run some examples + run: | + cd resources + ../build/c3c compile-run examples/hello_world_many.c3 + ../build/c3c compile-run examples/fannkuch-redux.c3 + ../build/c3c compile-run examples/contextfree/boolerr.c3 + - name: Build testproject run: | cd resources/testproject @@ -121,6 +135,13 @@ jobs: cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build + - name: Compile and run some examples + run: | + cd resources + ../build/c3c compile-run examples/hello_world_many.c3 + ../build/c3c compile-run examples/fannkuch-redux.c3 + ../build/c3c compile-run examples/contextfree/boolerr.c3 + - name: Build testproject run: | cd resources/testproject @@ -180,6 +201,13 @@ jobs: -DC3_LLVM_VERSION=${{matrix.llvm_version}} cmake --build build + - name: Compile and run some examples + run: | + cd resources + ../build/c3c compile-run examples/hello_world_many.c3 + ../build/c3c compile-run examples/fannkuch-redux.c3 + ../build/c3c compile-run examples/contextfree/boolerr.c3 + - name: Build testproject run: | cd resources/testproject @@ -238,6 +266,13 @@ jobs: cmake -B build -G Ninja -DC3_LLVM_VERSION=${{matrix.llvm_version}} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build + - name: Compile and run some examples + run: | + cd resources + ../build/c3c compile-run examples/hello_world_many.c3 + ../build/c3c compile-run examples/fannkuch-redux.c3 + ../build/c3c compile-run examples/contextfree/boolerr.c3 + - name: Build testproject run: | cd resources/testproject diff --git a/resources/examples/hello_world_many.c3 b/resources/examples/hello_world_many.c3 new file mode 100644 index 000000000..b37edf2a8 --- /dev/null +++ b/resources/examples/hello_world_many.c3 @@ -0,0 +1,19 @@ +import std::io; + +fn void main() +{ + char[][] greetings = { + "Hello, world!", + "¡Hola Mundo!", + "Γειά σου Κόσμε!", + "Привет, мир!", + "こんにちは世界!", + "你好世界!", + "नमस्ते दुनिया!", + "👋🌎!" + }; + foreach (greeting : greetings) + { + io::println(greeting); + } +} \ No newline at end of file