diff --git a/llvm/test/TableGen/switch.td b/llvm/test/TableGen/switch.td index 5ad4a5f4ed831..1326cb8d9ec0c 100644 --- a/llvm/test/TableGen/switch.td +++ b/llvm/test/TableGen/switch.td @@ -58,6 +58,7 @@ def labeled_99 : Labeled<99>; // CHECK: string_key = "v1"; // CHECK: bits_val = { 1, 1 }; // CHECK: single_bit = 1; +// CHECK: list_val = [7, 8, 9]; def nonempty_caselist_default { string color = !switch(99, 1: "red", 2: "green", 3: "blue", "default"); int age = !switch(99, 1: 20, 2: 30, 3: 40, 10); @@ -65,6 +66,7 @@ def nonempty_caselist_default { string string_key = !switch("k99", "k1": "v2", "k2": "v3", "k3": "v4", "v1"); bits<2> bits_val = !switch(99, 1: {0, 1}, 2: {1, 0}, {1, 1}); bit single_bit = !switch(99, 1: !eq(0, 0), 2: !eq(0, 1), !eq(1, 1)); + list list_val = !switch(99, 1: [1, 2, 3], 2: [4, 5, 6], [7, 8, 9]); } // Non-empty case list, key matches a case key @@ -75,6 +77,7 @@ def nonempty_caselist_default { // CHECK: string_key = "v2"; // CHECK: bits_val = { 1, 0 }; // CHECK: single_bit = 0; +// CHECK: list_val = [4, 5, 6]; def nonempty_caselist_match_case { string color = !switch(1, 1: "red", 2: "green", 3: "blue", "default"); int age = !switch(2, 1: 20, 2: 30, 3: 40, 10); @@ -82,6 +85,7 @@ def nonempty_caselist_match_case { string string_key = !switch("k1", "k1": "v2", "k2": "v3", "k3": "v4", "v1"); bits<2> bits_val = !switch(2, 1: {0, 1}, 2: {1, 0}, {1, 1}); bit single_bit = !switch(2, 1: !eq(0, 0), 2: !eq(0, 1), !eq(1, 1)); + list list_val = !switch(2, 1: [1, 2, 3], 2: [4, 5, 6], [7, 8, 9]); } // Partially unset values