From 1bab2ccceec11e6af9958ec9f3b8a89ff8615f29 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 12 Apr 2016 15:57:55 -0400
Subject: [PATCH 68/91] FIMXE: add test of switch (with jump_table_data)

---
 .../rtl.dg/roundtrip/test-switch-after-expand.rtl  | 202 +++++++++++++++++++++
 1 file changed, 202 insertions(+)
 create mode 100644 gcc/testsuite/rtl.dg/roundtrip/test-switch-after-expand.rtl

diff --git a/gcc/testsuite/rtl.dg/roundtrip/test-switch-after-expand.rtl b/gcc/testsuite/rtl.dg/roundtrip/test-switch-after-expand.rtl
new file mode 100644
index 0000000..497e671
--- /dev/null
+++ b/gcc/testsuite/rtl.dg/roundtrip/test-switch-after-expand.rtl
@@ -0,0 +1,202 @@
+(note 1 0 7 (nil) NOTE_INSN_DELETED)
+(note 7 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
+(insn 2 7 3 2 (set (reg/v:SI 88 [ i ])
+        (reg:SI 5 di [ i ])) ../../src/test-switch.c:2 -1
+     (nil))
+(insn 3 2 4 2 (set (reg/v:SI 89 [ j ])
+        (reg:SI 4 si [ j ])) ../../src/test-switch.c:2 -1
+     (nil))
+(insn 4 3 5 2 (set (reg/v:SI 90 [ k ])
+        (reg:SI 1 dx [ k ])) ../../src/test-switch.c:2 -1
+     (nil))
+(note 5 4 9 2 NOTE_INSN_FUNCTION_BEG)
+(insn 9 5 10 2 (parallel [
+            (set (reg:SI 91)
+                (plus:SI (reg/v:SI 88 [ i ])
+                    (const_int 1 [0x1])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:3 -1
+     (nil))
+(insn 10 9 11 2 (set (reg:CC 17 flags)
+        (compare:CC (reg:SI 91)
+            (const_int 25 [0x19]))) ../../src/test-switch.c:3 -1
+     (nil))
+(jump_insn 11 10 67 2 (set (pc)
+        (if_then_else (gtu (reg:CC 17 flags)
+                (const_int 0 [0]))
+            (label_ref 52)
+            (pc))) ../../src/test-switch.c:3 -1
+     (int_list:REG_BR_PROB 625 (nil))
+ -> 52)
+(note 67 11 12 4 [bb 4] NOTE_INSN_BASIC_BLOCK)
+(insn 12 67 13 4 (set (reg:DI 92)
+        (zero_extend:DI (reg:SI 91))) ../../src/test-switch.c:3 -1
+     (nil))
+(insn 13 12 14 4 (set (reg/f:DI 93)
+        (label_ref:DI 17)) ../../src/test-switch.c:3 -1
+     (insn_list:REG_LABEL_OPERAND 17 (nil)))
+(insn 14 13 15 4 (set (reg:DI 94)
+        (mem/u/c:DI (plus:DI (ashift:DI (reg:DI 92)
+                    (const_int 3 [0x3]))
+                (reg/f:DI 93)) [0  S8 A8])) ../../src/test-switch.c:3 -1
+     (nil))
+(jump_insn 15 14 16 4 (parallel [
+            (set (pc)
+                (reg:DI 94))
+            (use (label_ref 17))
+        ]) ../../src/test-switch.c:3 -1
+     (nil)
+ -> 17)
+(barrier 16 15 17)
+(code_label 17 16 18 (nil) 4 (nil) [2 uses])
+(jump_table_data 18 17 19 (nil) (addr_vec:DI [
+            (label_ref:DI 66)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 20)
+            (label_ref:DI 35)
+            (label_ref:DI 40)
+            (label_ref:DI 46)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 52)
+            (label_ref:DI 25)
+            (label_ref:DI 30)
+        ]))
+(barrier 19 18 20)
+(code_label 20 19 21 5 5 (nil) [10 uses])
+(note 21 20 22 5 [bb 5] NOTE_INSN_BASIC_BLOCK)
+(insn 22 21 23 5 (parallel [
+            (set (reg:SI 87 [ <retval> ])
+                (ashift:SI (reg/v:SI 88 [ i ])
+                    (const_int 1 [0x1])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:8 -1
+     (nil))
+(jump_insn 23 22 24 5 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:8 -1
+     (nil)
+ -> 59)
+(barrier 24 23 25)
+(code_label 25 24 26 6 9 (nil) [1 uses])
+(note 26 25 27 6 [bb 6] NOTE_INSN_BASIC_BLOCK)
+(insn 27 26 28 6 (parallel [
+            (set (reg:SI 87 [ <retval> ])
+                (plus:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:10 -1
+     (nil))
+(jump_insn 28 27 29 6 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:10 -1
+     (nil)
+ -> 59)
+(barrier 29 28 30)
+(code_label 30 29 31 7 10 (nil) [1 uses])
+(note 31 30 32 7 [bb 7] NOTE_INSN_BASIC_BLOCK)
+(insn 32 31 33 7 (parallel [
+            (set (reg:SI 87 [ <retval> ])
+                (minus:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:12 -1
+     (nil))
+(jump_insn 33 32 34 7 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:12 -1
+     (nil)
+ -> 59)
+(barrier 34 33 35)
+(code_label 35 34 36 8 6 (nil) [1 uses])
+(note 36 35 37 8 [bb 8] NOTE_INSN_BASIC_BLOCK)
+(insn 37 36 38 8 (parallel [
+            (set (reg:SI 87 [ <retval> ])
+                (mult:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:14 -1
+     (nil))
+(jump_insn 38 37 39 8 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:14 -1
+     (nil)
+ -> 59)
+(barrier 39 38 40)
+(code_label 40 39 41 9 7 (nil) [1 uses])
+(note 41 40 42 9 [bb 9] NOTE_INSN_BASIC_BLOCK)
+(insn 42 41 43 9 (parallel [
+            (set (reg:SI 95)
+                (div:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (set (reg:SI 96)
+                (mod:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:16 -1
+     (nil))
+(insn 43 42 44 9 (set (reg:SI 87 [ <retval> ])
+        (reg:SI 95)) ../../src/test-switch.c:16 -1
+     (nil))
+(jump_insn 44 43 45 9 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:16 -1
+     (nil)
+ -> 59)
+(barrier 45 44 46)
+(code_label 46 45 47 10 8 (nil) [1 uses])
+(note 47 46 48 10 [bb 10] NOTE_INSN_BASIC_BLOCK)
+(insn 48 47 49 10 (parallel [
+            (set (reg:SI 98)
+                (div:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (set (reg:SI 97)
+                (mod:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:18 -1
+     (nil))
+(insn 49 48 50 10 (set (reg:SI 87 [ <retval> ])
+        (reg:SI 97)) ../../src/test-switch.c:18 -1
+     (nil))
+(jump_insn 50 49 51 10 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:18 -1
+     (nil)
+ -> 59)
+(barrier 51 50 52)
+(code_label 52 51 53 11 2 (nil) [11 uses])
+(note 53 52 54 11 [bb 11] NOTE_INSN_BASIC_BLOCK)
+(insn 54 53 63 11 (parallel [
+            (set (reg:SI 87 [ <retval> ])
+                (plus:SI (reg/v:SI 89 [ j ])
+                    (reg/v:SI 90 [ k ])))
+            (clobber (reg:CC 17 flags))
+        ]) ../../src/test-switch.c:20 -1
+     (nil))
+(jump_insn 63 54 64 11 (set (pc)
+        (label_ref:DI 59)) ../../src/test-switch.c:20 -1
+     (nil)
+ -> 59)
+(barrier 64 63 66)
+(code_label 66 64 65 12 11 (nil) [1 uses])
+(note 65 66 6 12 [bb 12] NOTE_INSN_BASIC_BLOCK)
+(insn 6 65 59 12 (set (reg:SI 87 [ <retval> ])
+        (const_int 34 [0x22])) ../../src/test-switch.c:6 -1
+     (nil))
+(code_label 59 6 62 14 1 (nil) [7 uses])
+(note 62 59 60 14 [bb 14] NOTE_INSN_BASIC_BLOCK)
+(insn 60 62 61 14 (set (reg/i:SI 0 ax)
+        (reg:SI 87 [ <retval> ])) ../../src/test-switch.c:22 -1
+     (nil))
+(insn 61 60 0 14 (use (reg/i:SI 0 ax)) ../../src/test-switch.c:22 -1
+     (nil))
-- 
1.8.5.3

