interrupt_thread-1.c

来自「用于进行gcc测试」· C语言 代码 · 共 44 行

C
44
字号
/* { dg-do compile } *//* { dg-options "-mcpu=fidoa -O2 -fomit-frame-pointer" } *//* Check that interrupt_thread attribute works.  */#ifdef __mfido__extern void foo (void) __attribute__ ((interrupt_thread));int a, b, c, d;void bar (void);voidfoo (void){  int w, x, y, z;  w = a;  x = b;  y = c;  z = d;  bar ();  a = w;  b = x;  c = y;  d = z;}#else/* If the current mutilib is, say, -mcpu=5485, the compiler gets   -mcpu=fidoa -mcpu=5485, where -mcpu=fidoa is overridden.  In that   case, we just print out "sleep" in the assembly file and pretend   that everything is all right.  */asm ("sleep");#endif/* "sleep" should be generated in place of "rts".  *//* { dg-final { scan-assembler-times "sleep" 1 } } *//* { dg-final { scan-assembler-times "rts" 0 } } *//* There should be no stack adjustment.  *//* { dg-final { scan-assembler-times "sp" 0 } } */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?