aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/nds32/builtin-mfsr-mtsr.c
blob: db4c55845c05b6cc1a37f9a32f640e99b1cc2ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Verify that we generate mfsr/mtsr instruction with builtin function.  */

/* { dg-do compile }  */
/* { dg-options "-O0" }  */
/* { dg-final { scan-assembler "\\tmfsr" } }  */
/* { dg-final { scan-assembler "\\tmtsr" } }  */

#include <nds32_intrinsic.h>

void
test (void)
{
  int ipsw_value;

  ipsw_value = __builtin_nds32_mfsr (__NDS32_REG_IPSW__);
  __builtin_nds32_mtsr (ipsw_value, __NDS32_REG_IPSW__);
}