Skip to content

Commit

Permalink
Fix test expectations for 32bit x86
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Oct 19, 2024
1 parent 8ed77fd commit cc7044b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tests/assembly/x86-return-float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ pub fn return_f16(x: f16) -> f16 {
#[no_mangle]
pub fn return_f128(x: f128) -> f128 {
// CHECK: movl [[#%d,OFFSET:]](%ebp), %[[PTR:.*]]
// CHECK-NEXT: movl [[#%d,OFFSET+16]](%ebp), %[[VAL4:.*]]
// CHECK-NEXT: movl [[#%d,OFFSET+4]](%ebp), %[[VAL1:.*]]
// CHECK-NEXT: movl [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
// CHECK-NEXT: movl [[#%d,OFFSET+12]](%ebp), %[[VAL3:.*]]
// CHECK-NEXT: movl [[#%d,OFFSET+16]](%ebp), %[[VAL4:.*]]
// CHECK-NEXT: movl %[[VAL4:.*]] 12(%[[PTR]])
// CHECK-NEXT: movl %[[VAL3:.*]] 8(%[[PTR]])
// CHECK-NEXT: movl %[[VAL2:.*]] 4(%[[PTR]])
Expand Down
12 changes: 6 additions & 6 deletions tests/codegen/mir-aggregate-no-alloca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ pub fn make_struct_1(a: i32) -> Struct1 {

pub struct Struct2Asc(i16, i64);

// bit32-LABEL: void @make_struct_2_asc({{.*}} sret([16 x i8]) {{.*}} %s,
// bit32-LABEL: void @make_struct_2_asc({{.*}} sret({{[^,]*}}) {{.*}} %s,
// bit64-LABEL: { i64, i16 } @make_struct_2_asc(
// CHECK-SAME: i16 noundef %a, i64 noundef %b)
#[no_mangle]
pub fn make_struct_2_asc(a: i16, b: i64) -> Struct2Asc {
// CHECK-NOT: alloca
// bit32: %[[GEP:.+]] = getelementptr inbounds i8, ptr %s, i32 8
// bit32: store i16 %a, ptr %[[GEP]], align 8
// bit32: store i64 %b, ptr %s, align 8
// bit32: store i16 %a, ptr %[[GEP]]
// bit32: store i64 %b, ptr %s
// bit64: %[[TEMP0:.+]] = insertvalue { i64, i16 } poison, i64 %b, 0
// bit64: %[[TEMP1:.+]] = insertvalue { i64, i16 } %[[TEMP0]], i16 %a, 1
// bit64: ret { i64, i16 } %[[TEMP1]]
Expand All @@ -120,15 +120,15 @@ pub fn make_struct_2_asc(a: i16, b: i64) -> Struct2Asc {

pub struct Struct2Desc(i64, i16);

// bit32-LABEL: void @make_struct_2_desc({{.*}} sret([16 x i8]) {{.*}} %s,
// bit32-LABEL: void @make_struct_2_desc({{.*}} sret({{[^,]*}}) {{.*}} %s,
// bit64-LABEL: { i64, i16 } @make_struct_2_desc(
// CHECK-SAME: i64 noundef %a, i16 noundef %b)
#[no_mangle]
pub fn make_struct_2_desc(a: i64, b: i16) -> Struct2Desc {
// CHECK-NOT: alloca
// bit32: store i64 %a, ptr %s, align 8
// bit32: store i64 %a, ptr %s
// bit32: %[[GEP:.+]] = getelementptr inbounds i8, ptr %s, i32 8
// bit32: store i16 %b, ptr %[[GEP]], align 8
// bit32: store i16 %b, ptr %[[GEP]]
// bit64: %[[TEMP0:.+]] = insertvalue { i64, i16 } poison, i64 %a, 0
// bit64: %[[TEMP1:.+]] = insertvalue { i64, i16 } %[[TEMP0]], i16 %b, 1
// bit64: ret { i64, i16 } %[[TEMP1]]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/range-attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum Enum1 {
C(u64),
}

// bit32: void @enum1_value({{.*}} sret([16 x i8]) {{[^,]*}}, [[ENUM1_TYP:i[0-9]+]]
// bit32: void @enum1_value({{.*}} sret({{[^,]*}}) {{[^,]*}}, [[ENUM1_TYP:i[0-9]+]]
// bit64: { [[ENUM1_TYP:i[0-9]+]], i64 } @enum1_value([[ENUM1_TYP]]
// CHECK-SAME: noundef range([[ENUM1_TYP]] 0, 3) %x.0, i64 noundef %x.1)
#[no_mangle]
Expand Down
12 changes: 4 additions & 8 deletions tests/codegen/tuple-layout-opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,31 @@ pub fn test_ScalarZstFirst(_: ScalarZstFirst) -> ScalarZstFirst {
}

type ScalarPairZstLast = (u8, u128, ());
// bit32: define {{(dso_local )?}}void @test_ScalarPairZstLast(ptr sret([24 x i8]) align 8
// bit64: define {{(dso_local )?}}void @test_ScalarPairZstLast(ptr sret([32 x i8]) align 16
// CHECK: define {{(dso_local )?}}void @test_ScalarPairZstLast(ptr sret({{[^,]*}})
// CHECK-SAME: %_0, i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairZstLast(_: ScalarPairZstLast) -> ScalarPairZstLast {
loop {}
}

type ScalarPairZstFirst = ((), u8, u128);
// bit32: define {{(dso_local )?}}void @test_ScalarPairZstFirst(ptr sret([24 x i8]) align 8
// bit64: define {{(dso_local )?}}void @test_ScalarPairZstFirst(ptr sret([32 x i8]) align 16
// CHECK: define {{(dso_local )?}}void @test_ScalarPairZstFirst(ptr sret({{[^,]*}})
// CHECK-SAME: %_0, i8 %_1.0, i128 %_1.1)
#[no_mangle]
pub fn test_ScalarPairZstFirst(_: ScalarPairZstFirst) -> ScalarPairZstFirst {
loop {}
}

type ScalarPairLotsOfZsts = ((), u8, (), u128, ());
// bit32: define {{(dso_local )?}}void @test_ScalarPairLotsOfZsts(ptr sret([24 x i8]) align 8
// bit64: define {{(dso_local )?}}void @test_ScalarPairLotsOfZsts(ptr sret([32 x i8]) align 16
// CHECK: define {{(dso_local )?}}void @test_ScalarPairLotsOfZsts(ptr sret({{[^,]*}})
// CHECK-SAME: %_0, i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairLotsOfZsts(_: ScalarPairLotsOfZsts) -> ScalarPairLotsOfZsts {
loop {}
}

type ScalarPairLottaNesting = (((), ((), u8, (), u128, ())), ());
// bit32: define {{(dso_local )?}}void @test_ScalarPairLottaNesting(ptr sret([24 x i8]) align 8
// bit64: define {{(dso_local )?}}void @test_ScalarPairLottaNesting(ptr sret([32 x i8]) align 16
// CHECK: define {{(dso_local )?}}void @test_ScalarPairLottaNesting(ptr sret({{[^,]*}})
// CHECK-SAME: %_0, i128 %_1.0, i8 %_1.1)
#[no_mangle]
pub fn test_ScalarPairLottaNesting(_: ScalarPairLottaNesting) -> ScalarPairLottaNesting {
Expand Down

0 comments on commit cc7044b

Please sign in to comment.