From 364d23272f5b3edc1181e81025c8ee6791c515bd Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Mon, 1 Aug 2016 15:11:14 -0700 Subject: [PATCH 1/2] [CoreGraphics] fix up a few inconsistent names --- apinotes/CoreGraphics.apinotes | 5 +++++ test/ClangModules/CoreGraphics_test.swift | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/apinotes/CoreGraphics.apinotes b/apinotes/CoreGraphics.apinotes index 59693ebef8cce..c34e8a3a6edaa 100644 --- a/apinotes/CoreGraphics.apinotes +++ b/apinotes/CoreGraphics.apinotes @@ -514,6 +514,11 @@ Enumerators: SwiftName: CGColorRenderingIntent.saturation - Name: kCGMomentumScrollPhaseContinue SwiftName: CGMomentumScrollPhase.continuous +- Name: kCGColorSpaceModelRGB + SwiftName: CGColorSpaceModel.rgb +- Name: kCGColorSpaceModelCMYK + SwiftName: CGColorSpaceModel.cmyk + # CGContext - Name: kCGBlendModeXOR SwiftName: CGBlendMode.xor diff --git a/test/ClangModules/CoreGraphics_test.swift b/test/ClangModules/CoreGraphics_test.swift index 8ee92637bfb30..52ac6f2dbb8c7 100644 --- a/test/ClangModules/CoreGraphics_test.swift +++ b/test/ClangModules/CoreGraphics_test.swift @@ -5,6 +5,27 @@ import CoreGraphics // REQUIRES: OS=macosx +// 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] + +// CHECK-LABEL: define i64 {{.*}}testEnums{{.*}} { +public func testEnums(_ model: CGColorSpaceModel) -> Int { + switch model { + case .unknown : return 0 + case .monochrome : return 12 + case .rgb : return 23 + case .cmyk : return 34 + case .lab : return 45 + case .deviceN : return 55 + case .indexed : return 67 + case .pattern : return 71 + + default: return 0 + } +// CHECK: [[GEP:%.+]] = getelementptr inbounds [8 x i64], [8 x i64]* [[SWITCHTABLE]], i64 0, i64 %{{.*}} +// CHECK: [[LOAD:%.+]] = load i64, i64* [[GEP]], align 8 +// CHECK: ret i64 [[LOAD]] +} + // CHECK-LABEL: define void {{.*}}rotationAround{{.*}} { // Get a transform that will rotate around a given offset public func rotationAround(offset: CGPoint, angle: CGFloat, From a740345273710f3a75030720be2b710a260b4c79 Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Mon, 1 Aug 2016 15:30:54 -0700 Subject: [PATCH 2/2] [test] Remove LLVM value names to pass no-assert builds --- test/ClangModules/CoreGraphics_test.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ClangModules/CoreGraphics_test.swift b/test/ClangModules/CoreGraphics_test.swift index 52ac6f2dbb8c7..f5f64f39d65f0 100644 --- a/test/ClangModules/CoreGraphics_test.swift +++ b/test/ClangModules/CoreGraphics_test.swift @@ -125,7 +125,7 @@ public func testRenames(transform: CGAffineTransform, context: CGContext, from: edge) assert((slice, remainder) == rect.divided(atDistance: CGFloat(2.0), from: edge)) -// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %slice, %struct.CGRect* nonnull %remainder, double {{2\.0+.*}}, i32 %{{.*}}) +// CHECK: call void @CGRectDivide(%struct.CGRect* byval nonnull align 8 %{{.*}}, %struct.CGRect* nonnull %{{.*}}, %struct.CGRect* nonnull %{{.*}}, double {{2\.0+.*}}, i32 %{{.*}}) // // CHECK: ret void }