1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef int kern_return_t
;
4 typedef kern_return_t IOReturn
;
6 #define kIOReturnSuccess KERN_SUCCESS
10 virtual __attribute__((mig_server_routine
)) IOReturn
externalMethod();
11 virtual __attribute__((mig_server_routine
)) void anotherMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
12 virtual __attribute__((mig_server_routine
)) int yetAnotherMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
13 [[clang::mig_server_routine
]] virtual IOReturn
cppAnnotatedMethod();
14 [[clang::mig_server_routine("arg")]] virtual IOReturn
cppAnnotatedMethodWithInvalidArgs(); // expected-error{{'mig_server_routine' attribute takes no arguments}}
15 [[clang::mig_server_routine
]] virtual int cppInvalidAnnotatedMethod(); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}
18 IOReturn
MyServer::externalMethod() {
19 return kIOReturnSuccess
;