From 36b56886974eae4f9c5ebc96befd3e7bfe5de338 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Wed, 23 Apr 2014 16:57:46 -0700 Subject: Update to LLVM 3.5a. Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617 --- test/TableGen/MultiClassDefName.td | 25 +++++++++++++++++++++++++ test/TableGen/ValidIdentifiers.td | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 test/TableGen/ValidIdentifiers.td (limited to 'test/TableGen') diff --git a/test/TableGen/MultiClassDefName.td b/test/TableGen/MultiClassDefName.td index d3c6de7..811d9266 100644 --- a/test/TableGen/MultiClassDefName.td +++ b/test/TableGen/MultiClassDefName.td @@ -14,3 +14,28 @@ multiclass Names { } defm Hello : Names<"hello", "world">; + +// Ensure that the same anonymous name is used as the prefix for all defs in an +// anonymous multiclass. + +class Outer { + C Inner = i; +} + +multiclass MC { + def hi : C; + def there : Outer(!strconcat(NAME, "hi"))>; +} + +defm : MC<"foo">; + +multiclass MC2 { + def there : Outer >; +} + +// Ensure that we've correctly captured the reference to name from the implicit +// anonymous C def in the template parameter list of Outer. +// CHECK-NOT: MC2::name + +defm : MC2<"bar">; + diff --git a/test/TableGen/ValidIdentifiers.td b/test/TableGen/ValidIdentifiers.td new file mode 100644 index 0000000..333ede0 --- /dev/null +++ b/test/TableGen/ValidIdentifiers.td @@ -0,0 +1,16 @@ +// RUN: llvm-tblgen -gen-ctags %s | FileCheck %s +// XFAIL: vg_leak + +// Ensure that generated names for anonymous records are valid identifiers via the ctags index. + +class foo { int THEVAL = X; } +// CHECK: {{^X }} + +def : foo<2>; +// CHECK: {{^anonymous_0 }} + +def X { + foo Y = foo<1>; +} +// CHECK: {{^anonymous_1 }} +// CHECK: {{^foo }} -- cgit v1.1