f9506f9f06b1dc48ce6aae500b2b130860a02421
[libfirm] / ir / be / test / ns.c
1 #define MAX_OPERANDS 3
2
3 typedef unsigned short uint16_t;
4 typedef unsigned char uint8_t;
5
6 typedef struct ASMInstr {
7     uint16_t sym;
8     uint8_t op_type[MAX_OPERANDS]; /* see OP_xxx */
9 } ASMInstr;
10
11 const ASMInstr asm_instrs[] = {
12     { 1, { 2, 3 }},
13     /* last operation */
14     { 0, },
15 };
16
17 int main()
18 {
19   int i;
20
21   printf("sizeof(asm_instrs[]) = %d\n", sizeof(asm_instrs));
22
23
24   for (i = 0; i < sizeof(asm_instrs)/sizeof(asm_instrs[0]); ++i) {
25     printf("%d.: %d { %d %d %d }\n", i,
26         asm_instrs[i].sym,
27         asm_instrs[i].op_type[0],
28         asm_instrs[i].op_type[1],
29         asm_instrs[i].op_type[2]
30     );
31   }
32 }