blob: cd67278d944e8bd8f3c88b4ecab76e91258d1a74 [file] [log] [blame]
Tim Northovera484bc02013-10-01 14:34:25 +00001// RUN: %clang_cc1 %s -triple arm-apple-darwin -verify -fsyntax-only
Oliver Stannard97a3c352016-09-15 08:55:41 +00002// 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 Northovera484bc02013-10-01 14:34:25 +00005
Aaron Ballman05e420a2014-01-02 21:26:14 +00006__attribute__((interrupt(IRQ))) void foo() {} // expected-error {{'interrupt' attribute requires a string}}
Tim Northovera484bc02013-10-01 14:34:25 +00007__attribute__((interrupt("irq"))) void foo1() {} // expected-warning {{'interrupt' attribute argument not supported: irq}}
8
Aaron Ballman05e420a2014-01-02 21:26:14 +00009__attribute__((interrupt("IRQ", 1))) void foo2() {} // expected-error {{'interrupt' attribute takes no more than 1 argument}}
Tim Northovera484bc02013-10-01 14:34:25 +000010
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 Roelofs8277c412017-01-18 15:31:11 +000020
21void callee1();
22__attribute__((interrupt("IRQ"))) void callee2();
23void 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}