23 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3typedef int kern_return_t;4#define KERN_SUCCESS 05 6__attribute__((mig_server_routine)) kern_return_t var = KERN_SUCCESS; // expected-warning{{'mig_server_routine' attribute only applies to functions, Objective-C methods, and blocks}}7 8__attribute__((mig_server_routine)) void foo_void(void); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}9__attribute__((mig_server_routine)) int foo_int(void); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}10 11__attribute__((mig_server_routine)) kern_return_t bar_extern(void); // no-warning12__attribute__((mig_server_routine)) kern_return_t bar_forward(void); // no-warning13 14__attribute__((mig_server_routine)) kern_return_t bar_definition(void) { // no-warning15 return KERN_SUCCESS;16}17 18kern_return_t bar_forward(void) { // no-warning19 return KERN_SUCCESS;20}21 22__attribute__((mig_server_routine(123))) kern_return_t bar_with_argument(void); // expected-error{{'mig_server_routine' attribute takes no arguments}}23