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
9 class Honorific<string t> {
13 def Mr : Honorific<"Mr.">;
14 def Ms : Honorific<"Ms.">;
15 def Mrs : Honorific<"Mrs.">;
16 def TVAR : Honorific<"Bogus">;
18 class Name<string n, Honorific t> {
20 Honorific honorific = t;
23 class AName<string name, Honorific honorific> :
24 Name<!subst("FIRST", "John", !subst("LAST", "Smith", name)),
25 !subst(TVAR, Mr, honorific)>;
27 def JohnSmith : AName<"FIRST LAST", TVAR>;
28 def JaneSmith : AName<"Jane LAST", Ms>;
29 def JohnSmithJones : AName<"FIRST LAST-Jones", Mr>;
30 def JimmyJohnson : AName<"Jimmy Johnson", Mr>;