diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/asm-function-3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/asm-function-3.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/asm-function-3.C b/gcc/testsuite/g++.dg/asm-function-3.C new file mode 100644 index 00000000000..8a05a300004 --- /dev/null +++ b/gcc/testsuite/g++.dg/asm-function-3.C @@ -0,0 +1,26 @@ +/* APPLE LOCAL file CW asm blocks */ +/* More tests of asm functions. */ + +/* { dg-do run { target powerpc*-*-darwin* } } */ +/* { dg-options "-fasm-blocks -O2" } */ + +extern "C" void abort(void); + +/* Return 0 if xer and spr1 both have the same data. */ + +asm int +test_spr () +{ + mfspr r5,xer + mfspr r4,spr1 + sub r3,r4,r5 +} + +int +main () +{ + if (test_spr ()) + abort (); + return 0; +} + |