@@ -5,6 +5,27 @@ import CoreGraphics
55
66// REQUIRES: OS=macosx
77
8+ // CHECK: [[SWITCHTABLE:@.*]] = private unnamed_addr constant [8 x i64] [i64 0, i64 12, i64 23, i64 34, i64 45, i64 55, i64 67, i64 71]
9+
10+ // CHECK-LABEL: define i64 {{.*}}testEnums{{.*}} {
11+ public func testEnums( _ model: CGColorSpaceModel ) -> Int {
12+ switch model {
13+ case . unknown : return 0
14+ case . monochrome : return 12
15+ case . rgb : return 23
16+ case . cmyk : return 34
17+ case . lab : return 45
18+ case . deviceN : return 55
19+ case . indexed : return 67
20+ case . pattern : return 71
21+
22+ default : return 0
23+ }
24+ // CHECK: [[GEP:%.+]] = getelementptr inbounds [8 x i64], [8 x i64]* [[SWITCHTABLE]], i64 0, i64 %{{.*}}
25+ // CHECK: [[LOAD:%.+]] = load i64, i64* [[GEP]], align 8
26+ // CHECK: ret i64 [[LOAD]]
27+ }
28+
829// CHECK-LABEL: define void {{.*}}rotationAround{{.*}} {
930// Get a transform that will rotate around a given offset
1031public func rotationAround( offset: CGPoint , angle: CGFloat ,
@@ -104,7 +125,7 @@ public func testRenames(transform: CGAffineTransform, context: CGContext,
104125 from: edge)
105126 assert ( ( slice, remainder) == rect. divided ( atDistance: CGFloat ( 2.0 ) ,
106127 from: edge) )
107- // CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %slice , %struct.CGRect* nonnull %remainder , double {{2\.0+.*}}, i32 %{{.*}})
128+ // CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %{{.*}} , %struct.CGRect* nonnull %{{.*}} , double {{2\.0+.*}}, i32 %{{.*}})
108129//
109130// CHECK: ret void
110131}
0 commit comments