Files
rust/tests/codegen-llvm
Jonathan Brouwer 141ccbc3a3 Rollup merge of #161070 - folkertdev:armv7-align-abi, r=davidtwco
fix arm homogeneous aggregate ABI

This started with abi-cafe finding a mismatch between rustc and clang/gcc, but turned into quite the rabbit hole of bits of ABI that were never implemented. The code is effectively ported from LLVM, and abi-cafe is happy now.

The bug I hit was that aligned structs were passed incorrectly:

https://godbolt.org/z/jErPoPrv5

The assertions for watchOS are best-effort, I can't actually run that. But, it's tier 3, it was already broken, so at worst it's just less broken now.

The relevant code is in 551766823b/clang/lib/CodeGen/Targets/ARM.cpp, I'll link some specific parts.

r? davidtwco
2026-08-20 14:45:38 +02:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…

The files here use the LLVM FileCheck framework, documented at https://llvm.org/docs/CommandGuide/FileCheck.html.

One extension worth noting is the use of revisions as custom prefixes for FileCheck. If your codegen test has different behavior based on the chosen target or different compiler flags that you want to exercise, you can use a revisions annotation, like so:

// revisions: aaa bbb
// [bbb] compile-flags: --flags-for-bbb

After specifying those variations, you can write different expected, or explicitly unexpected output by using <prefix>-SAME: and <prefix>-NOT:, like so:

// CHECK: expected code
// aaa-SAME: emitted-only-for-aaa
// aaa-NOT:                        emitted-only-for-bbb
// bbb-NOT:  emitted-only-for-aaa
// bbb-SAME:                       emitted-only-for-bbb