1
// RUN: tblgen %s | grep {Smith} | count 7
2
// RUN: tblgen %s | grep {Johnson} | count 2
3
// RUN: tblgen %s | grep {FIRST} | count 1
4
// RUN: tblgen %s | grep {LAST} | count 1
5
// RUN: tblgen %s | grep {TVAR} | count 2
6
// RUN: tblgen %s | grep {Bogus} | count 1
8
class Honorific<string t> {
12
def Mr : Honorific<"Mr.">;
13
def Ms : Honorific<"Ms.">;
14
def Mrs : Honorific<"Mrs.">;
15
def TVAR : Honorific<"Bogus">;
17
class Name<string n, Honorific t> {
19
Honorific honorific = t;
22
class AName<string name, Honorific honorific> :
23
Name<!subst("FIRST", "John", !subst("LAST", "Smith", name)),
24
!subst(TVAR, Mr, honorific)>;
26
def JohnSmith : AName<"FIRST LAST", TVAR>;
27
def JaneSmith : AName<"Jane LAST", Ms>;
28
def JohnSmithJones : AName<"FIRST LAST-Jones", Mr>;
29
def JimmyJohnson : AName<"Jimmy Johnson", Mr>;