// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) \
// RUN:   -disable-objc-interop \
// RUN:   -F %clang-importer-sdk-path/frameworks %s \
// RUN:   -import-objc-header %S/Inputs/objc_implementation.h -emit-ir \
// RUN:   -target %target-future-triple > %t.ir
// RUN: %FileCheck --input-file %t.ir %s

@implementation @c
public func implFunc(_ param: Int32) {}

@implementation @c
public func implFuncCName(_ param: Int32) {}

@implementation @c(implFuncRenamed_C)
public func implFuncRenamed_Swift(param: Int32) {}

public func fn() {
  implFunc(2)
  implFuncCName(3)
  implFuncRenamed_Swift(param: 4)
}

/// implFunc(_:)
// CHECK-LABEL: define{{.*}} void @implFunc

// CHECK-NOT: define{{.*}} swiftcc void @"$s16c_implementation8implFuncyys5Int32VF"

/// inplFuncCName(_:)
// CHECK-LABEL: define{{.*}} void @"\01_implFuncAsmName"

// CHECK-NOT: define{{.*}} swiftcc void @"$s16c_implementation13implFuncCNameyys5Int32VF"

/// fn()
// CHECK-LABEL: define{{.*}} swiftcc void @"$s16c_implementation2fnyyF"
// CHECK:   call void @implFunc
// CHECK:   call void @"\01_implFuncAsmName"
// CHECK:   call void @implFuncRenamed_C
// CHECK:   ret void
// CHECK: }

