diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-11-25 22:22:40 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2023-11-25 22:25:00 -0800 |
| commit | 4b3f11523dc62235bebbc214c55ecf63ff9ee8eb (patch) | |
| tree | eb6b6103781e0bdfb066328b2e90811b70d97c64 /tests/codegen | |
| parent | ec1393f14efa179a968ec5b99c1ed62719198267 (diff) | |
| download | rust-4b3f11523dc62235bebbc214c55ecf63ff9ee8eb.tar.gz rust-4b3f11523dc62235bebbc214c55ecf63ff9ee8eb.zip | |
Remove an unneeded helper from the tuple library code
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/comparison-operators-2-tuple.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/codegen/comparison-operators-2-tuple.rs b/tests/codegen/comparison-operators-2-tuple.rs index 7a2a3fc93f8..633cfe3a8ac 100644 --- a/tests/codegen/comparison-operators-2-tuple.rs +++ b/tests/codegen/comparison-operators-2-tuple.rs @@ -10,8 +10,10 @@ type TwoTuple = (i16, u16); // // The operators are all overridden directly, so should optimize easily. // -// Yes, the `s[lg]t` is correct for the `[lg]e` version because it's only used -// in the side of the select where we know the values are *not* equal. +// slt-vs-sle and sgt-vs-sge don't matter because they're only used in the side +// of the select where we know the values are not equal, and thus the tests +// use a regex to allow either, since unimportant changes to the implementation +// sometimes result in changing what LLVM decides to emit for this. // // CHECK-LABEL: @check_lt_direct @@ -19,7 +21,7 @@ type TwoTuple = (i16, u16); #[no_mangle] pub fn check_lt_direct(a: TwoTuple, b: TwoTuple) -> bool { // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]] - // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]] + // CHECK-DAG: %[[CMP0:.+]] = icmp {{slt|sle}} i16 %[[A0]], %[[B0]] // CHECK-DAG: %[[CMP1:.+]] = icmp ult i16 %[[A1]], %[[B1]] // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]] // CHECK: ret i1 %[[R]] @@ -31,7 +33,7 @@ pub fn check_lt_direct(a: TwoTuple, b: TwoTuple) -> bool { #[no_mangle] pub fn check_le_direct(a: TwoTuple, b: TwoTuple) -> bool { // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]] - // CHECK-DAG: %[[CMP0:.+]] = icmp slt i16 %[[A0]], %[[B0]] + // CHECK-DAG: %[[CMP0:.+]] = icmp {{slt|sle}} i16 %[[A0]], %[[B0]] // CHECK-DAG: %[[CMP1:.+]] = icmp ule i16 %[[A1]], %[[B1]] // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]] // CHECK: ret i1 %[[R]] @@ -43,7 +45,7 @@ pub fn check_le_direct(a: TwoTuple, b: TwoTuple) -> bool { #[no_mangle] pub fn check_gt_direct(a: TwoTuple, b: TwoTuple) -> bool { // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]] - // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]] + // CHECK-DAG: %[[CMP0:.+]] = icmp {{sgt|sge}} i16 %[[A0]], %[[B0]] // CHECK-DAG: %[[CMP1:.+]] = icmp ugt i16 %[[A1]], %[[B1]] // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]] // CHECK: ret i1 %[[R]] @@ -55,7 +57,7 @@ pub fn check_gt_direct(a: TwoTuple, b: TwoTuple) -> bool { #[no_mangle] pub fn check_ge_direct(a: TwoTuple, b: TwoTuple) -> bool { // CHECK-DAG: %[[EQ:.+]] = icmp eq i16 %[[A0]], %[[B0]] - // CHECK-DAG: %[[CMP0:.+]] = icmp sgt i16 %[[A0]], %[[B0]] + // CHECK-DAG: %[[CMP0:.+]] = icmp {{sgt|sge}} i16 %[[A0]], %[[B0]] // CHECK-DAG: %[[CMP1:.+]] = icmp uge i16 %[[A1]], %[[B1]] // CHECK: %[[R:.+]] = select i1 %[[EQ]], i1 %[[CMP1]], i1 %[[CMP0]] // CHECK: ret i1 %[[R]] |
