41 lines · c
1// RUN: %clang_cc1 -ast-print -x objective-c++ -fms-extensions %s -o - | FileCheck %s2 3// CHECK: using A = __kindof id (*)[1];4using A = __kindof id (*)[1];5 6// CHECK: using B = int ** __ptr32 *[3];7using B = int ** __ptr32 *[3];8 9// FIXME: This is the wrong spelling for the attribute.10// FIXME: Too many parens here!11// CHECK: using C = int ((*))() __attribute__((cdecl));12using C = int (*)() [[gnu::cdecl]];13 14// CHECK: int fun_asm() asm("test");15int fun_asm() asm("test");16// CHECK: int var_asm asm("test");17int var_asm asm("test");18 19 20@interface NSString21@end22 23extern NSString *const MyErrorDomain;24// CHECK: enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorEnum {25enum __attribute__((ns_error_domain(MyErrorDomain))) MyErrorEnum {26 MyErrFirst,27 MyErrSecond,28};29 30// CHECK: int *fun_returns() __attribute__((ownership_returns(fun_returns)));31int *fun_returns() __attribute__((ownership_returns(fun_returns)));32 33// CHECK: void fun_holds(int *a) __attribute__((ownership_holds(fun_holds, 1)));34void fun_holds(int *a) __attribute__((ownership_holds(fun_holds, 1)));35 36// CHECK: int fun_var_unused() {37// CHECK-NEXT: int x __attribute__((unused)) = 0;38// CHECK-NEXT: return x;39// CHECK-NEXT: }40int fun_var_unused() { int x __attribute__((unused)) = 0; return x; }41