mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
a22657f457
In historical reason, tblgen is not strictly required to be free from memory leaks. For now, I mark them as XFAIL, they could be fixed, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194353 91177308-0d34-0410-b5e6-96231b3b80d8
79 lines
2.5 KiB
TableGen
79 lines
2.5 KiB
TableGen
// RUN: llvm-tblgen %s | FileCheck %s
|
|
// XFAIL: vg_leak
|
|
|
|
class Honorific<string t> {
|
|
string honorific = t;
|
|
}
|
|
|
|
def Mr : Honorific<"Mr.">;
|
|
def Ms : Honorific<"Ms.">;
|
|
def Mrs : Honorific<"Mrs.">;
|
|
def TVAR : Honorific<"Bogus">;
|
|
|
|
class Name<string n, Honorific t> {
|
|
string name = n;
|
|
Honorific honorific = t;
|
|
}
|
|
|
|
class AName<string name, Honorific honorific> :
|
|
Name<!subst("FIRST", "John", !subst("LAST", "Smith", name)),
|
|
!subst(TVAR, Mr, honorific)>;
|
|
|
|
def JohnSmith : AName<"FIRST LAST", TVAR>;
|
|
def JaneSmith : AName<"Jane LAST", Ms>;
|
|
def JohnSmithJones : AName<"FIRST LAST-Jones", Mr>;
|
|
def JimmyJohnson : AName<"Jimmy Johnson", Mr>;
|
|
|
|
// CHECK: ------------- Classes -----------------
|
|
// CHECK-NEXT: class AName<string AName:name = ?, Honorific AName:honorific = ?> {
|
|
// CHECK-NEXT: string name = !subst("FIRST", "John", !subst("LAST", "Smith", AName:name));
|
|
// CHECK-NEXT: Honorific honorific = !subst(TVAR, Mr, AName:honorific);
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: class Honorific<string Honorific:t = ?> {
|
|
// CHECK-NEXT: string honorific = Honorific:t;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: class Name<string Name:n = ?, Honorific Name:t = ?> {
|
|
// CHECK-NEXT: string name = Name:n;
|
|
// CHECK-NEXT: Honorific honorific = Name:t;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ------------- Defs -----------------
|
|
// CHECK-NEXT: def JaneSmith {
|
|
// CHECK-NEXT: string name = "Jane Smith";
|
|
// CHECK-NEXT: Honorific honorific = Ms;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def JimmyJohnson {
|
|
// CHECK-NEXT: string name = "Jimmy Johnson";
|
|
// CHECK-NEXT: Honorific honorific = Mr;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def JohnSmith {
|
|
// CHECK-NEXT: string name = "John Smith";
|
|
// CHECK-NEXT: Honorific honorific = Mr;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def JohnSmithJones {
|
|
// CHECK-NEXT: string name = "John Smith-Jones";
|
|
// CHECK-NEXT: Honorific honorific = Mr;
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def Mr
|
|
// CHECK-NEXT: string honorific = "Mr.";
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def Mrs {
|
|
// CHECK-NEXT: string honorific = "Mrs.";
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def Ms {
|
|
// CHECK-NEXT: string honorific = "Ms.";
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: def TVAR {
|
|
// CHECK-NEXT: string honorific = "Bogus";
|
|
// CHECK-NEXT: string NAME = ?;
|
|
// CHECK-NEXT: }
|