Skip to content

Commit 6fd7db8

Browse files
committed
Add IRGen SIL test for Builtin.isConcrete
1 parent b35559e commit 6fd7db8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/IRGen/builtin_isConcrete.sil

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swift-frontend -emit-ir -parse-sil %s -module-name Swift -parse-stdlib | %FileCheck %s
2+
3+
import Builtin
4+
5+
struct MyInt {
6+
var value: Builtin.Int32
7+
}
8+
9+
// CHECK-LABEL: define swiftcc i1 @isConcrete_true() {{.*}} {
10+
// CHECK-NEXT: entry:
11+
// CHECK-NEXT: ret i1 true
12+
// CHECK-NEXT: }
13+
sil @isConcrete_true : $@convention(thin) (@thin MyInt.Type) -> Builtin.Int1 {
14+
bb0(%0 : $@thin MyInt.Type):
15+
%1 = builtin "isConcrete"(%0 : $@thin MyInt.Type) : $Builtin.Int1
16+
return %1 : $Builtin.Int1
17+
}
18+
19+
// CHECK-LABEL: define swiftcc i1 @isConcrete_false(%swift.type* %T) {{.*}} {
20+
// CHECK-NEXT: entry:
21+
// CHECK: ret i1 false
22+
// CHECK-NEXT: }
23+
sil @isConcrete_false : $@convention(thin) <T> (@thin T.Type) -> Builtin.Int1 {
24+
bb0(%0 : $@thin T.Type):
25+
%1 = builtin "isConcrete"<T>(%0 : $@thin T.Type) : $Builtin.Int1
26+
return %1 : $Builtin.Int1
27+
}

0 commit comments

Comments
 (0)