-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
184 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
#define FOO 982 | ||
|
||
#define PRINT_HELLO_WORLD() do { \ | ||
printf("Hello, "); \ | ||
printf("World!\n"); \ | ||
} while(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Test case 1: Simple struct definition | ||
struct Point { | ||
int x; | ||
int y; | ||
}; | ||
|
||
// Test case 2: Typedef struct without a tag | ||
typedef struct { | ||
float real; | ||
float imag; | ||
} Complex; | ||
|
||
// Test case 3: Typedef struct with a tag | ||
typedef struct Rectangle { | ||
int width; | ||
int height; | ||
} Rectangle; | ||
|
||
// Test case 4: Struct with a single member | ||
struct Circle { | ||
float radius; | ||
}; | ||
|
||
// Test case 5: Struct with a nested struct definition | ||
struct Line { | ||
// Nested struct definition inside a struct | ||
struct Point { | ||
int x; | ||
int y; | ||
} start, end; | ||
}; | ||
|
||
// Test case 6: Struct with an anonymous struct member | ||
struct Node { | ||
int value; | ||
struct { | ||
int left; | ||
int right; | ||
} children; | ||
}; | ||
|
||
// Test case 7: Struct representing a linked list node (self-referential) | ||
struct List { | ||
int data; | ||
struct List *next; | ||
}; | ||
|
||
// Test case 8: Struct with bit fields | ||
struct Flags { | ||
unsigned int flag1 : 1; | ||
unsigned int flag2 : 1; | ||
}; | ||
|
||
// Test case 9: Typedef struct with more complex members | ||
typedef struct Employee { | ||
char name[50]; | ||
int id; | ||
float salary; | ||
} Employee; | ||
|
||
// Test case 10: Struct for a binary tree node (self-referential pointers) | ||
struct TreeNode { | ||
int value; | ||
struct TreeNode *left; | ||
struct TreeNode *right; | ||
}; | ||
|
||
// Test case 11: Typedef struct with a different alias | ||
typedef struct Car { | ||
int wheels; | ||
float engine_power; | ||
} Vehicle; |