diff options
| author | bors <bors@rust-lang.org> | 2023-10-17 06:02:30 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-17 06:02:30 +0000 |
| commit | f40849235404d47abc0ec49c8b5aa252fa00dbbc (patch) | |
| tree | 610130b1204080962cb26ea8f7f9f5224b9f2879 /tests/codegen | |
| parent | c1dbc19670849f1793e1c9277ffb2456230bfbe7 (diff) | |
| parent | d6f52bff276fea938b116332dc7ecf5daba84bec (diff) | |
| download | rust-f40849235404d47abc0ec49c8b5aa252fa00dbbc.tar.gz rust-f40849235404d47abc0ec49c8b5aa252fa00dbbc.zip | |
Auto merge of #3126 - rust-lang:rustup-2023-10-17, r=RalfJung
Automatic Rustup
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/target-feature-inline-closure.rs | 4 | ||||
| -rw-r--r-- | tests/codegen/vec_pop_push_noop.rs | 24 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/codegen/target-feature-inline-closure.rs b/tests/codegen/target-feature-inline-closure.rs index d075706173f..54cb27242d5 100644 --- a/tests/codegen/target-feature-inline-closure.rs +++ b/tests/codegen/target-feature-inline-closure.rs @@ -31,3 +31,7 @@ unsafe fn without_avx(x: __m256) -> __m256 { }; add(x, x) } + +// Don't allow the above CHECK-NOT to accidentally match a commit hash in the +// compiler version. +// CHECK-LABEL: rustc version diff --git a/tests/codegen/vec_pop_push_noop.rs b/tests/codegen/vec_pop_push_noop.rs new file mode 100644 index 00000000000..8bc7b68a816 --- /dev/null +++ b/tests/codegen/vec_pop_push_noop.rs @@ -0,0 +1,24 @@ +// compile-flags: -O + +#![crate_type = "lib"] + +#[no_mangle] +// CHECK-LABEL: @noop( +pub fn noop(v: &mut Vec<u8>) { + // CHECK-NOT: reserve_for_push + // CHECK-NOT: call + // CHECK: tail call void @llvm.assume + // CHECK-NOT: reserve_for_push + // CHECK-NOT: call + // CHECK: ret + if let Some(x) = v.pop() { + v.push(x) + } +} + +#[no_mangle] +// CHECK-LABEL: @push_byte( +pub fn push_byte(v: &mut Vec<u8>) { + // CHECK: call {{.*}}reserve_for_push + v.push(3); +} |
