Skip to content
Snippets Groups Projects
Commit 3fdb62d1 authored by David Bühler's avatar David Bühler
Browse files

[kernel] New test for sizeof(void) and alignof(void).

parent d1ea59dd
No related branches found
No related tags found
No related merge requests found
[kernel] Parsing tests/syntax/sizeof_void.c (with preprocessing)
[kernel] tests/syntax/sizeof_void.c:9: User Error:
sizeof on void type only allowed for GCC/MSVC
[kernel] tests/syntax/sizeof_void.c:16: User Error:
sizeof() on void type only allowed for GCC/MSVC
[kernel] tests/syntax/sizeof_void.c:21: User Error:
alignof on void type only allowed for GCC/MSVC
[kernel] tests/syntax/sizeof_void.c:28: User Error:
alignof() on void type only allowed for GCC/MSVC
[kernel] User Error: stopping on file "tests/syntax/sizeof_void.c" that has errors. Add
'-kernel-msg-key pp' for preprocessing command.
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing tests/syntax/sizeof_void.c (with preprocessing)
/* Generated by Frama-C */
int f(void)
{
int __retres;
int x = (int)sizeof(void);
__retres = 0;
return __retres;
}
int g(void)
{
int __retres;
void *p;
int x = (int)sizeof(p);
int y = (int)sizeof(*p);
__retres = 0;
return __retres;
}
int h(void)
{
int __retres;
int x = (int)__alignof__(void);
__retres = 0;
return __retres;
}
int i(void)
{
int __retres;
void *p;
int x = (int)__alignof__(p);
int y = (int)__alignof__(*p);
__retres = 0;
return __retres;
}
/* run.config
EXIT: 1
STDOPT: +"-machdep x86_64"
EXIT: 0
STDOPT: +"-machdep gcc_x86_64"
*/
int f () {
int x = sizeof(void);
return 0;
}
int g () {
void *p;
int x = sizeof(p);
int y = sizeof(*p);
return 0;
}
int h () {
int x = __alignof__(void);
return 0;
}
int i () {
void *p;
int x = __alignof__(p);
int y = __alignof__(*p);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment