[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / arm-interrupt-attr.c
blob3537fba8521ad9735e854c71fefcb538dc32bea8
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
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}}
10 __attribute__((interrupt("IRQ", 1))) void foo2(void) {} // expected-error {{'interrupt' attribute takes no more than 1 argument}}
12 __attribute__((interrupt("IRQ"))) void foo3(void) {}
13 __attribute__((interrupt("FIQ"))) void foo4(void) {}
14 __attribute__((interrupt("SWI"))) void foo5(void) {}
15 __attribute__((interrupt("ABORT"))) void foo6(void) {}
16 __attribute__((interrupt("UNDEF"))) void foo7(void) {}
18 __attribute__((interrupt)) void foo8(void) {}
19 __attribute__((interrupt())) void foo9(void) {}
20 __attribute__((interrupt(""))) void foo10(void) {}
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();
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();
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}}
42 #else
43 __attribute__((interrupt("IRQ"))) void caller2(void) {
44 callee1();
45 callee2();
48 void (*callee3)(void);
49 __attribute__((interrupt("IRQ"))) void caller3(void) {
50 callee3();
52 #endif