| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target arm32 } */ |
| 3 |
/* { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } */ |
| 4 |
|
| 5 |
/* Test to catch off-by-one errors in arm/pr-support.c. */ |
| 6 |
|
| 7 |
#if defined (__VFP_FP__) && !defined (__SOFTFP__) |
| 8 |
|
| 9 |
#include <iostream> |
| 10 |
#include <stdlib.h> |
| 11 |
|
| 12 |
using namespace std; |
| 13 |
|
| 14 |
static void donkey () |
| 15 |
{ |
| 16 |
#if __ARM_FP & 8 |
| 17 |
asm volatile ("vmov.f64 d9, %P0" : : "w" (1.2345) : "d9"); |
| 18 |
#else |
| 19 |
asm volatile ("vmov.f32 s18, %0" : : "t" (1.2345f) : "s18"); |
| 20 |
#endif |
| 21 |
throw 1; |
| 22 |
} |
| 23 |
|
| 24 |
int main() |
| 25 |
{ |
| 26 |
try |
| 27 |
{ |
| 28 |
donkey (); |
| 29 |
} |
| 30 |
catch (int foo) |
| 31 |
{ |
| 32 |
return 0; |
| 33 |
} |
| 34 |
return 1; |
| 35 |
} |
| 36 |
|
| 37 |
#else |
| 38 |
|
| 39 |
int main() |
| 40 |
{ |
| 41 |
return 0; |
| 42 |
} |
| 43 |
|
| 44 |
#endif |
| 45 |
|