Files
swift-mirror/test/PrintAsObjC/swift_name.m
Dmitri Gribenko 486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00

28 lines
954 B
Objective-C

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %S/../Inputs/empty.swift -typecheck -emit-objc-header-path %t/empty.h
// RUN: %clang -E -fobjc-arc -fmodules -isysroot %clang-importer-sdk-path -I %t %s | %FileCheck %s
// REQUIRES: objc_interop
#import "empty.h"
@class ABC; // CHECK-LABEL: @class ABC;
SWIFT_CLASS(abc) // CHECK-NEXT: __attribute__((objc_runtime_name(abc)))
@interface ABC // CHECK-NEXT: @interface
@end
@class DEF; // CHECK-LABEL: @class DEF;
SWIFT_CLASS_NAMED(def) // CHECK-NEXT: __attribute__((swift_name(def)))
@interface DEF // CHECK-NEXT: @interface
@end
@protocol AAA; // CHECK-LABEL: @protocol AAA;
SWIFT_PROTOCOL(aaa) // CHECK-NEXT: __attribute__((objc_runtime_name(aaa)))
@protocol AAA // CHECK-NEXT: @protocol
@end
@protocol BBB; // CHECK-LABEL: @protocol BBB;
SWIFT_PROTOCOL_NAMED(bbb) // CHECK-NEXT: __attribute__((swift_name(bbb)))
@protocol BBB // CHECK-NEXT: @protocol
@end