Daniel Dunbar | dd0cb22 | 2010-09-29 18:20:25 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only |
| 2 | |
John McCall | d6b8de0 | 2011-01-25 03:51:08 +0000 | [diff] [blame] | 3 | int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}} |
Daniel Dunbar | dd0cb22 | 2010-09-29 18:20:25 +0000 | [diff] [blame] | 4 | |
Douglas Gregor | 15be9b0 | 2011-07-11 15:24:01 +0000 | [diff] [blame] | 5 | __attribute__((naked)) int t0(void) { |
| 6 | __asm__ volatile("mov r0, #0"); |
| 7 | } |
| 8 | |
Daniel Dunbar | dd0cb22 | 2010-09-29 18:20:25 +0000 | [diff] [blame] | 9 | void t1() __attribute__((naked)); |
| 10 | |
John McCall | bdc49d3 | 2011-03-02 12:15:05 +0000 | [diff] [blame] | 11 | void t2() __attribute__((naked(2))); // expected-error {{attribute takes no arguments}} |
Daniel Dunbar | dd0cb22 | 2010-09-29 18:20:25 +0000 | [diff] [blame] | 12 | |