brintos

brintos / llvm-project-archived public Read only

0
0
Text · 930 B · 547f2c2 Raw
32 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s2 3typedef int kern_return_t;4#define KERN_SUCCESS 05 6@interface NSObject7@end8 9@interface I: NSObject10- (kern_return_t)foo __attribute__((mig_server_routine)); // no-warning11- (void) bar_void __attribute__((mig_server_routine)); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}12- (int) bar_int __attribute__((mig_server_routine)); // expected-warning{{'mig_server_routine' attribute only applies to routines that return a kern_return_t}}13@end14 15@implementation I16- (kern_return_t)foo {17  kern_return_t (^block)(void) = ^ __attribute__((mig_server_routine)) { // no-warning18    return KERN_SUCCESS;19  };20 21  // FIXME: Warn that this block doesn't return a kern_return_t.22  void (^invalid_block)(void) = ^ __attribute__((mig_server_routine)) {};23 24  return block();25}26- (void)bar_void {27}28- (int)bar_int {29  return 0;30}31@end32