pr14841.c

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

C
30
字号
/* PR tree-optimization/14841   Make sure that we can fold a possible nested reference into a   constant aggregate.  *//* { dg-do compile } *//* { dg-options "-O2 -fdump-tree-store_ccp-details" } */struct car {  int speed;  int tire_pressure[4];};static const struct car cars[] = {  { 75, { 10, 20, 30, 40 } },  { 35, { 12, 34, 56, 78 } },  { 40, { 19, 28, 37, 46 } }};extern void link_error (void);voidfoo (void){  if (cars[1].tire_pressure[2] != 56)    link_error ();}/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "store_ccp"} } *//* { dg-final { cleanup-tree-dump "store_ccp" } } */

⌨️ 快捷键说明

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