Weiming Zhao | 71ac240 | 2015-02-03 22:35:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only -triple arm-none-linux |
| 2 | class Foo { |
| 3 | void bar(); |
| 4 | static void bar2(); |
| 5 | unsigned v; |
| 6 | static unsigned s; |
| 7 | }; |
| 8 | |
| 9 | void __attribute__((naked)) Foo::bar() { // expected-note{{attribute is here}} |
| 10 | asm("mov r2, %0" : : "r"(v)); // expected-error{{'this' pointer references not allowed in naked functions}} |
| 11 | } |
| 12 | |
| 13 | void __attribute__((naked)) Foo::bar2() { |
| 14 | asm("mov r2, %0" : : "r"(s)); // static member reference is OK |
| 15 | } |