blob: 45139a3c8c3ea667791c92885c4f278892065f0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
static int ok_int(int *ptr, int val)
{
return __sync_add_and_fetch(ptr, val);
}
static long* ok_ptr(long **ptr, long *val)
{
return __sync_add_and_fetch(ptr, val);
}
static void chk_ret_ok(long *ptr, long val)
{
_Static_assert([typeof(__sync_add_and_fetch(ptr, val))] == [long], "");
}
static int chk_val(int *ptr, long val)
{
// OK: val is converted to an int
return __sync_add_and_fetch(ptr, val);
}
/*
* check-name: builtin-sync-fetch
*/
|