test: 修复llvm升级导致tdd用例部分失败问题
方案描述: 1、llvm升级之后对while(1)死循环和给空指针赋值的场景有错误优化的情况; 用例中在相关函数之前添加__attribute__((optnone))禁止编译器进行错误优化。 Close:#I6V2LN Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com> Change-Id: Ic7150909c12a599aeeb0a55b983dfad7a0631cdc
This commit is contained in:
@@ -32,19 +32,19 @@
|
||||
|
||||
static const int TEST_COUNT = 10;
|
||||
|
||||
static void *ThreadFunc2(void *arg)
|
||||
__attribute__((optnone)) static void *ThreadFunc2(void *arg)
|
||||
{
|
||||
printf("111111111111111: exit\n");
|
||||
exit(254); // 254, exit args
|
||||
}
|
||||
|
||||
static void *ThreadFunc3(void *arg)
|
||||
__attribute__((optnone)) static void *ThreadFunc3(void *arg)
|
||||
{
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
||||
static int ProcessTest001(void)
|
||||
__attribute__((optnone)) static int ProcessTest001(void)
|
||||
{
|
||||
int ret;
|
||||
int status;
|
||||
@@ -81,7 +81,7 @@ static int ProcessTest001(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int Testcase(void)
|
||||
__attribute__((optnone)) static int Testcase(void)
|
||||
{
|
||||
int ret;
|
||||
int status;
|
||||
|
||||
Reference in New Issue
Block a user