[cfe-commits] r172087 - in /cfe/trunk: test/TableGen/ test/TableGen/DiagnosticBase.inc test/TableGen/anonymous-groups.td test/TableGen/lit.local.cfg test/TableGen/tg-fixits.td utils/TableGen/ClangDiagnosticsEmitter.cpp
Dmitri Gribenko
gribozavr at gmail.com
Thu Jan 10 13:41:28 PST 2013
On Thu, Jan 10, 2013 at 8:50 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> --- cfe/trunk/test/TableGen/tg-fixits.td (added)
> +++ cfe/trunk/test/TableGen/tg-fixits.td Thu Jan 10 12:50:46 2013
> @@ -0,0 +1,41 @@
> +// RUN: clang-tblgen -gen-clang-diag-groups -I%S %s -o /dev/null 2>&1 | FileCheck --strict-whitespace %s
> +include "DiagnosticBase.inc"
> +
> +def NamedGroup : DiagGroup<"name">;
> +
> +def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;
> +// CHECK: tg-fixits.td:[[@LINE-1]]:41: error: group 'name' is referred to anonymously
> +// CHECK-NEXT: {{^def InNamedGroup : Warning<"">, InGroup<DiagGroup<"name">>;}}
> +// CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~~~~~~~~~}}
> +// CHECK-NEXT: {{^ InGroup<NamedGroup>}}
> +
> +def Wrapped : Warning<"">, InGroup<DiagGroup<
> + "name">>;
> +// CHECK: tg-fixits.td:[[@LINE-2]]:36: error: group 'name' is referred to anonymously
> +// CHECK-NEXT: {{^def Wrapped : Warning<"">, InGroup<DiagGroup<}}
> +// CHECK-NEXT: {{^ ~~~~~~~~\^~~~~~~~~~}}
> +// CHECK-NEXT: {{^ InGroup<NamedGroup>}}
> +
> +def AlsoWrapped : Warning<"">, InGroup<
> + DiagGroup<"name">>;
> +// CHECK: tg-fixits.td:[[@LINE-1]]:3: error: group 'name' is referred to anonymously
> +// CHECK-NEXT: {{^ DiagGroup<"name">>;}}
> +// CHECK-NEXT: {{^~~\^~~~~~~~~~~~~~~~~~}}
> +// CHECK-NEXT: {{^InGroup<NamedGroup>}}
> +
> +// The following lines contain hard tabs (\t); do not change this!
> +def HardTabs : Warning<"">,
> + InGroup< DiagGroup<"name"> >;
> +// CHECK: tg-fixits.td:[[@LINE-1]]:11: error: group 'name' is referred to anonymously
> +// CHECK-NEXT: {{^ InGroup< DiagGroup<"name"> >;}}
> +// CHECK-NEXT: {{^ ~~~~~~~~~~~~~~~~\^~~~~~~~~~~~~~~~~~~~~~~~~}}
> +// CHECK-NEXT: {{^ InGroup<NamedGrop>}}
> +
> +// The following line has Unicode characters in it; do not change them!
> +// FIXME: For now, we just give up on printing carets/ranges/fixits for
> +// lines with Unicode in them, because SMDiagnostic don't keep a byte<->column
> +// map around to line things up like Clang does.
> +def Unicode : Warning<"ユニコード">, InGroup<DiagGroup<"name">>;
> +// CHECK: tg-fixits.td:[[@LINE-1]]:51: error: group 'name' is referred to anonymously
> +// CHECK-NEXT: def Unicode : Warning<"{{[^"]+}}">, InGroup<DiagGroup<"name">>;
> +// CHECK-NEXT: note:
Hello Jordan,
The Unicode test fails:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/119
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the cfe-commits
mailing list