about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-11-22 23:01:03 +0100
committerGitHub <noreply@github.com>2020-11-22 23:01:03 +0100
commit138845d43c31a1d5a9494ac3f996d6607f415cb5 (patch)
treefd39a397b3d4874e004b191ba585535673630724 /compiler/rustc_codegen_llvm/src
parent5793fa9cda2178659768908dda4d6198f43cda08 (diff)
parentb6f9705804dd590ef9fa2842bae59ec7d9130f10 (diff)
downloadrust-138845d43c31a1d5a9494ac3f996d6607f415cb5.tar.gz
rust-138845d43c31a1d5a9494ac3f996d6607f415cb5.zip
Rollup merge of #79293 - Havvy:test-eval-order-compound-assign, r=Mark-Simulacrum
Add test for eval order for a+=b

Yes, the order of evaluation *does* change depending on the types of
the operands. Cursed, I know.

I've elected to place this test into `expr/compound-assignment` creating
both the `expr` directory and the `compound-assignment` directory. I
plan in a future PR to also move the `if` directory and the loose `if`
tests into `expr/if` and other similar cleanups of the `test/ui`
directory.

Future work: Test more than just `+=`, but all operators. I don't know
if using a macro to generate these tests cases would be okay or not,
but it'd be boilerplatey without it. I'm also confident you cannot
change the evaluation order of one operator without changing all of
them.

Future work: Additionally, test more than just `i32 += i32` for the
primitive version. I don't actually know the full set of primitive
implementations, but I imagine there's enough to cause a combinatorial
explosion with the previous future work item. Somewhere on the order of
one to two hundred individual functions.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions