|
1 | | -// RUN: %clang_cc1 %s -triple arm-apple-darwin -target-feature +vfp2 -verify -fsyntax-only |
2 | | -// RUN: %clang_cc1 %s -triple thumb-apple-darwin -target-feature +vfp3 -verify -fsyntax-only |
3 | | -// RUN: %clang_cc1 %s -triple armeb-none-eabi -target-feature +vfp4 -verify -fsyntax-only |
4 | | -// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -target-feature +neon -verify -fsyntax-only |
5 | | -// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -target-feature +neon -target-feature +soft-float -DSOFT -verify -fsyntax-only |
| 1 | +// RUN: %clang_cc1 %s -triple arm-none-eabi -verify -fsyntax-only |
| 2 | +// RUN: %clang_cc1 %s -triple arm-none-eabi -target-feature +vfp2 -verify -fsyntax-only |
6 | 3 |
|
7 | | -__attribute__((interrupt(IRQ))) void foo(void) {} // expected-error {{'interrupt' attribute requires a string}} |
8 | | -__attribute__((interrupt("irq"))) void foo1(void) {} // expected-warning {{'interrupt' attribute argument not supported: irq}} |
9 | 4 |
|
| 5 | +#ifdef __ARM_FP |
| 6 | +__attribute__((interrupt("IRQ"))) void float_irq(void); // expected-warning {{interrupt service routine with vfp enabled may clobber the interruptee's vfp state}} |
| 7 | +#else // !defined(__ARM_FP) |
| 8 | +__attribute__((interrupt("irq"))) void foo1(void) {} // expected-warning {{'interrupt' attribute argument not supported: irq}} |
| 9 | +__attribute__((interrupt(IRQ))) void foo(void) {} // expected-error {{'interrupt' attribute requires a string}} |
10 | 10 | __attribute__((interrupt("IRQ", 1))) void foo2(void) {} // expected-error {{'interrupt' attribute takes no more than 1 argument}} |
11 | | - |
12 | 11 | __attribute__((interrupt("IRQ"))) void foo3(void) {} |
13 | 12 | __attribute__((interrupt("FIQ"))) void foo4(void) {} |
14 | 13 | __attribute__((interrupt("SWI"))) void foo5(void) {} |
15 | 14 | __attribute__((interrupt("ABORT"))) void foo6(void) {} |
16 | 15 | __attribute__((interrupt("UNDEF"))) void foo7(void) {} |
17 | | - |
18 | 16 | __attribute__((interrupt)) void foo8(void) {} |
19 | 17 | __attribute__((interrupt())) void foo9(void) {} |
20 | 18 | __attribute__((interrupt(""))) void foo10(void) {} |
21 | 19 |
|
22 | | -#ifndef SOFT |
23 | | -// expected-note@+2 {{'callee1' declared here}} |
24 | | -#endif |
25 | | -void callee1(void); |
26 | | -__attribute__((interrupt("IRQ"))) void callee2(void); |
27 | | -void caller1(void) { |
28 | | - callee1(); |
29 | | - callee2(); |
30 | | -} |
31 | | - |
32 | | -#ifndef SOFT |
33 | | -__attribute__((interrupt("IRQ"))) void caller2(void) { |
34 | | - callee1(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}} |
35 | | - callee2(); |
36 | | -} |
37 | | - |
38 | | -void (*callee3)(void); |
39 | | -__attribute__((interrupt("IRQ"))) void caller3(void) { |
40 | | - callee3(); // expected-warning {{call to function without interrupt attribute could clobber interruptee's VFP registers}} |
41 | | -} |
42 | | -#else |
43 | | -__attribute__((interrupt("IRQ"))) void caller2(void) { |
44 | | - callee1(); |
45 | | - callee2(); |
46 | | -} |
| 20 | +__attribute__((interrupt("IRQ"))) void callee(void) {} |
47 | 21 |
|
48 | | -void (*callee3)(void); |
49 | | -__attribute__((interrupt("IRQ"))) void caller3(void) { |
50 | | - callee3(); |
| 22 | +void caller(void) |
| 23 | +{ |
| 24 | + callee(); // expected-error {{interrupt service routine cannot be called directly}} |
51 | 25 | } |
52 | | -#endif |
| 26 | +#endif // __ARM_FP |
0 commit comments