llvm-project/clang/test/Sema/attr-nodebug.c
Paul Robinson e801f6a7f4 Add a Subjects line to NoDebugAttr [NFC].
The 'nodebug' attribute had hand-coded constraints; replace those with
a Subjects line in Attr.td.
Also add a missing test to verify the attribute is okay on an
Objective-C method.

Differential Revision: http://reviews.llvm.org/D19689

llvm-svn: 268065
2016-04-29 17:03:34 +00:00

12 lines
354 B
C

// RUN: %clang_cc1 %s -verify -fsyntax-only
int a __attribute__((nodebug));
void b() {
int b __attribute__((nodebug)); // expected-warning {{'nodebug' attribute only applies to functions and global variables}}
}
void t1() __attribute__((nodebug));
void t2() __attribute__((nodebug(2))); // expected-error {{'nodebug' attribute takes no arguments}}