llvm-capstone/clang/test/SemaObjC/attr-objc-non-lazy.m
Aaron Ballman 22db4824b9 Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the third batch of tests being updated (there are a significant
number of other tests left to be updated).
2022-02-07 09:25:01 -05:00

40 lines
955 B
Objective-C

// RUN: %clang_cc1 -verify -Wno-objc-root-class -fsyntax-only %s
__attribute__((objc_nonlazy_class))
@interface A
@end
@implementation A
@end
__attribute__((objc_nonlazy_class)) int X; // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}}
__attribute__((objc_nonlazy_class()))
@interface B
@end
@implementation B
@end
__attribute__((objc_nonlazy_class("foo"))) // expected-error{{'objc_nonlazy_class' attribute takes no arguments}}
@interface C
@end
@implementation C
@end
__attribute__((objc_nonlazy_class)) // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}}
@protocol B
@end
__attribute__((objc_nonlazy_class)) // expected-error {{'objc_nonlazy_class' attribute only applies to Objective-C interfaces}}
void foo(void);
@interface E
@end
__attribute__((objc_nonlazy_class))
@implementation E
@end
__attribute__((objc_nonlazy_class))
@implementation E (MyCat)
@end