[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / AST / ast-print-attr.c
blob4140ae6ac11fe3dfaa1087f8e3518513de2bad28
1 // RUN: %clang_cc1 -ast-print -x objective-c++ -fms-extensions %s -o - | FileCheck %s
3 // CHECK: using A = __kindof id (*)[1];
4 using A = __kindof id (*)[1];
6 // CHECK: using B = int ** __ptr32 *[3];
7 using B = int ** __ptr32 *[3];
9 // FIXME: This is the wrong spelling for the attribute.
10 // FIXME: Too many parens here!
11 // CHECK: using C = int ((*))() __attribute__((cdecl));
12 using C = int (*)() [[gnu::cdecl]];
14 // CHECK: int fun_asm() asm("test");
15 int fun_asm() asm("test");
16 // CHECK: int var_asm asm("test");
17 int var_asm asm("test");
20 @interface NSString
21 @end
23 extern NSString *const MyErrorDomain;
24 // CHECK: enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorEnum {
25 enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorEnum {
26 MyErrFirst,
27 MyErrSecond,
30 // CHECK: int *fun_returns() __attribute__((ownership_returns(fun_returns)));
31 int *fun_returns() __attribute__((ownership_returns(fun_returns)));
33 // CHECK: void fun_holds(int *a) __attribute__((ownership_holds(fun_holds, 1)));
34 void fun_holds(int *a) __attribute__((ownership_holds(fun_holds, 1)));