bug-971834.c

来自「sdcc是为51等小型嵌入式cpu设计的c语言编译器支持数种不同类型的cpu」· C语言 代码 · 共 48 行

C
48
字号
/* bug-971834.c   Life Range problem with   - uninitialized variable   - loop   LR problem hits all ports, but this test is mcs51 specific */#include <testfwk.h>unsigned char ttt[] = {0xff, 1};unsigned char b;#if !defined(PORT_HOST)#  pragma disable_warning 84#endifunsigned char orsh (void){  unsigned char a, i;  for (i = 0; i < sizeof(ttt); i++)    a |= ttt[i];  return a;}unsigned char orsh1 (void){  unsigned char i, j;  unsigned char a;  for (j = 0; j < sizeof(ttt); j++)    {      for (i = 0; i < sizeof(ttt); i++)        {          a |= ttt[i];          b = a;        }    }  return b;}voidtestLR(void){  ASSERT(orsh()  == 0xff);  ASSERT(orsh1() == 0xff);}

⌨️ 快捷键说明

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