[Mlir-commits] [mlir] [MLIR] Validate APInt bitwidth in IntegerAttr::get(Type, APInt) (PR #188725)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Mar 26 04:37:04 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 7730 tests passed
* 603 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### MLIR-Unit
<details>
<summary>MLIR-Unit.IR/_/MLIRIRTests/IntegerAttrDeathTest/WrongBitWidthForIndexType</summary>

```
Script:
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/unittests/IR/./MLIRIRTests --gtest_filter=IntegerAttrDeathTest.WrongBitWidthForIndexType
--
/home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/unittests/IR/AttributeTest.cpp:564
Death test: IntegerAttr::get(indexTy, APInt(1, 1))
    Result: died but not with expected error.
  Expected: contains regular expression "APInt bit width must match IndexType internal storage bit width"
Actual msg:
[  DEATH   ] MLIRIRTests: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/include/mlir/IR/BuiltinAttributes.cpp.inc:408: static IntegerAttr mlir::IntegerAttr::get(Type, const APInt &): Assertion `value.getBitWidth() == IndexType::kInternalStorageBitWidth && "IntegerAttr::get: APInt bit width must match IndexType internal " "storage bit width"' failed.
[  DEATH   ]  #0 0x0000000000619f28 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
[  DEATH   ]  #1 0x0000000000616ea5 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
[  DEATH   ]  #2 0x000000000061ad41 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
[  DEATH   ]  #3 0x00007bbb63eb9330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
[  DEATH   ]  #4 0x00007bbb63f12b2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
[  DEATH   ]  #5 0x00007bbb63eb927e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
[  DEATH   ]  #6 0x00007bbb63e9c8ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
[  DEATH   ]  #7 0x00007bbb63e9c81b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
[  DEATH   ]  #8 0x00007bbb63eaf517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
[  DEATH   ]  #9 0x000000000069250b isZero /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:384:12
[  DEATH   ] #10 0x000000000069250b getBoolValue /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:472:39
[  DEATH   ] #11 0x000000000069250b mlir::IntegerAttr::get(mlir::Type, llvm::APInt const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/include/mlir/IR/BuiltinAttributes.cpp.inc:400:51
[  DEATH   ] #12 0x0000000000561ad2 isSingleWord /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:323:47
[  DEATH   ] #13 0x0000000000561ad2 needsCleanup /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:1947:39
[  DEATH   ] #14 0x0000000000561ad2 ~APInt /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:192:9
[  DEATH   ] #15 0x0000000000561ad2 (anonymous namespace)::IntegerAttrDeathTest_WrongBitWidthForIndexType_Test::TestBody() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/unittests/IR/AttributeTest.cpp:563:7
[  DEATH   ] #16 0x0000000000632ae0 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
[  DEATH   ] #17 0x0000000000632ae0 testing::Test::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2695:9
[  DEATH   ] #18 0x00000000006338c0 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
[  DEATH   ] #19 0x00000000006338c0 testing::TestInfo::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2842:11
[  DEATH   ] #20 0x00000000006344d3 testing::TestSuite::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:3018:35
[  DEATH   ] #21 0x00000000006456e4 testing::internal::UnitTestImpl::RunAllTests() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5922:41
[  DEATH   ] #22 0x0000000000644a99 testing::UnitTest::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5485:10
[  DEATH   ] #23 0x000000000061e4aa main /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
[  DEATH   ] #24 0x00007bbb63e9e1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
[  DEATH   ] #25 0x00007bbb63e9e28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
[  DEATH   ] #26 0x000000000053d285 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/unittests/IR/./MLIRIRTests+0x53d285)
[  DEATH   ] 


```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/188725


More information about the Mlir-commits mailing list