From b081aeccf8e3354b2c6bae6acb5118cab2ab3026 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Mon, 23 Mar 2026 17:37:58 +0800 Subject: [PATCH 1/3] add debugtrap target verifier and disable workflows for sync --- .github/workflows/build-cache.yml | 70 ---- .github/workflows/doc-link-checker.yml | 45 --- .github/workflows/doc.yml | 157 -------- .github/workflows/fmt.yml | 55 --- .github/workflows/go.yml | 91 ----- .github/workflows/llgo.yml | 370 ------------------ .github/workflows/release-build.yml | 207 ---------- .github/workflows/stdlib-coverage.yml | 34 -- .github/workflows/targets.yml | 52 --- .../targetsbuild/verify_builtin_debugtrap.sh | 203 ++++++++++ 10 files changed, 203 insertions(+), 1081 deletions(-) delete mode 100644 .github/workflows/build-cache.yml delete mode 100644 .github/workflows/doc-link-checker.yml delete mode 100644 .github/workflows/doc.yml delete mode 100644 .github/workflows/fmt.yml delete mode 100644 .github/workflows/go.yml delete mode 100644 .github/workflows/llgo.yml delete mode 100644 .github/workflows/release-build.yml delete mode 100644 .github/workflows/stdlib-coverage.yml delete mode 100644 .github/workflows/targets.yml create mode 100755 _demo/embed/targetsbuild/verify_builtin_debugtrap.sh diff --git a/.github/workflows/build-cache.yml b/.github/workflows/build-cache.yml deleted file mode 100644 index cb34842e8d..0000000000 --- a/.github/workflows/build-cache.yml +++ /dev/null @@ -1,70 +0,0 @@ -# Build cache tests for llgo -# Tests various build configurations to ensure cache works correctly - -name: Build Cache - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-cache: - timeout-minutes: 30 - strategy: - matrix: - os: [macos-latest, ubuntu-latest] - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install wamr (for wasm tests) - if: startsWith(matrix.os, 'macos') - run: | - git clone --branch WAMR-2.4.4 --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime.git - mkdir wasm-micro-runtime/product-mini/platforms/darwin/build - cd wasm-micro-runtime/product-mini/platforms/darwin/build - cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 .. - make -j8 - echo "$PWD" >> $GITHUB_PATH - - - name: Install wamr (for wasm tests on Linux) - if: startsWith(matrix.os, 'ubuntu') - run: | - git clone --branch WAMR-2.4.4 --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime.git - mkdir wasm-micro-runtime/product-mini/platforms/linux/build - cd wasm-micro-runtime/product-mini/platforms/linux/build - cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 .. - make -j8 - echo "$PWD" >> $GITHUB_PATH - - - name: Install llgo (dev mode) - run: | - go install -tags=dev ./cmd/llgo - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Install esptool.py (for ESP32-C3 tests on Linux) - if: startsWith(matrix.os, 'ubuntu') - run: pip3 install --break-system-packages esptool==5.1.0 - - - name: Run build cache tests - run: bash test/buildcache/test.sh diff --git a/.github/workflows/doc-link-checker.yml b/.github/workflows/doc-link-checker.yml deleted file mode 100644 index 6aca79bc2f..0000000000 --- a/.github/workflows/doc-link-checker.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Doc Link Checker - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - paths: - - "README.md" - pull_request: - branches: ["**"] - paths: - - "README.md" - schedule: - # Run daily at 00:00 UTC - - cron: "0 0 * * *" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - doc_verify: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v6 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: "20" - - - name: Install embedme - run: npm install -g embedme - - - name: Verify README.md embedded code - run: embedme --verify README.md - - - name: Link Checker - id: lychee - uses: lycheeverse/lychee-action@v2 - with: - args: --max-concurrency 3 --retry-wait-time 15 README.md diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index 1503c10da6..0000000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,157 +0,0 @@ -name: Docs - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - remote_install: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh - - local_install: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.23" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - - - name: Install llgo with tools - run: | - set -e - set -x - git() { - if [ "$1" = "clone" ]; then - # do nothing because we already have the branch - cd .. - else - command git "$@" - fi - } - source doc/_readme/scripts/install_llgo.sh - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh - - local_install_full: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.23" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - echo "PATH=/usr/lib/llvm-19/bin:$PATH" >> $GITHUB_ENV - - - name: Install llgo with tools - run: | - set -e - set -x - git() { - if [ "$1" = "clone" ]; then - # do nothing because we already have the branch - cd .. - else - command git "$@" - fi - } - source doc/_readme/scripts/install_full.sh - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml deleted file mode 100644 index 4aa9fc2378..0000000000 --- a/.github/workflows/fmt.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Format Check - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - fmt: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v6 - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Check formatting - run: | - set -euo pipefail - - check_dir() { - local dir="$1" - pushd "$dir" >/dev/null - # gofmt won't traverse directories that start with '_' or 'testdata', - # so mirror dev/local_ci.sh and scan every Go file explicitly. - fmt_output="$( - find . -name '*.go' -type f ! -name 'xgo_autogen.go' -print0 \ - | xargs -0 gofmt -l \ - | sed 's|^\\./||' \ - || true - )" - popd >/dev/null - - if [ -n "$fmt_output" ]; then - printf 'Detected gofmt differences in %s:\\n%s\\n' "$dir" "$fmt_output" - return 1 - fi - } - - for dir in . runtime; do - check_dir "$dir" - done - - echo "All files are properly formatted." diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 14adf8efc0..0000000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,91 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - continue-on-error: true - timeout-minutes: 60 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Install embedded dependencies - uses: ./.github/actions/setup-embed-deps - - - name: Clang information - run: | - echo $PATH - which clang - clang --version - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install further optional dependencies for demos - run: | - py_deps=( - numpy # for github.com/goplus/lib/py/numpy - torch # for github.com/goplus/lib/py/torch - ) - pip3.12 install --break-system-packages "${py_deps[@]}" - # Align python3-embed with python-3.12-embed to avoid ABI mismatches. - pcdir=$HOME/pc - mkdir -p "$pcdir" - libdir=$(pkg-config --variable=libdir python-3.12-embed) - ln -s "$libdir/pkgconfig/python-3.12-embed.pc" "$pcdir/python3-embed.pc" - echo "PKG_CONFIG_PATH=$pcdir:${PKG_CONFIG_PATH}" >> $GITHUB_ENV - echo "LLGO_FULL_RPATH=true" >> $GITHUB_ENV - - - name: Set LLGO_ROOT - run: echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Build - run: go build -v ./... - - - name: Test - if: ${{!startsWith(matrix.os, 'macos')}} - run: go test -timeout 30m ./... - - - name: Test with coverage - if: startsWith(matrix.os, 'macos') - run: go test -timeout 30m -coverprofile="coverage.txt" -covermode=atomic ./... - - - name: Test with embedded emulator env - env: - LLGO_EMBED_TESTS: "1" - run: go test -v -timeout 60m ./cl -run '^TestRunEmbedEmulator$' - - - name: Check std symbol coverage - run: bash doc/_readme/scripts/check_std_cover.sh - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{secrets.CODECOV_TOKEN}} diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml deleted file mode 100644 index 90cea762ca..0000000000 --- a/.github/workflows/llgo.yml +++ /dev/null @@ -1,370 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: LLGo - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - download-model: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Download model file - run: | - mkdir -p ./_demo/c/llama2-c - wget -P ./_demo/c/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin - - - name: Upload model as artifact - uses: actions/upload-artifact@v7 - with: - name: llama2-model - path: ./_demo/c/llama2-c/stories15M.bin - retention-days: 1 - - llgo: - needs: download-model - continue-on-error: true - # macOS Intel is much slower than macOS ARM in the "Test demos" step. - # Observed: macOS ARM about 2m49s vs macOS Intel about 10m26s. - # Keep a larger budget to avoid timeout-related cancellations. - timeout-minutes: 60 - strategy: - matrix: - os: - - macos-latest - - macos-15-intel - - ubuntu-latest - llvm: [19] - go: ["1.21.13", "1.24.2"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - name: Install embedded dependencies - uses: ./.github/actions/setup-embed-deps - - name: Download model artifact - uses: actions/download-artifact@v8 - with: - name: llama2-model - path: ./_demo/c/llama2-c/ - - name: Download platform-specific demo libs - run: | - if ${{ startsWith(matrix.os, 'macos') }}; then - # Use uname -m to detect actual CPU architecture - if [[ "$(uname -m)" == "x86_64" ]]; then - DEMO_PKG="cargs_darwin_amd64.zip" - else - DEMO_PKG="cargs_darwin_arm64.zip" - fi - else - DEMO_PKG="cargs_linux_amd64.zip" - fi - - mkdir -p ./_demo/c/cargs/libs - cd ./_demo/c/cargs/libs - wget https://github.com/goplus/llpkg/releases/download/cargs/v1.0.0/${DEMO_PKG} - unzip ${DEMO_PKG} - - # Process pc template files - replace {{.Prefix}} with actual path - ACTUAL_PREFIX="$(pwd)" - for tmpl in lib/pkgconfig/*.pc.tmpl; do - pc_file="${tmpl%.tmpl}" - sed "s|{{.Prefix}}|${ACTUAL_PREFIX}|g" "$tmpl" > "$pc_file" - done - - echo "PKG_CONFIG_PATH=${ACTUAL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV - - name: Install further optional dependencies for demos - run: | - py_deps=( - numpy # for github.com/goplus/lib/py/numpy - torch # for github.com/goplus/lib/py/torch - ) - pip3.12 install --break-system-packages "${py_deps[@]}" - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: actions/setup-go@v6 - with: - go-version: ${{matrix.go}} - - - name: Test demo without RPATH (expect failure) - run: | - echo "Testing demo without RPATH (should fail)..." - export LLGO_FULL_RPATH=false - pkg-config --libs cargs - if (cd ./_demo/c/cargs && llgo run .); then - echo "ERROR: cargs demo should have failed without RPATH!" - exit 1 - else - echo "✓ cargs demo correctly failed without RPATH" - fi - - - name: Test demos - run: | - # TODO(lijie): force python3-embed to be linked with python-3.12-embed - # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch - # Will remove this after pytorch is fixed. - pcdir=$HOME/pc - mkdir -p $pcdir - libdir=$(pkg-config --variable=libdir python-3.12-embed) - echo "libdir: $libdir" - ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc - export PKG_CONFIG_PATH=$pcdir:${PKG_CONFIG_PATH} - export LLGO_FULL_RPATH=true - bash .github/workflows/test_demo.sh - - - name: Test demos (embedded target) - run: bash .github/workflows/test_demo.sh --embedded - - - name: Test C header generation - run: | - echo "Testing C header generation in different build modes..." - cd _demo/go/export - chmod +x test.sh - ./test.sh - - - name: Test export with different symbol names on embedded targets - run: | - echo "Testing //export with different symbol names on embedded targets..." - cd _demo/embed/export - chmod +x verify_export.sh - ./verify_export.sh - - - name: Test ESP serial smoke (build + emulator) - run: | - echo "Testing ESP32/ESP32-C3 build + emulator smoke..." - cd _demo/embed - chmod +x test-esp-serial-startup.sh - ./test-esp-serial-startup.sh - - - name: Test ESP32-C3 startup regression - run: | - echo "Testing ESP32-C3 startup regressions..." - pip3 install --break-system-packages esptool==5.1.0 - cd _demo/embed - chmod +x test_esp32c3_startup.sh - ./test_esp32c3_startup.sh - - - name: _xtool build tests - run: | - cd _xtool - llgo build -v ./... - - - name: Show test result - run: cat result.md - - - name: LLDB tests - if: ${{ startsWith(matrix.os, 'macos') && matrix.os != 'macos-15-intel' }} - run: | - echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}" - bash _lldb/runtest.sh -v - - test: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - llvm: [19] - go: ["1.24.2"] - shard: ["0", "1", "2", "3"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - name: Install further optional dependencies for demos - run: | - py_deps=( - numpy # for github.com/goplus/lib/py/numpy - torch # for github.com/goplus/lib/py/torch - ) - pip3.12 install --break-system-packages "${py_deps[@]}" - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: actions/setup-go@v6 - with: - go-version: ${{matrix.go}} - - name: Test Baremetal GC - if: ${{!startsWith(matrix.os, 'macos') && matrix.shard == '0'}} - working-directory: runtime/internal/runtime/tinygogc - run: llgo test -timeout=20m -tags testGC . - - name: run llgo test - env: - SHARD_INDEX: ${{ matrix.shard }} - SHARD_TOTAL: "4" - run: | - set -euo pipefail - - pkgs=() - while IFS= read -r pkg; do - pkgs+=("${pkg}") - done < <(go list -tags=llgo ./test/... | sort) - - selected=() - for i in "${!pkgs[@]}"; do - if (( i % SHARD_TOTAL == SHARD_INDEX )); then - selected+=("${pkgs[$i]}") - fi - done - - echo "Shard: ${SHARD_INDEX}/${SHARD_TOTAL}, selected: ${#selected[@]} package(s)" - if [ "${#selected[@]}" -eq 0 ]; then - echo "No packages in this shard." - exit 0 - fi - printf ' %s\n' "${selected[@]}" - - # Run per-package and print elapsed time to keep logs readable. - for pkg in "${selected[@]}"; do - echo "==> llgo test -timeout=20m ${pkg}" - SECONDS=0 - llgo test -timeout=20m "${pkg}" - echo "==> done ${pkg} (${SECONDS}s)" - done - - hello: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - llvm: [19] - go: ["1.21.13", "1.24.2"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go 1.23 for building llgo - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install llgo - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: ./.github/actions/setup-go - with: - go-version: ${{matrix.go}} - - - name: Test Hello World with go.mod 1.21 - if: startsWith(matrix.go, '1.21') || startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.21" - - - name: Test Hello World with go.mod 1.22 - if: startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.22" - - - name: Test Hello World with go.mod 1.23 - if: startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.23" - - - name: Test Hello World with go.mod 1.24 - if: startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.24" - - cross-compile: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: [macos-latest] - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go for building llgo - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install wamr - run: | - git clone --branch WAMR-2.4.4 --depth 1 https://github.com/bytecodealliance/wasm-micro-runtime.git - mkdir wasm-micro-runtime/product-mini/platforms/darwin/build - cd wasm-micro-runtime/product-mini/platforms/darwin/build - cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 .. - make -j8 - echo "$PWD" >> $GITHUB_PATH - - - name: Install llgo - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test Cross Compilation (wasm) - shell: bash - working-directory: _demo/c - run: | - echo "Testing cross-compilation wasm with Go 1.24.2" - - # Compile for wasm architecture - GOOS=wasip1 GOARCH=wasm llgo build -o hello -tags=nogc -v ./helloc - - # Check file type - file hello.wasm - - # Run the wasm binary using llgo_wasm - iwasm --stack-size=819200000 --heap-size=800000000 hello.wasm diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml deleted file mode 100644 index 0609a0a77d..0000000000 --- a/.github/workflows/release-build.yml +++ /dev/null @@ -1,207 +0,0 @@ -name: Release Build - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - tags: ["*"] - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - setup: - runs-on: ubuntu-latest - outputs: - linux-cache-key: ${{ steps.cache-keys.outputs.linux-key }} - steps: - - name: Check out code - uses: actions/checkout@v6 - - name: Calculate cache keys - id: cache-keys - run: | - LINUX_KEY="linux-sysroot-${{ hashFiles('.github/workflows/populate_linux_sysroot.sh', '.github/workflows/release-build.yml') }}-v1.0.0" - echo "linux-key=$LINUX_KEY" >> $GITHUB_OUTPUT - populate-linux-sysroot: - runs-on: ubuntu-latest - needs: setup - timeout-minutes: 30 - steps: - - name: Check out code - uses: actions/checkout@v6 - - name: Check Linux sysroot cache - id: cache-linux-sysroot - uses: actions/cache/restore@v5 - with: - path: .sysroot/linux.tar.gz - key: ${{ needs.setup.outputs.linux-cache-key }} - lookup-only: true - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - with: - image: tonistiigi/binfmt:qemu-v7.0.0-28 - - name: Populate Linux sysroot - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - run: bash .github/workflows/populate_linux_sysroot.sh - - name: Create Linux sysroot tarball - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - run: tar -czvf .sysroot/linux.tar.gz -C .sysroot linux - - name: Save Linux sysroot cache - if: steps.cache-linux-sysroot.outputs.cache-hit != 'true' - uses: actions/cache/save@v5 - with: - path: .sysroot/linux.tar.gz - key: ${{ needs.setup.outputs.linux-cache-key }} - build: - runs-on: ubuntu-latest - needs: [setup, populate-linux-sysroot] - steps: - - name: Check out code - uses: actions/checkout@v6 - - name: Set up Release - uses: ./.github/actions/setup-goreleaser - with: - linux-cache-key: ${{ needs.setup.outputs.linux-cache-key }} - - name: Run GoReleaser (Build & Test) - env: - GITHUB_TOKEN: ${{github.token}} - run: | - docker run \ - --rm \ - -e GITHUB_TOKEN=${GITHUB_TOKEN} \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(pwd):/go/src/llgo \ - -w /go/src/llgo \ - ghcr.io/goreleaser/goreleaser-cross:v1.22 \ - release --verbose --skip=publish,nfpm,snapcraft --snapshot --clean - - - name: Upload Darwin AMD64 Artifacts - uses: actions/upload-artifact@v7 - with: - name: llgo-darwin-amd64 - path: .dist/*darwin-amd64.tar.gz - retention-days: 3 - include-hidden-files: true - - - name: Upload Darwin ARM64 Artifacts - uses: actions/upload-artifact@v7 - with: - name: llgo-darwin-arm64 - path: .dist/*darwin-arm64.tar.gz - retention-days: 3 - include-hidden-files: true - - - name: Upload Linux AMD64 Artifacts - uses: actions/upload-artifact@v7 - with: - name: llgo-linux-amd64 - path: .dist/*linux-amd64.tar.gz - retention-days: 3 - include-hidden-files: true - - - name: Upload Linux ARM64 Artifacts - uses: actions/upload-artifact@v7 - with: - name: llgo-linux-arm64 - path: .dist/*linux-arm64.tar.gz - retention-days: 3 - include-hidden-files: true - - - name: Upload Checksums - uses: actions/upload-artifact@v7 - with: - name: llgo-checksums - path: .dist/*checksums.txt - retention-days: 3 - include-hidden-files: true - - test-artifacts: - needs: build - strategy: - matrix: - include: - - os: macos-15-intel - goos: darwin - goarch: amd64 - go-version: "1.24.2" - go-mod-version: "1.24" - - os: macos-latest - goos: darwin - goarch: arm64 - go-version: "1.24.2" - go-mod-version: "1.24" - - os: ubuntu-latest - goos: linux - goarch: amd64 - go-version: "1.24.2" - go-mod-version: "1.24" - - os: ubuntu-24.04-arm - goos: linux - goarch: arm64 - go-version: "1.24.2" - go-mod-version: "1.24" - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - install-llvm: false - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: ${{ matrix.go-version }} - - name: Download Platform Artifact - uses: actions/download-artifact@v8 - with: - name: llgo-${{ matrix.goos }}-${{ matrix.goarch }} - path: . - - - name: Extract LLGO Archive - run: | - echo "Looking for ${{ matrix.goos }}_${{ matrix.goarch }} archive..." - ARCHIVE=$(ls *.tar.gz | head -n1) - mkdir -p release-llgo - tar -xzf "$ARCHIVE" -C release-llgo - ls -la release-llgo/ - echo "${{ github.workspace }}/release-llgo/bin/" >> $GITHUB_PATH - - - name: Test Hello World - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go-version}} - mod-version: ${{ matrix.go-mod-version }} - - release: - needs: [setup, test-artifacts, populate-linux-sysroot] - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - steps: - - name: Check out code - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - name: Set up Release - uses: ./.github/actions/setup-goreleaser - with: - linux-cache-key: ${{ needs.setup.outputs.linux-cache-key }} - - name: Run GoReleaser (Release) - env: - GITHUB_TOKEN: ${{github.token}} - run: | - echo "Publishing release for tag: ${{ github.ref }}" - echo "All artifact tests passed, proceeding with release..." - docker run \ - --rm \ - -e GITHUB_TOKEN=${GITHUB_TOKEN} \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(pwd):/go/src/llgo \ - -w /go/src/llgo \ - ghcr.io/goreleaser/goreleaser-cross:v1.22 \ - release --clean --verbose --skip nfpm,snapcraft diff --git a/.github/workflows/stdlib-coverage.yml b/.github/workflows/stdlib-coverage.yml deleted file mode 100644 index 07cca9f40c..0000000000 --- a/.github/workflows/stdlib-coverage.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Stdlib Coverage - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: stdlib-coverage-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - coverage: - timeout-minutes: 15 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v6 - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Check stdlib function coverage - run: doc/_readme/scripts/check_std_cover.sh diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml deleted file mode 100644 index f93df13af8..0000000000 --- a/.github/workflows/targets.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Targets - -on: - push: - branches: - - "**" - - "!dependabot/**" - - "!xgopilot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - llgo: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v6 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Build targets (empty) - run: | - cd _demo/embed/targetsbuild - bash build.sh empty - - - name: Build targets (defer) - run: | - cd _demo/embed/targetsbuild - bash build.sh defer diff --git a/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh b/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh new file mode 100755 index 0000000000..0355fe0f54 --- /dev/null +++ b/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh @@ -0,0 +1,203 @@ +#!/bin/bash +# +# verify_builtin_debugtrap.sh - Compile __builtin_debugtrap() for every target. +# +# Usage: +# ./verify_builtin_debugtrap.sh +# ./verify_builtin_debugtrap.sh esp32 cortex-m4 atmega328p +# +# Notes: +# - With no arguments, this script walks every targets/*.json file in the repo. +# - Optional target arguments only exist for local debugging; the default mode +# is intentionally "run all targets". +# - Targets without an effective llvm-target after resolving inherits are still +# listed, but marked as SKIP. These files are overlay/base targets such as +# softdevice or shared board configuration layers, not standalone codegen +# targets that clang can compile by themselves. +# - xtensa and riscv32-esp targets are compiled with the ESP clang cached by +# llgo when available. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)" + +SYS_CLANG="${CLANG:-clang}" +ESP_CLANG_DEFAULT="${HOME}/Library/Caches/llgo/crosscompile/esp-clang-19.1.2_20250905-3/bin/clang" +ESP_CLANG="${ESP_CLANG:-${ESP_CLANG_DEFAULT}}" + +TMP_DIR="$(mktemp -d)" +trap 'rm -rf "${TMP_DIR}"' EXIT + +SRC_FILE="${TMP_DIR}/debugtrap.c" +TARGETS_TSV="${TMP_DIR}/targets.tsv" + +cat > "${SRC_FILE}" <<'EOF' +void f(void) { __builtin_debugtrap(); } +EOF + +classify_asm() { + local text="$1" + if grep -Eq '(^|[[:space:]])bkpt([[:space:]]|$)' <<<"${text}"; then + echo "bkpt" + elif grep -Eq '(^|[[:space:]])ebreak([[:space:]]|$)' <<<"${text}"; then + echo "ebreak" + elif grep -Eq '(^|[[:space:]])break([[:space:]]|$)' <<<"${text}"; then + echo "break" + elif grep -Eq '(^|[[:space:]])brk([[:space:]]|$)' <<<"${text}"; then + echo "brk" + elif grep -Eq '(^|[[:space:]])int3([[:space:]]|$)' <<<"${text}"; then + echo "int3" + elif grep -Eq '(^|[[:space:]])udf([[:space:]]|$)' <<<"${text}"; then + echo "udf" + elif grep -Eq '(^|[[:space:]])abort([[:space:]]|$)' <<<"${text}"; then + echo "abort" + elif grep -Eq '(^|[[:space:]])unreachable([[:space:]]|$)' <<<"${text}"; then + echo "unreachable" + else + echo "other" + fi +} + +python3 - "$REPO_ROOT" "$@" > "${TARGETS_TSV}" <<'PY' +import glob +import json +import os +import sys +from functools import lru_cache + +repo_root = sys.argv[1] +selected = set(sys.argv[2:]) +targets_dir = os.path.join(repo_root, "targets") +files = { + os.path.basename(path)[:-5]: path + for path in glob.glob(os.path.join(targets_dir, "*.json")) +} + +@lru_cache(None) +def load(name: str): + with open(files[name], "r", encoding="utf-8") as f: + data = json.load(f) + out = {} + for parent in data.get("inherits", []): + out.update(load(parent)) + out.update(data) + return out + +names = sorted(files) +if selected: + missing = sorted(selected - set(names)) + if missing: + print("Unknown targets: " + ", ".join(missing), file=sys.stderr) + sys.exit(1) + names = [name for name in names if name in selected] + +for name in names: + cfg = load(name) + llvm_target = cfg.get("llvm-target", "") + cpu = cfg.get("cpu", "") + features = cfg.get("features", "") + print("\t".join([name, llvm_target, cpu, features])) +PY + +cd "${REPO_ROOT}" + +printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "TARGET" "LLVM-TARGET" "CPU" "COMPILER" "IR" "ASM" "STATUS" +printf "%s\n" "--------------------------------------------------------------------------------------------------------------" + +pass_count=0 +skip_count=0 +fail_count=0 + +while IFS=$'\t' read -r name llvm_target cpu features; do + if [[ -z "${name}" ]]; then + continue + fi + + # Keep overlay/base targets in the report so the output covers every file in + # targets/*.json, but make the reason explicit instead of treating them as a + # compilation failure. + if [[ -z "${llvm_target}" ]]; then + printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "${name}" "-" "-" "-" "-" "-" "SKIP overlay/no-llvm-target" + skip_count=$((skip_count + 1)) + continue + fi + + compiler="${SYS_CLANG}" + if [[ "${llvm_target}" == xtensa* || "${llvm_target}" == riscv32-esp-* ]]; then + compiler="${ESP_CLANG}" + fi + + if ! command -v "${compiler}" >/dev/null 2>&1 && [[ ! -x "${compiler}" ]]; then + printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "-" "-" "FAIL compiler-not-found" + fail_count=$((fail_count + 1)) + continue + fi + + asm_flags=(--target="${llvm_target}" -S -O0 "${SRC_FILE}" -o -) + ir_flags=(--target="${llvm_target}" -S -emit-llvm -O0 "${SRC_FILE}" -o -) + + if [[ -n "${cpu}" ]]; then + if [[ "${llvm_target}" == avr* ]]; then + asm_flags=(-mmcu="${cpu}" "${asm_flags[@]}") + ir_flags=(-mmcu="${cpu}" "${ir_flags[@]}") + else + asm_flags=(-mcpu="${cpu}" "${asm_flags[@]}") + ir_flags=(-mcpu="${cpu}" "${ir_flags[@]}") + fi + fi + + case "${llvm_target}" in + avr*) + asm_flags=(-mdouble=64 "${asm_flags[@]}") + ir_flags=(-mdouble=64 "${ir_flags[@]}") + ;; + riscv32-esp-elf) + asm_flags=(-march=rv32imc -fforce-enable-int128 "${asm_flags[@]}") + ir_flags=(-march=rv32imc -fforce-enable-int128 "${ir_flags[@]}") + ;; + riscv32-*) + asm_flags=(-march=rv32imac -fforce-enable-int128 "${asm_flags[@]}") + ir_flags=(-march=rv32imac -fforce-enable-int128 "${ir_flags[@]}") + ;; + riscv64-*) + asm_flags=(-march=rv64gc "${asm_flags[@]}") + ir_flags=(-march=rv64gc "${ir_flags[@]}") + ;; + esac + + asm_out="$("${compiler}" "${asm_flags[@]}" 2>&1)" || { + printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "-" "-" "FAIL asm-compile" + fail_count=$((fail_count + 1)) + continue + } + + ir_out="$("${compiler}" "${ir_flags[@]}" 2>&1)" || { + printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "-" "-" "FAIL ir-compile" + fail_count=$((fail_count + 1)) + continue + } + + ir_status="no-debugtrap" + if grep -q 'llvm\.debugtrap' <<<"${ir_out}"; then + ir_status="debugtrap" + fi + + asm_status="$(classify_asm "${asm_out}")" + + printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ + "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "${ir_status}" "${asm_status}" "PASS" + pass_count=$((pass_count + 1)) +done < "${TARGETS_TSV}" + +printf "%s\n" "" +printf "PASS=%d SKIP=%d FAIL=%d\n" "${pass_count}" "${skip_count}" "${fail_count}" + +if [[ "${fail_count}" -ne 0 ]]; then + exit 1 +fi From 1b43ca72ec806e2090bb18d7cd45c87277ea0f7e Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Mon, 23 Mar 2026 17:41:46 +0800 Subject: [PATCH 2/3] add ubuntu workflow for builtin debugtrap verification --- .../workflows/verify-builtin-debugtrap.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/verify-builtin-debugtrap.yml diff --git a/.github/workflows/verify-builtin-debugtrap.yml b/.github/workflows/verify-builtin-debugtrap.yml new file mode 100644 index 0000000000..8bad36538d --- /dev/null +++ b/.github/workflows/verify-builtin-debugtrap.yml @@ -0,0 +1,43 @@ +name: verify-builtin-debugtrap + +on: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install host clang + run: | + sudo apt-get update + sudo apt-get install -y clang python3 xz-utils + + - name: Download ESP clang + env: + ESP_CLANG_URL: https://github.com/goplus/espressif-llvm-project-prebuilt/releases/download/19.1.2_20250905-3/clang-esp-19.1.2_20250905-3-x86_64-linux-gnu.tar.xz + run: | + set -euo pipefail + mkdir -p "$RUNNER_TEMP/esp-clang-root" + curl -L "$ESP_CLANG_URL" -o "$RUNNER_TEMP/esp-clang.tar.xz" + tar -xf "$RUNNER_TEMP/esp-clang.tar.xz" -C "$RUNNER_TEMP/esp-clang-root" + ESP_CLANG_BIN="$(find "$RUNNER_TEMP/esp-clang-root" -path '*/bin/clang' | head -n 1)" + if [ -z "$ESP_CLANG_BIN" ]; then + echo "ESP clang binary not found after extraction" >&2 + exit 1 + fi + echo "ESP_CLANG=$ESP_CLANG_BIN" >> "$GITHUB_ENV" + + - name: Show compiler versions + run: | + clang --version + "$ESP_CLANG" --version + + - name: Verify __builtin_debugtrap across all targets + run: bash _demo/embed/targetsbuild/verify_builtin_debugtrap.sh From ddec8359df929eb46fb7553c377ac30a7fd2516c Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Mon, 23 Mar 2026 17:48:30 +0800 Subject: [PATCH 3/3] log debugtrap compile commands in verifier workflow --- .../workflows/verify-builtin-debugtrap.yml | 8 ++++++-- .../targetsbuild/verify_builtin_debugtrap.sh | 20 +++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verify-builtin-debugtrap.yml b/.github/workflows/verify-builtin-debugtrap.yml index 8bad36538d..8dc0e92582 100644 --- a/.github/workflows/verify-builtin-debugtrap.yml +++ b/.github/workflows/verify-builtin-debugtrap.yml @@ -16,6 +16,7 @@ jobs: - name: Install host clang run: | + set -euxo pipefail sudo apt-get update sudo apt-get install -y clang python3 xz-utils @@ -23,7 +24,7 @@ jobs: env: ESP_CLANG_URL: https://github.com/goplus/espressif-llvm-project-prebuilt/releases/download/19.1.2_20250905-3/clang-esp-19.1.2_20250905-3-x86_64-linux-gnu.tar.xz run: | - set -euo pipefail + set -euxo pipefail mkdir -p "$RUNNER_TEMP/esp-clang-root" curl -L "$ESP_CLANG_URL" -o "$RUNNER_TEMP/esp-clang.tar.xz" tar -xf "$RUNNER_TEMP/esp-clang.tar.xz" -C "$RUNNER_TEMP/esp-clang-root" @@ -36,8 +37,11 @@ jobs: - name: Show compiler versions run: | + set -euxo pipefail clang --version "$ESP_CLANG" --version - name: Verify __builtin_debugtrap across all targets - run: bash _demo/embed/targetsbuild/verify_builtin_debugtrap.sh + run: | + set -euxo pipefail + bash _demo/embed/targetsbuild/verify_builtin_debugtrap.sh diff --git a/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh b/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh index 0355fe0f54..2af6a87bd7 100755 --- a/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh +++ b/_demo/embed/targetsbuild/verify_builtin_debugtrap.sh @@ -59,6 +59,22 @@ classify_asm() { fi } +run_and_capture() { + local __outvar="$1" + shift + + printf '+ ' >&2 + printf '%q ' "$@" >&2 + printf '\n' >&2 + + local __out + if ! __out="$("$@" 2>&1)"; then + printf -v "${__outvar}" '%s' "${__out}" + return 1 + fi + printf -v "${__outvar}" '%s' "${__out}" +} + python3 - "$REPO_ROOT" "$@" > "${TARGETS_TSV}" <<'PY' import glob import json @@ -169,14 +185,14 @@ while IFS=$'\t' read -r name llvm_target cpu features; do ;; esac - asm_out="$("${compiler}" "${asm_flags[@]}" 2>&1)" || { + run_and_capture asm_out "${compiler}" "${asm_flags[@]}" || { printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "-" "-" "FAIL asm-compile" fail_count=$((fail_count + 1)) continue } - ir_out="$("${compiler}" "${ir_flags[@]}" 2>&1)" || { + run_and_capture ir_out "${compiler}" "${ir_flags[@]}" || { printf "%-28s %-28s %-16s %-10s %-12s %-10s %s\n" \ "${name}" "${llvm_target}" "${cpu:-"-"}" "$(basename "${compiler}")" "-" "-" "FAIL ir-compile" fail_count=$((fail_count + 1))