Skip to content

Commit

Permalink
Rollup merge of rust-lang#124543 - maurer:llvm-range, r=nikic
Browse files Browse the repository at this point in the history
codegen tests: Tolerate `range()` qualifications in enum tests

Current LLVM can infer range bounds on the i8s involved with these tests, and annotates it. Accept these bounds if present.

`@rustbot` label: +llvm-main

cc `@durin42`
  • Loading branch information
matthiaskrgr authored Apr 30, 2024
2 parents ed00f66 + 8101884 commit d81e444
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/codegen/enum/enum-match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub enum Enum0 {
B,
}

// CHECK: define noundef i8 @match0{{.*}}
// CHECK: define noundef{{( range\(i8 [0-9]+, [0-9]+\))?}} i8 @match0{{.*}}
// CHECK-NEXT: start:
// CHECK-NEXT: %1 = icmp eq i8 %0, 2
// CHECK-NEXT: %2 = and i8 %0, 1
Expand All @@ -32,7 +32,7 @@ pub enum Enum1 {
C,
}

// CHECK: define noundef i8 @match1{{.*}}
// CHECK: define noundef{{( range\(i8 [0-9]+, [0-9]+\))?}} i8 @match1{{.*}}
// CHECK-NEXT: start:
// CHECK-NEXT: %1 = add i8 %0, -2
// CHECK-NEXT: %2 = zext i8 %1 to i64
Expand Down Expand Up @@ -91,7 +91,7 @@ pub enum Enum2 {
E,
}

// CHECK: define noundef i8 @match2{{.*}}
// CHECK: define noundef{{( range\(i8 [0-9]+, [0-9]+\))?}} i8 @match2{{.*}}
// CHECK-NEXT: start:
// CHECK-NEXT: %1 = add i8 %0, 2
// CHECK-NEXT: %2 = zext i8 %1 to i64
Expand Down

0 comments on commit d81e444

Please sign in to comment.