summaryrefslogtreecommitdiffstats
path: root/llvm/test/TableGen/listconcat.td
blob: 26dce17e92d84dea1a3acbff86768f8e43902e6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// RUN: llvm-tblgen %s | FileCheck %s

// 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: }

// 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: }

// CHECK: def DX {
// CHECK:   list<int> x = [0, 1, 1, 2]
// CHECK: }

// CHECK: def Z {
// CHECK:   list<string> T1 = ["fu", "foo"];
// CHECK:   list<string> T2 = ["fu", "foo", "fu", "bar", "baz"];
// CHECK: }

class X<list<int> a, list<int> b, list<int> c> {
    list<int> x = !listconcat(!listconcat(a, b), !listconcat(b, c));
}

class Y<list<string> S> {
  list<string> T1 = !listconcat(S, ["foo"]);
  list<string> T2 = !listconcat(S, ["foo"], S, ["bar", "baz"]);
}

def DX : X<[0], [1], [2]>;

def Z : Y<["fu"]>;
OpenPOWER on IntegriCloud