20020219-1.c

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

C
43
字号
/* PR c/4389   This testcase failed because host_integerp (x, 0) was returning   1 even for constants bigger than 2^31.  It fails under under hpux   without -mdisable-indexing because the pointer x - 1 is used as   the base address of an indexed load.  Because the struct A is not   actually allocated, x - 1 lies in the text segment and this causes   the wrong space register to be selected for the load.  *//* { dg-do run } *//* { dg-options "-O2" } *//* { dg-options "-O2 -mdisable-indexing" { target hppa*-*-hpux* } } *//* Disable the test entirely for 16-bit targets.  */#if __INT_MAX__ > 32767extern void abort (void);extern void exit (int);struct A {  int a[10000][10000];};int b[2] = { 213151, 0 };void foo (struct A *x, int y){  if (x->a[9999][9999] != x->a[y][y])    abort ();  if (x->a[9999][9999] != 213151)    abort ();}int main (void){  struct A *x;  asm ("" : "=r" (x) : "0" (&b[1]));  foo (x - 1, 9999);  exit (0);}#elseint main () { return 0; }#endif /* __INT_MAX__ */

⌨️ 快捷键说明

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