Skip to content

Commit 2aad7d0

Browse files
author
Victoria Nguyen
committed
removed include flag and enumerated bool
1 parent 48b2c2a commit 2aad7d0

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

clang/test/Analysis/SD-tests/thread-modeling-2.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
// RUN: %clang_analyze_cc1 -Wno-strict-prototypes -Wno-error=implicit-int -verify %s \
2-
// RUN: -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include \
32
// RUN: -analyzer-checker=debug.ExprInspection
43

54
#define NULL ((void*) 0)
6-
#include <stdbool.h>
5+
enum bool {
6+
false,
7+
true
8+
};
9+
710

811
typedef unsigned long int pthread_t;
912
typedef struct __pthread_attr pthread_attr_t;
1013

11-
int pthread_create(pthread_t *restrict thread,
12-
13-
const pthread_attr_t *restrict attr,
14-
15-
void *(*start_routine)(void*), void *restrict arg);
16-
14+
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);
1715

1816

1917
int pthread_join(pthread_t thread, void **retval);
2018

21-
22-
23-
void clang_analyzer_checkInlined(bool);
19+
void clang_analyzer_checkInlined(enum bool);
2420

2521
void* thread_function(void* arg){
2622
// should expect to fail the test at this line if you set the checkInlined to true
27-
clang_analyzer_checkInlined(false); // no-warning
23+
clang_analyzer_checkInlined(true); // expected-warning{{TRUE}}
2824
return NULL;
2925
}
3026

0 commit comments

Comments
 (0)