1 /* PR target/94743 */
2 /* { dg-do compile } */
3 /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=hard" } } */
4 /* { dg-require-effective-target arm_vfp_ok } */
5 /* { dg-add-options arm_vfp } */
6 /* Make sure with use -mfloat-abi=hard. */
7 /* { dg-additional-options "-mfloat-abi=hard" } */
8
9 /* Check that we emit a warning when compiling an IRQ handler without
10 -mgeneral-regs-only. */
11 typedef struct {
12 double fpdata[32];
13 } dummy_t;
14
15 dummy_t global_d;
16 dummy_t global_d1;
17
18 /* This function may clobber VFP registers. */
19 __attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test(void)
20 { /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
21 global_d.fpdata[3] += global_d.fpdata[3] * global_d1.fpdata[3];
22 }
23
24 /* This function does not need to clobber VFP registers. */
25 /* Do we want to emit a (useless?) warning? */
26 __attribute__ ((interrupt("IRQ"))) void IRQ_HDLR_Test2(void)
27 { /* { dg-warning { FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only'} "" { target *-*-* } . } */
28 global_d.fpdata[3] = 1.0;
29 }