forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneric-ancestry.swift
37 lines (30 loc) · 1.28 KB
/
generic-ancestry.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Please keep this file in alphabetical order!
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t %s -module-name generic -disable-objc-attr-requires-foundation-module
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/generic.swiftmodule -typecheck -emit-objc-header-path %t/generic.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
// RUN: %FileCheck %s < %t/generic.h
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/generic.h
// RUN: %check-in-clang %t/generic.h
// REQUIRES: objc_interop
import ObjectiveC
// CHECK-LABEL: @interface ConcreteClass
// CHECK-NEXT: init
// CHECK-NEXT: @end
@objc class ConcreteClass {}
// CHECK-NOT: @interface GenericSubclass
// NEGATIVE-NOT: @interface GenericSubclass
class GenericSubclass<T> : ConcreteClass {}
// CHECK-NOT: @interface NonGenericSubclass
// NEGATIVE-NOT: @interface NonGenericSubclass
class NonGenericSubclass : GenericSubclass<ConcreteClass> {}
// CHECK-LABEL: @interface TopMoviesOfAllTime
// CHECK-NEXT: rambo
// CHECK-NEXT: init
// CHECK-NOT: rocky
// NEGATIVE-NOT: rocky
// CHECK-NEXT: @end
@objc class TopMoviesOfAllTime {
func rambo(c: ConcreteClass) {}
func rocky(c: NonGenericSubclass) {}
}