mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
extend test 03_struct for attr. __cleanup__
This commit is contained in:
parent
89b3cf0b87
commit
a9e7fe19c7
@ -1,6 +1,13 @@
|
||||
#include <stdio.h>
|
||||
extern int printf(const char*, ...);
|
||||
|
||||
struct fred
|
||||
struct fred;
|
||||
|
||||
void fred$(struct fred* this)
|
||||
{
|
||||
printf("~fred()\n");
|
||||
}
|
||||
|
||||
struct __attribute__((__cleanup__(fred$))) fred
|
||||
{
|
||||
int boris;
|
||||
int natasha;
|
||||
@ -8,7 +15,7 @@ struct fred
|
||||
|
||||
int main()
|
||||
{
|
||||
struct fred bloggs;
|
||||
struct fred __attribute__((__cleanup__(fred$))) bloggs;
|
||||
|
||||
bloggs.boris = 12;
|
||||
bloggs.natasha = 34;
|
||||
|
@ -1,6 +1,8 @@
|
||||
03_struct.c:14: warning: attribute '__cleanup__' ignored on type
|
||||
12
|
||||
34
|
||||
12
|
||||
34
|
||||
56
|
||||
78
|
||||
~fred()
|
||||
|
Loading…
Reference in New Issue
Block a user