We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f671e50 commit 263f611Copy full SHA for 263f611
test/IRGen/integer-comparison.swift
@@ -0,0 +1,13 @@
1
+// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s
2
+
3
+func f(_ x: Int, _ y: UInt32) -> Bool { x < y }
4
+// CHECK-LABEL: define {{.*}} @"$s4main1fySbSi_s6UInt32VtF"(i64 %0, i32 %1)
5
+// CHECK: %2 = zext i32 %1 to i64
6
+// CHECK-NEXT: %3 = icmp sgt i64 %2, %0
7
+// CHECK-NEXT: ret i1 %3
8
9
+func g(_ x: UInt32, _ y: Int) -> Bool { x < y }
10
+// CHECK-LABEL: define {{.*}} @"$s4main1gySbs6UInt32V_SitF"(i32 %0, i64 %1)
11
+// CHECK: %2 = zext i32 %0 to i64
12
+// CHECK-NEXT: %3 = icmp slt i64 %2, %1
13
0 commit comments