diff options
Diffstat (limited to 'test/Index/nullability.c')
-rw-r--r-- | test/Index/nullability.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Index/nullability.c b/test/Index/nullability.c new file mode 100644 index 0000000000000..26e55cb65f476 --- /dev/null +++ b/test/Index/nullability.c @@ -0,0 +1,10 @@ +int *a; +int * _Nonnull b; +int * _Nullable c; +int * _Null_unspecified d; + +// RUN: env CINDEXTEST_INCLUDE_ATTRIBUTED_TYPES=1 c-index-test -test-print-type %s | FileCheck %s +// CHECK: VarDecl=a:1:6 [type=int *] [typekind=Pointer] [isPOD=1] [pointeetype=int] [pointeekind=Int] +// CHECK: VarDecl=b:2:16 [type=int * _Nonnull] [typekind=Attributed] [nullability=nonnull] [canonicaltype=int *] [canonicaltypekind=Pointer] [modifiedtype=int *] [modifiedtypekind=Pointer] [isPOD=1] +// CHECK: VarDecl=c:3:17 [type=int * _Nullable] [typekind=Attributed] [nullability=nullable] [canonicaltype=int *] [canonicaltypekind=Pointer] [modifiedtype=int *] [modifiedtypekind=Pointer] [isPOD=1] +// CHECK: VarDecl=d:4:25 [type=int * _Null_unspecified] [typekind=Attributed] [nullability=unspecified] [canonicaltype=int *] [canonicaltypekind=Pointer] [modifiedtype=int *] [modifiedtypekind=Pointer] [isPOD=1] |