gnu.cfg: Add configuration and test for __builtin_assume_aligned()
This commit is contained in:
parent
637510393a
commit
77c711d129
17
cfg/gnu.cfg
17
cfg/gnu.cfg
|
@ -59,6 +59,23 @@
|
||||||
<valid>0:</valid>
|
<valid>0:</valid>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- void * __builtin_assume_aligned (const void *exp, size_t align, ...) -->
|
||||||
|
<!-- This function can have either two or three arguments, if it has three, the third argument should have integer type. -->
|
||||||
|
<function name="__builtin_assume_aligned">
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<returnValue type="void *">arg1</returnValue>
|
||||||
|
<use-retval/>
|
||||||
|
<leak-ignore/>
|
||||||
|
<arg nr="1" direction="in"/>
|
||||||
|
<arg nr="2" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-bool/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="3" direction="in" default="0">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-bool/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- void * __builtin_memcpy(void *dest, const void *source, size_t size);-->
|
<!-- void * __builtin_memcpy(void *dest, const void *source, size_t size);-->
|
||||||
<!-- memcpy() is sometimes defined as __builtin_memcpy() so the define above does not work -->
|
<!-- memcpy() is sometimes defined as __builtin_memcpy() so the define above does not work -->
|
||||||
<function name="__builtin_memcpy">
|
<function name="__builtin_memcpy">
|
||||||
|
|
|
@ -108,12 +108,16 @@ int no_resourceLeak_mkostemp_02(char *template, int flags)
|
||||||
return mkostemp(template, flags);
|
return mkostemp(template, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void valid_code(int argInt1, va_list valist_arg)
|
void valid_code(int argInt1, va_list valist_arg, int * parg)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (__builtin_expect(argInt1, 0)) {}
|
if (__builtin_expect(argInt1, 0)) {}
|
||||||
if (__builtin_expect_with_probability(argInt1 + 1, 2, 0.5)) {}
|
if (__builtin_expect_with_probability(argInt1 + 1, 2, 0.5)) {}
|
||||||
|
void *ax1 = __builtin_assume_aligned(parg, 16);
|
||||||
|
printf("%p", ax1);
|
||||||
|
void *ax2 = __builtin_assume_aligned(parg, 32, 8);
|
||||||
|
printf("%p", ax2);
|
||||||
|
|
||||||
p = (char *)malloc(10);
|
p = (char *)malloc(10);
|
||||||
free(p);
|
free(p);
|
||||||
|
|
Loading…
Reference in New Issue