Tim Northover | a484bc0 | 2013-10-01 14:34:25 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple arm-apple-darwin -verify -fsyntax-only |
Oliver Stannard | 97a3c35 | 2016-09-15 08:55:41 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 %s -triple thumb-apple-darwin -verify -fsyntax-only |
| 3 | // RUN: %clang_cc1 %s -triple armeb-none-eabi -verify -fsyntax-only |
| 4 | // RUN: %clang_cc1 %s -triple thumbeb-none-eabi -verify -fsyntax-only |
Tim Northover | a484bc0 | 2013-10-01 14:34:25 +0000 | [diff] [blame] | 5 | |
Aaron Ballman | 05e420a | 2014-01-02 21:26:14 +0000 | [diff] [blame] | 6 | __attribute__((interrupt(IRQ))) void foo() {} // expected-error {{'interrupt' attribute requires a string}} |
Tim Northover | a484bc0 | 2013-10-01 14:34:25 +0000 | [diff] [blame] | 7 | __attribute__((interrupt("irq"))) void foo1() {} // expected-warning {{'interrupt' attribute argument not supported: irq}} |
| 8 | |
Aaron Ballman | 05e420a | 2014-01-02 21:26:14 +0000 | [diff] [blame] | 9 | __attribute__((interrupt("IRQ", 1))) void foo2() {} // expected-error {{'interrupt' attribute takes no more than 1 argument}} |
Tim Northover | a484bc0 | 2013-10-01 14:34:25 +0000 | [diff] [blame] | 10 | |
| 11 | __attribute__((interrupt("IRQ"))) void foo3() {} |
| 12 | __attribute__((interrupt("FIQ"))) void foo4() {} |
| 13 | __attribute__((interrupt("SWI"))) void foo5() {} |
| 14 | __attribute__((interrupt("ABORT"))) void foo6() {} |
| 15 | __attribute__((interrupt("UNDEF"))) void foo7() {} |
| 16 | |
| 17 | __attribute__((interrupt)) void foo8() {} |
| 18 | __attribute__((interrupt())) void foo9() {} |
| 19 | __attribute__((interrupt(""))) void foo10() {} |
Jonathan Roelofs | 8277c41 | 2017-01-18 15:31:11 +0000 | [diff] [blame] | 20 | |
| 21 | void callee1(); |
| 22 | __attribute__((interrupt("IRQ"))) void callee2(); |
| 23 | void caller1() { |
| 24 | callee1(); |
| 25 | callee2(); |
| 26 | } |
| 27 | __attribute__((interrupt("IRQ"))) void caller2() { |
| 28 | callee1(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}} |
| 29 | callee2(); |
| 30 | } |