source: CIVL/examples/languageFeatures/compoundInit1.c

main
Last change on this file was 8ed8eba, checked in by Stephen Siegel <siegel@…>, 3 years ago

Adding new compound initializer tests. Looking into a failing test concerning printing domains.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5730 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 269 bytes
Line 
1#include <assert.h>
2struct Node {
3 int id;
4 union {
5 int f1;
6 double f2;
7 };
8 union {
9 int f3;
10 float f4;
11 };
12};
13int main() {
14 struct Node node = { .id=333, .f1=444, .f2=3.14 };
15 assert(node.id==333);
16 assert(node.f2==3.14);
17 assert(node.f3==0);
18}
Note: See TracBrowser for help on using the repository browser.