diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b14a870..81d799c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ main, feat/*, 3-feat-ci-add-build-workflow ] + branches: [ main, 3-feat-ci-add-build-workflow ] pull_request: branches: [ main ] workflow_dispatch: @@ -25,7 +25,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y build-essential cmake + sudo apt-get install -y build-essential cmake python3 # Install LLVM and Clang 20 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main" @@ -37,7 +37,7 @@ jobs: - name: Install dependencies (macOS) if: runner.os == 'macOS' run: | - brew install cmake llvm@20 + brew install cmake python llvm@20 echo "LLVM_DIR=$(brew --prefix llvm@20)/lib/cmake/llvm" >> $GITHUB_ENV echo "Clang_DIR=$(brew --prefix llvm@20)/lib/cmake/clang" >> $GITHUB_ENV echo "$(brew --prefix llvm@20)/bin" >> $GITHUB_PATH @@ -57,15 +57,4 @@ jobs: - name: Test Stack Usage Analyzer (Linux/macOS) if: runner.os == 'Linux' || runner.os == 'macOS' run: | - cd build - # Create a test file with some stack usage - cat < test_stack.c - #define SIZE_LARGE 1024 - int main(void) { - char test[SIZE_LARGE]; - return 0; - } - EOF - - # Run the analyzer - ./stack_usage_analyzer --mode=ir test_stack.c \ No newline at end of file + python3 run_test.py \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b267b..f91cead 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ include(FetchContent) FetchContent_Declare( cc GIT_REPOSITORY https://github.com/CoreTrace/coretrace-compiler.git - GIT_TAG main + GIT_TAG main ) FetchContent_MakeAvailable(cc) diff --git a/test/vla/vla-scanf.c b/test/vla/vla-scanf.c index 55ffe9a..6ffedf0 100644 --- a/test/vla/vla-scanf.c +++ b/test/vla/vla-scanf.c @@ -3,13 +3,13 @@ int main(void) { int n; - // at line 9, column 9 + // --- at line 9, column 9 // [!!] stack pointer escape: address of variable 'n' escapes this function // address passed as argument to function 'scanf' (callee may capture the pointer beyond this function) if (scanf("%d", &n) != 1) return 1; - // at line 16, column 5 + // --- at line 16, column 5 // [!] dynamic stack allocation detected for variable 'vla' // allocated type: i8 // size of this allocation is not compile-time constant (VLA / variable alloca) and may lead to unbounded stack usage