1
1
//@ compile-flags: -Copt-level=3
2
+ //@ revisions: LLVM20 LLVM21
3
+ //@[LLVM20] exact-llvm-major-version: 20
4
+ //@[LLVM21] min-llvm-version: 21
2
5
3
6
// See https://github.com/rust-lang/rust/issues/135802
4
7
@@ -24,7 +27,8 @@ extern "Rust" {
24
27
pub fn test_uninhabited_ret_by_ref ( ) {
25
28
// CHECK: %_1 = alloca [24 x i8], align {{8|4}}
26
29
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %_1)
27
- // CHECK-NEXT: call void @opaque(ptr noalias nocapture noundef nonnull sret([24 x i8]) align {{8|4}} dereferenceable(24) %_1) #2
30
+ // LLVM20-NEXT: call void @opaque(ptr noalias nocapture noundef nonnull sret([24 x i8]) align {{8|4}} dereferenceable(24) %_1) #2
31
+ // LLVM21-NEXT: call void @opaque(ptr noalias noundef nonnull sret([24 x i8]) align {{8|4}} captures(none) dereferenceable(24) %_1) #2
28
32
// CHECK-NEXT: unreachable
29
33
unsafe {
30
34
opaque ( ) ;
@@ -36,7 +40,8 @@ pub fn test_uninhabited_ret_by_ref() {
36
40
pub fn test_uninhabited_ret_by_ref_with_arg ( rsi : u32 ) {
37
41
// CHECK: %_2 = alloca [24 x i8], align {{8|4}}
38
42
// CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %_2)
39
- // CHECK-NEXT: call void @opaque_with_arg(ptr noalias nocapture noundef nonnull sret([24 x i8]) align {{8|4}} dereferenceable(24) %_2, i32 noundef %rsi) #2
43
+ // LLVM20-NEXT: call void @opaque_with_arg(ptr noalias nocapture noundef nonnull sret([24 x i8]) align {{8|4}} dereferenceable(24) %_2, i32 noundef %rsi) #2
44
+ // LLVM21-NEXT: call void @opaque_with_arg(ptr noalias noundef nonnull sret([24 x i8]) align {{8|4}} captures(none) dereferenceable(24) %_2, i32 noundef %rsi) #2
40
45
// CHECK-NEXT: unreachable
41
46
unsafe {
42
47
opaque_with_arg ( rsi) ;
0 commit comments