<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97631>97631</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Test assert failures with Visual Studio 17.10.3 on Windows ARM64
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hjyamauchi
</td>
</tr>
</table>
<pre>
If I build and run the tests (`ninja check-clang check-llvm`) near head (`commit 259ce1199906554fba5c8d3b07b6ce14ee42d301`)
with Visual Studio 17.10.3 on a Windows ARM64 machine (using the arm64 native cl.exe, no emulation), I get a large number of test assert failures:
```
$ mkdir build
$ cd build
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS=clang ..\llvm
$ ninja check-clang check-llvm
...
Total Discovered Tests: 60182
Skipped : 28 (0.05%)
Unsupported : 1527 (2.54%)
Passed : 58150 (96.62%)
Expectedly Failed: 166 (0.28%)
Failed : 311 (0.52%)
```
Here are the `sort|uniq`'d assert failures from the test run:
```
# | 1: Assertion failed: getAlign() && *getAlign() == Align && "Alignment representation error!", file C:\Users\hiroshi\llvm-project\llvm\lib\IR\Globals.cpp, line 144
# | 1: Assertion failed: VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!", file C:\Users\hiroshi\llvm-project\llvm\include\llvm/CodeGenTypes/MachineValueType.h, line 201
# | Assertion failed: (TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) == TargetLowering::TypeLegal || Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) && "Unexpected illegal type!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\LegalizeDAG.cpp, line 974
# | Assertion failed: Emitted && "Failed to emit a aext!", file C:\Users\hiroshi\llvm-project\llvm\lib\Target\X86\X86FastISel.cpp, line 3408
# | Assertion failed: Emitted && "Failed to emit a zext!", file C:\Users\hiroshi\llvm-project\llvm\lib\Target\X86\X86FastISel.cpp, line 3392
# | Assertion failed: From.getNode() != To.getNode() && "Potential legalization loop!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\LegalizeTypes.cpp, line 646
# | Assertion failed: getAlign() && *getAlign() == Align && "Alignment representation error!", file C:\Users\hiroshi\llvm-project\llvm\lib\IR\Globals.cpp, line 144
# | Assertion failed: isSimple() && "Expected a SimpleValueType!", file C:\Users\hiroshi\llvm-project\llvm\include\llvm/CodeGen/ValueTypes.h, line 307
# | Assertion failed: N1.getValueType() == N2.getValueType() && N1.getValueType() == VT && "Binary operator types must match!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 6898
# | Assertion failed: N1.getValueType().bitsGT(VT) && "Invalid truncate node, src < dst!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 6062
# | Assertion failed: N1.getValueType().bitsLT(VT) && "Invalid sext node, dst < src!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 5971
# | Assertion failed: N1.getValueType().bitsLT(VT) && "Invalid zext node, dst < src!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 5992
# | Assertion failed: NVT.isInteger() == VT.isInteger() && NVT != MVT::isVoid && "Didn't find type to promote to!", file C:\Users\hiroshi\llvm-project\llvm\include\llvm/CodeGen/TargetLowering.h, line 1647
# | Assertion failed: VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!", file C:\Users\hiroshi\llvm-project\llvm\include\llvm/CodeGenTypes/MachineValueType.h, line 201
# | Assertion failed: VT == N1.getValueType() && "Not an inreg extend!", file C:\Users\hiroshi\llvm-project\llvm\lib\CodeGen\SelectionDAG\SelectionDAG.cpp, line 7061
Assertion failed: getAlign() && *getAlign() == Align && "Alignment representation error!", file C:\Users\hiroshi\llvm-project\llvm\lib\IR\Globals.cpp, line 144
```
I started looking into this because the Swift toolchain build (using downstream `swiftlang/llvm-project`) seems to result in similar assert failures with VS 17.10.3.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWN9z4jgS_mvES1dctoyN_cADYyDHHSGpQNi7p5SwG1sTWeIkOT_mr7-STQgk2UxuZ2f3autSKQpLLfn7ur9uiWbG8FIiDkn0hUTjHmtspfSw-vrEatbkFe9tVPE0nG1hBpuGiwKYLEA3EmyFYNFYA4QmJPYll18Z5BXmd2e5YLLcfxfiviaxT2gKEpmGClmxX5KruuYWaJTmGARpmvpxFPW3GxblSRFu_MEmzjHoI_ZpEfpBtwvxx8QfPXBbwZqbhglY2qbgCoKBF_heCEoCg1-4LNSDgdH1RdyHmuUVl-he2xguyxY803XcB8ksv0fIhYePSGgGUgHWjWCWK-leRzOYQYkWGAimSwTZ1BvUoLYtfWDGoLawZVw0Gg0JRx3C_Wfs7_-7R9qH-q7gunPmy2BevBmp2R3C2TksWseejbOL0T8mt19uZvPx7epfVxMSjq9R_MJtNcbNTG4VnI3n8_XF7WQx-jKf3I6Wy8n1ana5WJJwfLl4NXt1ffn3SbZyc120PI9EWRusA4QPQ9paeZ7XfVkpywSMucnVPWosYOWkQcIRxH6Q0M4IYHnHdzsswE0AAE1cSHzPjwiNDrEFuJGm2e2UtlhA-9faBxEdOHvqRf1T-ysXhG7XKAki31mlsRfTU7PJ4w5zi4V4ginjAosORhDHHQyanNp3RnuwYRB0VtHJrq8D3H7-DbXTF7Y6I7FvlLZkkDWS_7sV8aB4LRvYalUfcsol2IuQXksoBDLI4OgvcAhH7YZcyXbPjluJdiR4KV260RQIjQl1XEevJ8IxCcfQDr1Y0fa5RmlB406jQWnbtADUWmlCA0Kpy48tFwiZAxxlNwa1IVFWca1MxfeaOtt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