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