Created
August 16, 2026 20:29
-
-
Save makslevental/ec62fb5ddd76ef59df0b277bb2c80d90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # run_issue_tests.sh — run the test(s) that llvm/llvm-project#163599 reports as | |
| # failing, one at a time, via lit, so each PASS/FAIL is unambiguous. | |
| # | |
| # Requires a build with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON (as in the | |
| # issue). Usage: ./run_issue_tests.sh | |
| # | |
| set -uo pipefail | |
| REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| cd "$REPO" | |
| LIT="$REPO/cmake-build-debug/bin/llvm-lit" | |
| BUILD_TEST_ROOT="$REPO/cmake-build-debug/tools/mlir/test" | |
| # The 64 failing tests explicitly listed in issue #163599 | |
| # (comment: https://github.com/llvm/llvm-project/issues/163599#issuecomment-3407732193) | |
| ISSUE_TESTS=( | |
| "Conversion/ArithToLLVM/arith-to-llvm.mlir" | |
| "Conversion/ArithToLLVM/type-conversion.mlir" | |
| "Conversion/ComplexToLLVM/convert-to-llvm.mlir" | |
| "Conversion/ControlFlowToLLVM/assert.mlir" | |
| "Conversion/FuncToLLVM/func-to-llvm.mlir" | |
| "Conversion/GPUToNVVM/gpu-to-nvvm-target-attr.mlir" | |
| "Conversion/IndexToLLVM/index-to-llvm.mlir" | |
| "Conversion/MathToLLVM/math-to-llvm.mlir" | |
| "Conversion/MemRefToLLVM/type-conversion.mlir" | |
| "Conversion/NVVMToLLVM/nvvm-to-llvm.mlir" | |
| "Conversion/OpenMPToLLVM/convert-to-llvmir.mlir" | |
| "Conversion/SCFToOpenMP/reductions.mlir" | |
| "Conversion/SCFToOpenMP/scf-to-openmp.mlir" | |
| "Conversion/ShardToMPI/convert-shard-to-mpi.mlir" | |
| "Conversion/ShardToMPI/convert-shardshape-to-mpi.mlir" | |
| "Conversion/UBToLLVM/ub-to-llvm.mlir" | |
| "Conversion/VectorToLLVM/vector-to-llvm-interface.mlir" | |
| "Conversion/VectorToLLVM/vector-to-llvm.mlir" | |
| "Conversion/XeVMToLLVM/xevm-to-llvm.mlir" | |
| "Dialect/Complex/powi-simplify.mlir" | |
| "Dialect/Linalg/transform-tile-and-fuse-pack-unpack.mlir" | |
| "Dialect/MemRef/flatten_memref.mlir" | |
| "Dialect/SCF/canonicalize.mlir" | |
| "Dialect/Shard/canonicalization.mlir" | |
| "Dialect/SparseTensor/external.mlir" | |
| "Dialect/SparseTensor/external_direct.mlir" | |
| "Dialect/SparseTensor/fuse_sparse_convert_into_producer.mlir" | |
| "Dialect/SparseTensor/sparse_1d.mlir" | |
| "Dialect/SparseTensor/sparse_2d.mlir" | |
| "Dialect/SparseTensor/sparse_3d.mlir" | |
| "Dialect/SparseTensor/sparse_fp_ops.mlir" | |
| "Dialect/SparseTensor/sparse_fusion.mlir" | |
| "Dialect/SparseTensor/sparse_int_ops.mlir" | |
| "Dialect/SparseTensor/sparse_relu.mlir" | |
| "Dialect/SparseTensor/sparse_vector_index.mlir" | |
| "Dialect/SparseTensor/torch_linalg.mlir" | |
| "Dialect/Vector/vector-rewrite-narrow-types.mlir" | |
| "Dialect/Vector/vector-rewrite-subbyte-ext-and-trunci.mlir" | |
| "Dialect/Vector/vector-warp-distribute.mlir" | |
| "Dialect/XeGPU/subgroup-distribute.mlir" | |
| "Integration/Dialect/MemRef/assume-alignment-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/atomic-rmw-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/cast-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/copy-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/dim-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/load-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/store-runtime-verification.mlir" | |
| "Integration/Dialect/MemRef/subview-runtime-verification.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_cmp.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_coo_test.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_index.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_index_dense.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_reduce_custom_sum.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_reductions_min.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_reductions_prod.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_scf_nested.mlir" | |
| "Integration/Dialect/SparseTensor/CPU/sparse_unary.mlir" | |
| "Integration/Dialect/Tensor/cast-runtime-verification.mlir" | |
| "Integration/Dialect/Tensor/dim-runtime-verification.mlir" | |
| "Integration/Dialect/Tensor/extract-runtime-verification.mlir" | |
| "Integration/Dialect/Tensor/extract_slice-runtime-verification.mlir" | |
| "Transforms/test-context-aware-type-converter.mlir" | |
| "Transforms/test-legalizer.mlir" | |
| "Transforms/test-strict-pattern-driver.mlir" | |
| ) | |
| if [[ ! -x "$LIT" ]]; then | |
| echo "ERROR: llvm-lit not found at $LIT (build it first)." >&2 | |
| exit 2 | |
| fi | |
| echo "llvm-lit : $LIT" | |
| echo "tests : ${#ISSUE_TESTS[@]} (explicitly named as failing in issue #163599)" | |
| echo | |
| pass=0 fail=0 other=0 | |
| failed_tests=() | |
| for rel in "${ISSUE_TESTS[@]}"; do | |
| # Escape regex metacharacters and anchor so exactly one test matches. | |
| esc="$(printf '%s' "$rel" | sed 's/[.[\*^$()+?{|]/\\&/g')" | |
| out="$("$LIT" --no-progress-bar --filter="${esc}\$" "$BUILD_TEST_ROOT" 2>&1)" | |
| if grep -qE "^PASS:" <<<"$out"; then | |
| printf 'PASS %s\n' "$rel"; ((pass++)) | |
| elif grep -qE "^(FAIL|UNRESOLVED|TIMEOUT):" <<<"$out"; then | |
| printf 'FAIL %s\n' "$rel"; ((fail++)); failed_tests+=("$rel") | |
| elif grep -qE "^(UNSUPPORTED|XFAIL):" <<<"$out"; then | |
| printf 'SKIP %s (unsupported/xfail)\n' "$rel"; ((other++)) | |
| else | |
| printf '???? %s (no test discovered / unknown result)\n' "$rel" | |
| ((other++)); failed_tests+=("$rel (unknown)") | |
| echo "$out" | sed 's/^/ | /' | |
| fi | |
| done | |
| echo | |
| echo "======================================" | |
| echo "passed: $pass failed: $fail skipped/other: $other" | |
| if ((fail > 0 || other > 0)); then | |
| echo "not-passing:" | |
| printf ' - %s\n' "${failed_tests[@]}" | |
| exit 1 | |
| fi | |
| echo "All issue tests passed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment