20020224-1.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 42 行

C
42
字号
/* PR target/5755   This testcase failed because the caller of a function returning struct   expected the callee to pop up the hidden return structure pointer,   while callee was actually not poping it up (as the hidden argument   was passed in register).  *//* { dg-do run { target i?86-*-* } } *//* { dg-options "-O2 -fomit-frame-pointer" } */extern void abort (void);extern void exit (int);typedef struct {   int a1, a2;} A;A a;A __attribute__ ((regparm (2)))foo (int x){  return a;}int __attribute__ ((regparm (2)))bar (int x){  int r = foo(0).a2;  return r;}intmain (){  int f;  a.a1 = 530;  a.a2 = 980;  f = bar (0);  if (f != 980)    abort ();  exit (0);}

⌨️ 快捷键说明

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