2014-05-07 10:13:19 +00:00
|
|
|
// RUN: llvm-tblgen %s | FileCheck %s
|
|
|
|
|
2018-02-22 15:26:28 +00:00
|
|
|
// CHECK: class X<list<int> X:a = ?, list<int> X:b = ?, list<int> X:c = ?> {
|
|
|
|
// CHECK: list<int> x = !listconcat(!listconcat(X:a, X:b), !listconcat(X:b, X:c));
|
|
|
|
// CHECK: }
|
|
|
|
|
2014-05-07 10:13:19 +00:00
|
|
|
// CHECK: class Y<list<string> Y:S = ?> {
|
|
|
|
// CHECK: list<string> T1 = !listconcat(Y:S, ["foo"]);
|
|
|
|
// CHECK: list<string> T2 = !listconcat(Y:S, !listconcat(["foo"], !listconcat(Y:S, ["bar", "baz"])));
|
|
|
|
// CHECK: }
|
|
|
|
|
2018-03-14 11:00:43 +00:00
|
|
|
// CHECK: def A0 {
|
|
|
|
// CHECK: list<int> lst = [4];
|
|
|
|
// CHECK: }
|
|
|
|
|
|
|
|
// CHECK: def A1 {
|
|
|
|
// CHECK: list<int> lst = [];
|
|
|
|
// CHECK: }
|
|
|
|
|
2018-02-22 15:26:28 +00:00
|
|
|
// CHECK: def DX {
|
|
|
|
// CHECK: list<int> x = [0, 1, 1, 2]
|
|
|
|
// CHECK: }
|
|
|
|
|
2014-05-07 10:13:19 +00:00
|
|
|
// CHECK: def Z {
|
|
|
|
// CHECK: list<string> T1 = ["fu", "foo"];
|
|
|
|
// CHECK: list<string> T2 = ["fu", "foo", "fu", "bar", "baz"];
|
|
|
|
// CHECK: }
|
|
|
|
|
2018-03-14 11:00:43 +00:00
|
|
|
class A<bit x> {
|
|
|
|
// The empty lists type-check without issues.
|
|
|
|
list<int> lst = !listconcat([], !if(x, [], [4]));
|
|
|
|
}
|
|
|
|
|
|
|
|
def A0 : A<0>;
|
|
|
|
def A1 : A<1>;
|
|
|
|
|
2018-02-22 15:26:28 +00:00
|
|
|
class X<list<int> a, list<int> b, list<int> c> {
|
|
|
|
list<int> x = !listconcat(!listconcat(a, b), !listconcat(b, c));
|
|
|
|
}
|
|
|
|
|
2014-05-07 10:13:19 +00:00
|
|
|
class Y<list<string> S> {
|
|
|
|
list<string> T1 = !listconcat(S, ["foo"]);
|
|
|
|
list<string> T2 = !listconcat(S, ["foo"], S, ["bar", "baz"]);
|
|
|
|
}
|
|
|
|
|
2018-02-22 15:26:28 +00:00
|
|
|
def DX : X<[0], [1], [2]>;
|
|
|
|
|
2014-05-07 10:13:19 +00:00
|
|
|
def Z : Y<["fu"]>;
|