|
| 1 | +// RUN: %target-swift-emit-ir -I %S/Inputs %s | %FileCheck %s |
| 2 | + |
| 3 | +// This test checks that structs that are imported from a C module are mangled |
| 4 | +// in Swift names as if they are declared in the global namespace, even when |
| 5 | +// they are lexically declared nested in other C structs. |
| 6 | + |
| 7 | +import StructDeclContext |
| 8 | + |
| 9 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo13StructRegularVF"({{.*}}) |
| 10 | +public func take(_ x: StructRegular) {} |
| 11 | + |
| 12 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete1VF"({{.*}}) |
| 13 | +public func take(_: StructNestedComplete1) {} |
| 14 | + |
| 15 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo012StructNestedD9Complete1VF"({{.*}}) |
| 16 | +public func take(_: StructNestedNestedComplete1) {} |
| 17 | + |
| 18 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo012StructNestedD15CompletedLater1VF"({{.*}}) |
| 19 | +public func take(_: StructNestedNestedCompletedLater1) {} |
| 20 | + |
| 21 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater1VF"({{.*}}) |
| 22 | +public func take(_: StructNestedCompletedLater1) {} |
| 23 | + |
| 24 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo17StructTypedefTag2VF"({{.*}}) |
| 25 | +public func take(_: StructTypedefTag2) {} |
| 26 | + |
| 27 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete2VF"({{.*}}) |
| 28 | +public func take(_: StructNestedComplete2) {} |
| 29 | + |
| 30 | +// CHECK-LABEL: define {{.*}} void @"$s4main5take2yySo17StructTypedefTag2VF"({{.*}}) |
| 31 | +public func take2(_: StructTypedefName2) {} |
| 32 | + |
| 33 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater2VF"({{.*}}) |
| 34 | +public func take(_: StructNestedCompletedLater2) {} |
| 35 | + |
| 36 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo18StructTypedefName3aF"({{.*}}) |
| 37 | +public func take(_: StructTypedefName3) {} |
| 38 | + |
| 39 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete3VF"({{.*}}) |
| 40 | +public func take(_: StructNestedComplete3) {} |
| 41 | + |
| 42 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater3VF"({{.*}}) |
| 43 | +public func take(_: StructNestedCompletedLater3) {} |
| 44 | + |
| 45 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo17StructTypedefTag4VF"({{.*}}) |
| 46 | +public func take(_: StructTypedefTag4) {} |
| 47 | + |
| 48 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete4VF"({{.*}}) |
| 49 | +public func take(_: StructNestedComplete4) {} |
| 50 | + |
| 51 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySpySo17StructTypedefTag4VGF"(i8* %0) |
| 52 | +public func take(_: StructTypedefName4) {} |
| 53 | + |
| 54 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater4VF"({{.*}}) |
| 55 | +public func take(_: StructNestedCompletedLater4) {} |
| 56 | + |
| 57 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete5VF"({{.*}}) |
| 58 | +public func take(_: StructNestedComplete5) {} |
| 59 | + |
| 60 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyys13OpaquePointerVF"(i8* %0) |
| 61 | +public func take(_: StructTypedefName5) {} |
| 62 | + |
| 63 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater5VF"({{.*}}) |
| 64 | +public func take(_: StructNestedCompletedLater5) {} |
| 65 | + |
| 66 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo18StructTypedefName6aF"({{.*}}) |
| 67 | +public func take(_: StructTypedefName6) {} |
| 68 | + |
| 69 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete6VF"({{.*}}) |
| 70 | +public func take(_: StructNestedComplete6) {} |
| 71 | + |
| 72 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySpySo18StructTypedefName6aGF"(i8* %0) |
| 73 | +public func take(_: StructTypedefName6Ptr) {} |
| 74 | + |
| 75 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater6VF"({{.*}}) |
| 76 | +public func take(_: StructNestedCompletedLater6) {} |
| 77 | + |
| 78 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo18StructTypedefName7aF"({{.*}}) |
| 79 | +public func take(_: StructTypedefName7) {} |
| 80 | + |
| 81 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete7VF"({{.*}}) |
| 82 | +public func take(_: StructNestedComplete7) {} |
| 83 | + |
| 84 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySpySo18StructTypedefName7aGF"(i8* %0) |
| 85 | +public func take(_: StructTypedefName7Ptr) {} |
| 86 | + |
| 87 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater7VF"({{.*}}) |
| 88 | +public func take(_: StructNestedCompletedLater7) {} |
| 89 | + |
| 90 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo18StructTypedefName8aF"({{.*}}) |
| 91 | +public func take(_: StructTypedefName8) {} |
| 92 | + |
| 93 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo21StructNestedComplete8VF"({{.*}}) |
| 94 | +public func take(_: StructNestedComplete8) {} |
| 95 | + |
| 96 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySpySo18StructTypedefName8aGF"(i8* %0) |
| 97 | +public func take(_: StructTypedefName8Ptr) {} |
| 98 | + |
| 99 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySpySpySo18StructTypedefName8aGSgGF"(i8* %0) |
| 100 | +public func take(_: StructTypedefName8PtrPtr) {} |
| 101 | + |
| 102 | +// CHECK-LABEL: define {{.*}} void @"$s4main4takeyySo27StructNestedCompletedLater8VF"({{.*}}) |
| 103 | +public func take(_: StructNestedCompletedLater8) {} |
0 commit comments