1 // FIXME: pthread_create() definition in Builtins.td doesn't match the real one, so it doesn't get recognized as a builtin and attributes aren't added.
5 // RUN: %clang_cc1 %s -emit-llvm -o - -disable-llvm-optzns | FileCheck %s
7 // CHECK: declare !callback ![[cid:[0-9]+]] {{.*}}i32 @pthread_create
8 // CHECK: ![[cid]] = !{![[cidb:[0-9]+]]}
9 // CHECK: ![[cidb]] = !{i64 2, i64 3, i1 false}
11 // Taken from test/Analysis/retain-release.m
13 struct _opaque_pthread_t
{};
14 struct _opaque_pthread_attr_t
{};
15 typedef struct _opaque_pthread_t
*__darwin_pthread_t
;
16 typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t
;
17 typedef __darwin_pthread_t pthread_t
;
18 typedef __darwin_pthread_attr_t pthread_attr_t
;
20 int pthread_create(pthread_t
*, const pthread_attr_t
*,
21 void *(*)(void *), void *);
24 const int GlobalVar
= 0;
26 static void *callee0(void *payload
) {
30 static void *callee1(void *payload
) {
35 pthread_t MyFirstThread
;
36 pthread_create(&MyFirstThread
, 0, callee0
, 0);
38 pthread_t MySecondThread
;
39 pthread_create(&MySecondThread
, 0, callee1
, (void *)&GlobalVar
);