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 52075f0Copy full SHA for 52075f0
test/IRGen/integer-comparison.swift
@@ -0,0 +1,14 @@
1
+// RUN: %target-swift-frontend -primary-file %s -O -emit-ir | %FileCheck %s
2
+// REQUIRES: CPU=x86_64 || CPU=arm64
3
+
4
+func f(_ x: Int, _ y: UInt32) -> Bool { x < y }
5
+// CHECK-LABEL: define {{.*}} @"$s4main1fySbSi_s6UInt32VtF"(i64 %0, i32 %1)
6
+// CHECK: %2 = zext i32 %1 to i64
7
+// CHECK-NEXT: %3 = icmp sgt i64 %2, %0
8
+// CHECK-NEXT: ret i1 %3
9
10
+func g(_ x: UInt32, _ y: Int) -> Bool { x < y }
11
+// CHECK-LABEL: define {{.*}} @"$s4main1gySbs6UInt32V_SitF"(i32 %0, i64 %1)
12
+// CHECK: %2 = zext i32 %0 to i64
13
+// CHECK-NEXT: %3 = icmp slt i64 %2, %1
14
0 commit comments