From 19431a843d038fb8b5c2c1123163197585c8c896 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:14:50 +0300 Subject: [PATCH 01/26] [CI] Implement basic CI --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..67b435df9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,13 @@ +name: CI build and test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: CMake configure + run: cmake -B bld + - name: CMake build + run: cmake --build bld $(nproc) From 4bcf37793db721a89d270bf8961f9f8fca6f3372 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:23:28 +0300 Subject: [PATCH 02/26] [CI] Fix parallel jobs --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67b435df9..8920fb95b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,4 +10,4 @@ jobs: - name: CMake configure run: cmake -B bld - name: CMake build - run: cmake --build bld $(nproc) + run: cmake --build bld -j $(nproc) From 41ed02872809b397499c269f4211ae5744b895e4 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:44:03 +0300 Subject: [PATCH 03/26] [CI] Add basic windows build --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8920fb95b..982d62025 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,11 +2,22 @@ name: CI build and test on: [push, pull_request] +defaults: + run: + shell: bash + jobs: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 + - name: Add clang path to $PATH env + shell: bash + if: runner.os == 'Windows' + run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: CMake configure run: cmake -B bld - name: CMake build From 8d9ff26c372879a08c4b40cd6c88659193254df3 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:45:27 +0300 Subject: [PATCH 04/26] [CI] Fix strategy matrix --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 982d62025..c1afce804 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,11 @@ defaults: shell: bash jobs: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] build: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 - name: Add clang path to $PATH env From 0ca3c63d6e147b8adcbaaaf98c7906f623e23999 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:49:15 +0300 Subject: [PATCH 05/26] [CI] Remove redundant `shell` in setup Windows env vars --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1afce804..ca413086e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ jobs: steps: - uses: actions/checkout@v7 - name: Add clang path to $PATH env - shell: bash if: runner.os == 'Windows' run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: CMake configure From 2d412e99d9f828cbad49b868365a7df15df98b76 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:52:26 +0300 Subject: [PATCH 06/26] [CI] Simplify workflow file. Use Clang on Windows build --- .github/workflows/ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca413086e..d495cb3ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,17 +7,20 @@ defaults: shell: bash jobs: - build: - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} + build-linux: + runs-on: ubuntu-latest steps: + - uses: actions/checkout@v7 + - name: CMake configure + run: cmake -B bld + - name: CMake build + run: cmake --build bld -j $(nproc) + build-windows: + runs-on: windows-latest - uses: actions/checkout@v7 - name: Add clang path to $PATH env - if: runner.os == 'Windows' run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: CMake configure - run: cmake -B bld + run: cmake -B bld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - name: CMake build run: cmake --build bld -j $(nproc) From 1f03ddb775e25374331d8701ed33d2ed22b38dae Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 14:53:54 +0300 Subject: [PATCH 07/26] [CI] Add jobs.build-windows.steps label --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d495cb3ff..1a07f0819 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: run: cmake --build bld -j $(nproc) build-windows: runs-on: windows-latest + steps: - uses: actions/checkout@v7 - name: Add clang path to $PATH env run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV From 6f9264f661b61105556c86af888b9255a171ac03 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 15:03:27 +0300 Subject: [PATCH 08/26] [CI] Use CMake Ninja generator. ClangCL on windows --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a07f0819..e2d97f1aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v7 - name: CMake configure - run: cmake -B bld + run: cmake -G Ninja -B bld - name: CMake build run: cmake --build bld -j $(nproc) build-windows: @@ -22,6 +22,6 @@ jobs: - name: Add clang path to $PATH env run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: CMake configure - run: cmake -B bld -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl - name: CMake build run: cmake --build bld -j $(nproc) From d733de7e900a3f34fec613d30b7d295c5079bde9 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 15:15:30 +0300 Subject: [PATCH 09/26] [CI] Windows fixes --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d97f1aa..c6aabd56d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,10 +17,11 @@ jobs: run: cmake --build bld -j $(nproc) build-windows: runs-on: windows-latest + defaults: + run: + shell: pwsh steps: - uses: actions/checkout@v7 - - name: Add clang path to $PATH env - run: echo "PATH=$PATH:C:\msys64\mingw64\bin" >> $GITHUB_ENV - name: CMake configure run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl - name: CMake build From 072d7ab022180ee35df01c5054a60f7f9b80a0c6 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 15:18:51 +0300 Subject: [PATCH 10/26] [CI/Windows] Disable C++ modules scanning --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6aabd56d..b507f8f73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,6 @@ jobs: steps: - uses: actions/checkout@v7 - name: CMake configure - run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl + run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_SCAN_FOR_MODULES=OFF - name: CMake build run: cmake --build bld -j $(nproc) From 4e30d62b96b4dc8679795d220b3046593e500788 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 15:22:55 +0300 Subject: [PATCH 11/26] [CI/Windows] Do not build libfmt module library --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b507f8f73..4703c4e61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,6 @@ jobs: steps: - uses: actions/checkout@v7 - name: CMake configure - run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_SCAN_FOR_MODULES=OFF + run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DFMT_MODULE=OFF - name: CMake build run: cmake --build bld -j $(nproc) From 276d236562bc28a708acb5c824861d6534ab89a2 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 16:32:37 +0300 Subject: [PATCH 12/26] [CI] Testing --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4703c4e61..e55eef4c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,17 @@ jobs: run: cmake -G Ninja -B bld - name: CMake build run: cmake --build bld -j $(nproc) + - name: Setup Test suite dependencies + run: sudo apt-get install -y emacs-nox llvm clang libc++-dev + - name: Configure Test suite using CMake + working-directory: ./tst + run: cmake -G Ninja -B bld + - name: Build Test suite + working-directory: ./tst + run: cmake --build bld + - name: Test + working-directory: ./tst + run: cmake --build bld -t test build-windows: runs-on: windows-latest defaults: From 7a6665085be0086a373773c51914f70a6baac771 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 16:44:44 +0300 Subject: [PATCH 13/26] [CI/Linux] Install LLVM v22 toolchain instead of v18 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55eef4c3..3f2223389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: CMake build run: cmake --build bld -j $(nproc) - name: Setup Test suite dependencies - run: sudo apt-get install -y emacs-nox llvm clang libc++-dev + run: sudo apt-get install -y emacs-nox llvm-22 clang-22 libc++-22-dev - name: Configure Test suite using CMake working-directory: ./tst run: cmake -G Ninja -B bld From 7389163f1fe0ebc0d5af06075d0d7be679850729 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 21:46:19 +0300 Subject: [PATCH 14/26] [CI/Linux] EXPERIMENT: use fedora:latest image --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f2223389..52d88bd61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,18 @@ defaults: jobs: build-linux: runs-on: ubuntu-latest + container: + image: fedora:latest steps: - uses: actions/checkout@v7 + - name: Install dependencies + run: sudo dnf install cmake gcc gcc-c++ git libstdc++-devel make - name: CMake configure run: cmake -G Ninja -B bld - name: CMake build run: cmake --build bld -j $(nproc) - name: Setup Test suite dependencies - run: sudo apt-get install -y emacs-nox llvm-22 clang-22 libc++-22-dev + run: sudo dnf install emacs libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ - name: Configure Test suite using CMake working-directory: ./tst run: cmake -G Ninja -B bld From 36a5acfc7cd8ed18823e5a757a7a4b3bce4f6f76 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 21:49:44 +0300 Subject: [PATCH 15/26] [CI/Linux] `-y` in `dnf install`s --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52d88bd61..daf96934a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,13 +14,13 @@ jobs: steps: - uses: actions/checkout@v7 - name: Install dependencies - run: sudo dnf install cmake gcc gcc-c++ git libstdc++-devel make + run: sudo dnf install -y cmake gcc gcc-c++ git libstdc++-devel make - name: CMake configure run: cmake -G Ninja -B bld - name: CMake build run: cmake --build bld -j $(nproc) - name: Setup Test suite dependencies - run: sudo dnf install emacs libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ + run: sudo dnf install -y emacs libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ - name: Configure Test suite using CMake working-directory: ./tst run: cmake -G Ninja -B bld From 3372290719420d1ce8c21c0b7925b7faad858d45 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 21:54:13 +0300 Subject: [PATCH 16/26] [CI/Linux] install `Ninja` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf96934a..33a99a3db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v7 - name: Install dependencies - run: sudo dnf install -y cmake gcc gcc-c++ git libstdc++-devel make + run: sudo dnf install -y cmake gcc gcc-c++ git libstdc++-devel make ninja - name: CMake configure run: cmake -G Ninja -B bld - name: CMake build From 50cb5680ce3ff97b3381bd6cf85218e0539b6735 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 22:01:04 +0300 Subject: [PATCH 17/26] [CI/Linux/Test/Deps] `emacs` -> `emacs-nw` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33a99a3db..f0e2aad92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: CMake build run: cmake --build bld -j $(nproc) - name: Setup Test suite dependencies - run: sudo dnf install -y emacs libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ + run: sudo dnf install -y emacs-nw libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ - name: Configure Test suite using CMake working-directory: ./tst run: cmake -G Ninja -B bld From 81c79778946255d0f0af8144dd0dadd3792a1431 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Thu, 9 Jul 2026 22:02:25 +0300 Subject: [PATCH 18/26] [CI] Disable LTO when compiling --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0e2aad92..dc953460a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,14 +16,14 @@ jobs: - name: Install dependencies run: sudo dnf install -y cmake gcc gcc-c++ git libstdc++-devel make ninja - name: CMake configure - run: cmake -G Ninja -B bld + run: cmake -G Ninja -B bld -DUSE_LTO=OFF - name: CMake build run: cmake --build bld -j $(nproc) - name: Setup Test suite dependencies run: sudo dnf install -y emacs-nw libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ - name: Configure Test suite using CMake working-directory: ./tst - run: cmake -G Ninja -B bld + run: cmake -G Ninja -B bld -DUSE_LTO=OFF - name: Build Test suite working-directory: ./tst run: cmake --build bld @@ -38,6 +38,6 @@ jobs: steps: - uses: actions/checkout@v7 - name: CMake configure - run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DFMT_MODULE=OFF + run: cmake -G Ninja -B bld -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_CXX_SCAN_FOR_MODULES=OFF -DFMT_MODULE=OFF -DUSE_LTO=OFF - name: CMake build run: cmake --build bld -j $(nproc) From eef941580566f362f3309e24f16b3bae62b6e771 Mon Sep 17 00:00:00 2001 From: Lens_r Date: Thu, 9 Jul 2026 23:53:43 -0700 Subject: [PATCH 19/26] [LCCJson] Missing Include --- inc/lccjson/lccjson.hh | 9 +++++---- lib/lccjson/lccjson.cc | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/lccjson/lccjson.hh b/inc/lccjson/lccjson.hh index 013196bd8..60fd3e86d 100644 --- a/inc/lccjson/lccjson.hh +++ b/inc/lccjson/lccjson.hh @@ -2,13 +2,14 @@ #define LCCJSON_HH #include +#include #include #include -struct JSONProperty; /** (!) forward declaration **/ -struct JSONObject; /** (!) forward declaration **/ -struct JSONArray; /** (!) forward declaration **/ -struct JSONItem; /** (!) forward declaration **/ +struct JSONProperty; /** (!) Forward Declarations **/ +struct JSONObject; +struct JSONArray; +struct JSONItem; struct JSONObject { std::vector properties; diff --git a/lib/lccjson/lccjson.cc b/lib/lccjson/lccjson.cc index e4612058b..a12e9005d 100644 --- a/lib/lccjson/lccjson.cc +++ b/lib/lccjson/lccjson.cc @@ -6,6 +6,7 @@ #include #include #include +#include #include #include From dbcd162fe118aaa098db07308e3427f4cde83dfb Mon Sep 17 00:00:00 2001 From: Lens_r Date: Thu, 9 Jul 2026 23:54:16 -0700 Subject: [PATCH 20/26] [Meta/Build] Fix `clang-cl` `CMAKE_CXX_COMPILER_ID` issues --- CMakeLists.txt | 165 ++++++++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 69 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2928e6d1f..ada294a57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.28) project(LCC VERSION 4.20.0 LANGUAGES C CXX) # User Option(s) @@ -150,6 +150,20 @@ if (TIME_TRACE) endif() endif() +# Enable AddressSanitizer if requested +if (USE_ASAN) + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) + add_compile_definitions(-DUSE_ASAN=1) +endif() + +# Enable UndefinedBehaviourSanitizer if requested +if (USE_UBSAN) + add_compile_options(-fsanitize=undefined) + add_link_options(-fsanitize=undefined) + add_compile_definitions(-DUSE_UBSAN=1) +endif() + # Output HTML as well as JS if compiling with emscripten (for wasm) if (EMSCRIPTEN) # Disable "native" optimisation. @@ -188,9 +202,43 @@ endif() # ============================================================================ add_library(options INTERFACE) -# Flags for Clang and GCC. -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(options INTERFACE +# Compiler Command Line Identification +set( + CXX_COMPILER_IS_GNULIKE OFF + CACHE BOOL + "Whether or not the compiler accepts GNU-like command line" +) +if( + CMAKE_CXX_COMPILER_ID STREQUAL "GNU" + OR ( + CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" + ) + ) + set(CXX_COMPILER_IS_GNULIKE ON) +endif() + +set( + CXX_COMPILER_IS_MSVCLIKE + CACHE BOOL + "Whether or not the compiler accepts MSVC-like command line" + OFF +) +if( + MSVC + OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" + OR ( + CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" + ) + ) + set(CXX_COMPILER_IS_MSVCLIKE ON) +endif() + +# GNU-like Flags +if(CXX_COMPILER_IS_GNULIKE) + target_compile_options( + options INTERFACE # Warnings. -Wall -Wextra # Enable ‘all’ warnings. -Wpedantic @@ -238,10 +286,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clan target_compile_options(options INTERFACE $<$:-march=native> ) + target_link_options(options INTERFACE + $<$:-march=native> + ) endif() endif() -# Additional flags for GCC. +# Additional flags for GCC (not just GNU-like compilers, GCC only). if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(options INTERFACE -Wlogical-op # Duplicate or unintended logical operators. @@ -257,6 +308,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(options INTERFACE -Werror=dangling -Werror=return-stack-address + -Wno-unused-private-field ) endif() @@ -286,54 +338,22 @@ if (WIN32) ) endif() -# Debug/Release flags. -if (NOT MSVC) +# backtrace/backtrace_symbols needs this to print function names instead +# of addresses. +if (CXX_COMPILER_IS_GNULIKE) + # clang spits out "unused argument -rdynamic" when compiling object files if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - # backtrace/backtrace_symbols needs this to print function names instead - # of addresses. - target_compile_options(options INTERFACE $<$:-rdynamic>) - else() - target_compile_options(options INTERFACE -Wno-unused-private-field) - endif() - - target_compile_options(options INTERFACE - $<$:-O0 -g3 -ggdb3> - $<$:-O3> - ) - target_link_options(options INTERFACE - $<$:-O0 -g3 -ggdb3 -rdynamic> - $<$:-O3> - ) - - if (NATIVE_OPT) - target_compile_options(options INTERFACE - $<$:-march=native> - ) - target_link_options(options INTERFACE - $<$:-march=native> + target_compile_options( + options INTERFACE + $<$:-rdynamic> ) endif() -else() - target_compile_options(options INTERFACE - $<$:/Od> - $<$:/O2> + target_link_options( + options INTERFACE + $<$:-rdynamic> ) endif() -# Enable AddressSanitizer if requested -if (USE_ASAN) - target_compile_options(options INTERFACE -fsanitize=address) - target_link_options(options INTERFACE -fsanitize=address) - target_compile_definitions(options INTERFACE -DUSE_ASAN=1) -endif() - -# Enable UndefinedBehaviourSanitizer if requested -if (USE_UBSAN) - target_compile_options(options INTERFACE -fsanitize=undefined) - target_link_options(options INTERFACE -fsanitize=undefined) - target_compile_definitions(options INTERFACE -DUSE_UBSAN=1) -endif() - # ============================================================================ # Dependencies # ============================================================================ @@ -350,17 +370,18 @@ FetchContent_Declare( GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 12.2.0 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/fmt" + EXCLUDE_FROM_ALL ) FetchContent_MakeAvailable(fmtlib) target_include_directories(options INTERFACE ${fmtlib_SOURCE_DIR}/include) # Link against libfmt. -target_link_libraries(options INTERFACE fmt) +target_link_libraries(options INTERFACE fmt::fmt) -# Add ‘include’ as an include dir. +# Add top level include directory. target_include_directories(options INTERFACE inc) -# Do not link with libm (math) when target is windows executable. +# Link with libm (math), if necessary. if (NOT WIN32) target_link_libraries(options INTERFACE m) endif() @@ -375,6 +396,16 @@ endif() # default, and I don't take kindly to those not willing to put in the # effort ơ_ơ. +# Simple JSON Library (freestanding) +add_library( + liblccjson + inc/lccjson/lccjson.hh + lib/lccjson/lccjson.cc +) +target_include_directories(liblccjson PUBLIC inc) +target_link_libraries(liblccjson PRIVATE options) + +# LCC Base Library (freestanding) add_library( liblccbase inc/lccbase/assert.hh @@ -406,7 +437,10 @@ add_library( lib/object/generic_to_elf.cc ) target_include_directories(object PUBLIC inc) -target_link_libraries(object PRIVATE options) +target_link_libraries( + object PRIVATE + options liblccbase +) # Add the main lcc library. add_library( @@ -479,18 +513,21 @@ add_library( ) target_include_directories(liblcc PUBLIC inc) set_target_properties(liblcc PROPERTIES OUTPUT_NAME lcc) -target_link_libraries(liblcc PUBLIC liblccbase) if(LCC_USE_DEBUG_ITERATORS) target_compile_definitions(liblcc PRIVATE LCC_DEBUG_ITERATORS) endif() -# Link main lcc library with generic object library. -target_link_libraries(liblcc PUBLIC object) - # Apply options to main lcc library target_link_libraries(liblcc PRIVATE options) +# Link main lcc library with base lcc library +# Link main lcc library with generic object library. +target_link_libraries( + liblcc PUBLIC + liblccbase object +) + # C language library add_library( languagec @@ -543,18 +580,10 @@ add_library( lib/glint/sema_type.cc ) target_include_directories(glint PUBLIC inc) -target_link_libraries(glint PRIVATE options) -target_link_libraries(glint PRIVATE object) -target_link_libraries(glint PRIVATE liblcc) - -# Simple JSON Library -add_library( - liblccjson - inc/lccjson/lccjson.hh - lib/lccjson/lccjson.cc +target_link_libraries( + glint PRIVATE + options object liblcc ) -target_include_directories(liblccjson PUBLIC inc) -target_link_libraries(liblccjson PRIVATE options) # Custom Linker Library add_library( @@ -575,7 +604,7 @@ add_library( target_include_directories(libclink PUBLIC inc) target_link_libraries(libclink PRIVATE options) -# lcc::Module::emit() needs memory layout stuff... +# link main lcc library with custom linker library target_link_libraries(liblcc PUBLIC libclink) # Add the driver. @@ -586,8 +615,6 @@ add_executable( src/sarif.cc ) target_include_directories(lcc PUBLIC src) - -# Apply options to driver. target_link_libraries(lcc PRIVATE options liblcc) # Make project version accessible from source code From 5c66e71239a5f1f941973fa8f530bca9be95fd3d Mon Sep 17 00:00:00 2001 From: Lens_r Date: Thu, 9 Jul 2026 23:55:01 -0700 Subject: [PATCH 21/26] [Testing] ABILITY TO Return Non-zero on Test Failure --- tst/codetest/x86_64/main.cpp | 9 +++++++ tst/irtest/main.cpp | 5 ++++ tst/langtest/c/main.cpp | 2 ++ tst/langtest/glint/main.cpp | 2 ++ tst/runtest/runtest.el | 49 +++++++++++++++++++++--------------- 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/tst/codetest/x86_64/main.cpp b/tst/codetest/x86_64/main.cpp index db4b3a57b..d49d1a349 100644 --- a/tst/codetest/x86_64/main.cpp +++ b/tst/codetest/x86_64/main.cpp @@ -1174,5 +1174,14 @@ int main(int argc, char** argv) { } to_sarif(context, command_line); + bool any_failed{false}; + for (auto& c : context.completed_tests()) { + if (context.test_passed(c)) continue; + any_failed = true; + break; + } + + // if (any_failed) + // return 1; return 0; } diff --git a/tst/irtest/main.cpp b/tst/irtest/main.cpp index b7da6d580..2759e9d38 100644 --- a/tst/irtest/main.cpp +++ b/tst/irtest/main.cpp @@ -476,11 +476,16 @@ int main(int argc, char** argv) { print_passedfailed(test_context.results) ); + bool any_failed{false}; for (auto result : test_context.results) { if (result.passed) continue; + + any_failed = true; fmt::print("{}", print_test_passedfailed(result)); } + // if (any_failed) + // return 1; return 0; } diff --git a/tst/langtest/c/main.cpp b/tst/langtest/c/main.cpp index 1f21e3657..bd6041c95 100644 --- a/tst/langtest/c/main.cpp +++ b/tst/langtest/c/main.cpp @@ -561,5 +561,7 @@ int main(int argc, const char** argv) { ); } + // if (out.count_failed()) + // return 1; return 0; } diff --git a/tst/langtest/glint/main.cpp b/tst/langtest/glint/main.cpp index e5c36324c..8af722414 100644 --- a/tst/langtest/glint/main.cpp +++ b/tst/langtest/glint/main.cpp @@ -560,5 +560,7 @@ int main(int argc, const char** argv) { ); } + // if (out.count_failed()) + // return 1; return 0; } diff --git a/tst/runtest/runtest.el b/tst/runtest/runtest.el index 03fea618c..d38bb112b 100644 --- a/tst/runtest/runtest.el +++ b/tst/runtest/runtest.el @@ -599,26 +599,35 @@ strings were stored to." (sqlite-execute db "CREATE TABLE tests (path TEXT NOT NULL PRIMARY KEY, name TEXT NOT NULL, passed INTEGER NOT NULL, language TEXT NOT NULL);") (sqlite-close db)) - ;; Turn off file backups (becomes a mess with all of the I/O that tests - ;; require) - (let ((backup-inhibited t)) - ;; Run the tests... - (run-test--ir-tests) - (run-test--glint-tests) - (run-test--c-tests) - - ;; Emit Results in SARIF - (run-test--sarif-file) - - ;; Print test overview (what happened) - (let ((db (sqlite-open run-test--test-database-path))) - (let ((results (sqlite-select db "SELECT * FROM tests;")) - (passing-results (sqlite-select db "SELECT * FROM tests WHERE passed > 0;"))) - (message "Ran %s Total Tests: %s Passed" - (length results) - (length passing-results)) - (sqlite-close db))) - )) + (let ((rc 0)) + ;; Turn off file backups (becomes a mess with all of the I/O that tests + ;; require) + (let ((backup-inhibited t)) + ;; Run the tests... + (run-test--ir-tests) + (run-test--glint-tests) + (run-test--c-tests) + + ;; Emit Results in SARIF + (run-test--sarif-file) + + ;; Print test overview (what happened) + (let ((db (sqlite-open run-test--test-database-path))) + (let ((results (sqlite-select db "SELECT * FROM tests;")) + (passing-results (sqlite-select db "SELECT * FROM tests WHERE passed > 0;"))) + (message "Ran %s Total Tests: %s Passed" + (length results) + (length passing-results)) + + ;; Set failing return code, if necessary + ;; (when (not (= (length results) (length passing-results))) + ;; (setf rc 1)) + ) + + (sqlite-close db)) + ) + + (kill-emacs rc))) (provide 'runtest) From 5cd154412bd42265a11ebf000a46c0a5d9954b98 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Fri, 10 Jul 2026 13:32:01 +0300 Subject: [PATCH 22/26] [Minor] Reorder definitions in inc/lcc/ir/core.hh --- inc/lcc/ir/core.hh | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/inc/lcc/ir/core.hh b/inc/lcc/ir/core.hh index 0d939887c..13592ce3d 100644 --- a/inc/lcc/ir/core.hh +++ b/inc/lcc/ir/core.hh @@ -26,7 +26,7 @@ #include namespace lcc { -class Parameter; +class Function; class PhiInst; namespace parser { @@ -605,6 +605,34 @@ public: static auto classof(const Value* v) -> bool { return v->kind() == Kind::Block; } }; +/// A parameter reference. +class Parameter : public UseTrackingValue { + /// Only the Function class should be able to create these. + friend Function; + // NOTE: For lowering + friend Module; + + /// The parameter index. + u32 i{}; + + Parameter(Type* ty, u32 idx) + : UseTrackingValue(Kind::Parameter, ty) + , i(idx) {} + +public: + /// Get the parameter index. + [[nodiscard]] + auto index() const -> u32 { return i; } + + /// NOTE: For lowering + [[nodiscard]] + auto index() -> u32& { return i; } + + /// RTTI. + [[nodiscard]] + static auto classof(const Value* v) -> bool { return v->kind() == Kind::Parameter; } +}; + /// An IR function. class Function : public UseTrackingValue { private: @@ -743,34 +771,6 @@ public: static auto classof(const Value* v) -> bool { return v->kind() == Kind::Function; } }; -/// A parameter reference. -class Parameter : public UseTrackingValue { - /// Only the Function class should be able to create these. - friend Function; - // NOTE: For lowering - friend Module; - - /// The parameter index. - u32 i{}; - - Parameter(Type* ty, u32 idx) - : UseTrackingValue(Kind::Parameter, ty) - , i(idx) {} - -public: - /// Get the parameter index. - [[nodiscard]] - auto index() const -> u32 { return i; } - - /// NOTE: For lowering - [[nodiscard]] - auto index() -> u32& { return i; } - - /// RTTI. - [[nodiscard]] - static auto classof(const Value* v) -> bool { return v->kind() == Kind::Parameter; } -}; - /// ============================================================================ /// Instructions /// ============================================================================ From f7bda6e0717144da494b7f654020000302a38901 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Fri, 10 Jul 2026 13:34:00 +0300 Subject: [PATCH 23/26] [Minor] `OptionPrintMIR` -> `OptionPrintMachineIR` `OptionPrintMIR::[DoNot]PrintMIR` -> `OptionPrintMachineIR::[DoNot]PrintMachineIR` --- inc/lccbase/context.hh | 8 ++++---- lib/lcc/lcc-c.cc | 2 +- src/cli.cc | 2 +- src/cli.hh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/lccbase/context.hh b/inc/lccbase/context.hh index f07b8bfa1..973503cc1 100644 --- a/inc/lccbase/context.hh +++ b/inc/lccbase/context.hh @@ -45,9 +45,9 @@ public: StopatSema = true, }; - enum OptionPrintMIR : bool { - DoNotPrintMIR, - PrintMIR = true, + enum OptionPrintMachineIR : bool { + DoNotPrintMachineIR, + PrintMachineIR = true, }; enum OptionStopatMIR : bool { DoNotStopatMIR, @@ -74,7 +74,7 @@ public: OptionStopatSyntax _stopat_syntax{}; OptionStopatSema _stopat_sema{}; - OptionPrintMIR _should_print_mir{}; + OptionPrintMachineIR _should_print_mir{}; OptionStopatMIR _stopat_mir{}; }; diff --git a/lib/lcc/lcc-c.cc b/lib/lcc/lcc-c.cc index 430125068..07c1e9375 100644 --- a/lib/lcc/lcc-c.cc +++ b/lib/lcc/lcc-c.cc @@ -41,7 +41,7 @@ LccContextRef lcc_context_create(LccTargetRef target, LccFormatRef format) { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR // } }); diff --git a/src/cli.cc b/src/cli.cc index 01acbb141..15f8c9963 100644 --- a/src/cli.cc +++ b/src/cli.cc @@ -143,7 +143,7 @@ auto parse(int argc, const char** argv) -> Options { else if (arg == "--stopat-ir") o.stopat_ir = true; else if (arg == "--mir") - o.mir = lcc::Context::PrintMIR; + o.mir = lcc::Context::PrintMachineIR; else if (arg == "--stopat-mir") o.stopat_mir = lcc::Context::StopatMIR; else if (arg == "--stats") diff --git a/src/cli.hh b/src/cli.hh index 808f28d5d..d2f7f1acf 100644 --- a/src/cli.hh +++ b/src/cli.hh @@ -19,7 +19,7 @@ struct Options { lcc::Context::OptionPrintStats print_stats{false}; lcc::Context::OptionPrintAST ast{false}; - lcc::Context::OptionPrintMIR mir{false}; + lcc::Context::OptionPrintMachineIR mir{false}; lcc::Context::OptionStopatLex stopat_lex{false}; lcc::Context::OptionStopatSyntax stopat_syntax{false}; lcc::Context::OptionStopatSema stopat_sema{false}; From fbab32d48a123308a882ea4774bfd54195ebd7fe Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Fri, 10 Jul 2026 13:39:23 +0300 Subject: [PATCH 24/26] [Minor/LCCJson] Missing include --- lib/lccjson/lccjson.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/lccjson/lccjson.cc b/lib/lccjson/lccjson.cc index a12e9005d..7502c55f9 100644 --- a/lib/lccjson/lccjson.cc +++ b/lib/lccjson/lccjson.cc @@ -4,6 +4,7 @@ #include #include +#include #include #include #include From 4cd2f89d10bbb0a583696901753078a435ba6b70 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Fri, 10 Jul 2026 13:48:48 +0300 Subject: [PATCH 25/26] [Minor] Rename `PrintMIR` -> `PrintMachineIR` in tests --- tst/codetest/x86_64/main.cpp | 2 +- tst/irtest/main.cpp | 2 +- tst/langtest/c/main.cpp | 4 ++-- tst/langtest/glint/main.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tst/codetest/x86_64/main.cpp b/tst/codetest/x86_64/main.cpp index d49d1a349..9f40b8ee5 100644 --- a/tst/codetest/x86_64/main.cpp +++ b/tst/codetest/x86_64/main.cpp @@ -281,7 +281,7 @@ bool run_test( lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR, } }; diff --git a/tst/irtest/main.cpp b/tst/irtest/main.cpp index 2759e9d38..91af631f9 100644 --- a/tst/irtest/main.cpp +++ b/tst/irtest/main.cpp @@ -453,7 +453,7 @@ int main(int argc, char** argv) { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR } }; diff --git a/tst/langtest/c/main.cpp b/tst/langtest/c/main.cpp index bd6041c95..133f74250 100644 --- a/tst/langtest/c/main.cpp +++ b/tst/langtest/c/main.cpp @@ -90,7 +90,7 @@ struct CLanguageTest : langtest::Test { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR } }; @@ -241,7 +241,7 @@ void output_ast(std::filesystem::path p) { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR // } // }; diff --git a/tst/langtest/glint/main.cpp b/tst/langtest/glint/main.cpp index 8af722414..b2e52da06 100644 --- a/tst/langtest/glint/main.cpp +++ b/tst/langtest/glint/main.cpp @@ -94,7 +94,7 @@ struct GlintTest : langtest::Test { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR } }; @@ -250,7 +250,7 @@ void output_ast(std::filesystem::path p) { lcc::Context::DoNotStopatLex, lcc::Context::DoNotStopatSyntax, lcc::Context::DoNotStopatSema, - lcc::Context::DoNotPrintMIR, + lcc::Context::DoNotPrintMachineIR, lcc::Context::DoNotStopatMIR // } // }; From 41b8517d321b66f61bc38b2340a07954fac47593 Mon Sep 17 00:00:00 2001 From: EndeyshentLabs Date: Fri, 10 Jul 2026 14:12:36 +0300 Subject: [PATCH 26/26] [Test, CI] Add LCC_TEST_NON_ZERO_EXIT_ON_FAILURE CMake option --- .github/workflows/ci.yml | 2 +- tst/CMakeLists.txt | 4 ++++ tst/codetest/x86_64/main.cpp | 6 ++++-- tst/irtest/main.cpp | 6 ++++-- tst/langtest/c/main.cpp | 6 ++++-- tst/langtest/glint/main.cpp | 6 ++++-- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc953460a..134b873f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: run: sudo dnf install -y emacs-nw libcxx libcxx-devel libcxxabi libcxxabi-devel mingw64-gcc mingw64-libstdc++ ucrt64-gcc ucrt64-libstdc++ - name: Configure Test suite using CMake working-directory: ./tst - run: cmake -G Ninja -B bld -DUSE_LTO=OFF + run: cmake -G Ninja -B bld -DUSE_LTO=OFF -DLCC_TEST_NON_ZERO_EXIT_ON_FAILURE=ON - name: Build Test suite working-directory: ./tst run: cmake --build bld diff --git a/tst/CMakeLists.txt b/tst/CMakeLists.txt index c7bc3e36d..8975f381b 100644 --- a/tst/CMakeLists.txt +++ b/tst/CMakeLists.txt @@ -53,6 +53,10 @@ if (USE_LTO) endif() endif() +if (LCC_TEST_NON_ZERO_EXIT_ON_FAILURE) + add_compile_definitions(LCC_TEST_NON_ZERO_EXIT_ON_FAILURE) +endif() + add_subdirectory("./vew/" "vew" EXCLUDE_FROM_ALL) # LangTest diff --git a/tst/codetest/x86_64/main.cpp b/tst/codetest/x86_64/main.cpp index 9f40b8ee5..8f4c996db 100644 --- a/tst/codetest/x86_64/main.cpp +++ b/tst/codetest/x86_64/main.cpp @@ -1181,7 +1181,9 @@ int main(int argc, char** argv) { break; } - // if (any_failed) - // return 1; +#ifdef LCC_TEST_NON_ZERO_EXIT_ON_FAILURE + if (any_failed) + return 1; +#endif return 0; } diff --git a/tst/irtest/main.cpp b/tst/irtest/main.cpp index 91af631f9..085e9d9be 100644 --- a/tst/irtest/main.cpp +++ b/tst/irtest/main.cpp @@ -485,7 +485,9 @@ int main(int argc, char** argv) { fmt::print("{}", print_test_passedfailed(result)); } - // if (any_failed) - // return 1; +#ifdef LCC_TEST_NON_ZERO_EXIT_ON_FAILURE + if (any_failed) + return 1; +#endif return 0; } diff --git a/tst/langtest/c/main.cpp b/tst/langtest/c/main.cpp index 133f74250..5c5403df6 100644 --- a/tst/langtest/c/main.cpp +++ b/tst/langtest/c/main.cpp @@ -561,7 +561,9 @@ int main(int argc, const char** argv) { ); } - // if (out.count_failed()) - // return 1; +#ifdef LCC_TEST_NON_ZERO_EXIT_ON_FAILURE + if (out.count_failed()) + return 1; +#endif return 0; } diff --git a/tst/langtest/glint/main.cpp b/tst/langtest/glint/main.cpp index b2e52da06..947fbc415 100644 --- a/tst/langtest/glint/main.cpp +++ b/tst/langtest/glint/main.cpp @@ -560,7 +560,9 @@ int main(int argc, const char** argv) { ); } - // if (out.count_failed()) - // return 1; +#ifdef LCC_TEST_NON_ZERO_EXIT_ON_FAILURE + if (out.count_failed()) + return 1; +#endif return 0; }