blob: 55c6b326ef156821187709e028badbe0ca8b2653 [file] [log] [blame]
Daniel Dunbar8caf6412010-09-29 18:20:25 +00001// RUN: %clang_cc1 %s -verify -fsyntax-only
2
John McCall4bb48362011-01-25 03:51:08 +00003int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}}
Daniel Dunbar8caf6412010-09-29 18:20:25 +00004
Aaron Ballmanb7243382013-07-23 19:30:11 +00005__attribute__((naked)) int t0(void) {
Douglas Gregor9824aec2011-07-11 15:24:01 +00006 __asm__ volatile("mov r0, #0");
7}
8
Daniel Dunbar8caf6412010-09-29 18:20:25 +00009void t1() __attribute__((naked));
10
Aaron Ballmanb7243382013-07-23 19:30:11 +000011void t2() __attribute__((naked(2))); // expected-error {{'naked' attribute takes no arguments}}
Daniel Dunbar8caf6412010-09-29 18:20:25 +000012