From: Nico Weber Date: Sat, 6 Sep 2014 18:16:37 +0000 (+0000) Subject: Move x86-specific bits of warn-unused-local-typedef.cpp into their own file. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e40196b965f7f6135253fd6a67cd42c32ff5a882;p=clang Move x86-specific bits of warn-unused-local-typedef.cpp into their own file. That way, most of the test can run everywhere. Also give the new file an x86 triple in addition to a REQUIRES line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217314 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp b/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp new file mode 100644 index 0000000000..d7792c0e11 --- /dev/null +++ b/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp @@ -0,0 +1,16 @@ +// REQUIRES: x86-registered-target +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -std=c++11 -Wunused-local-typedef -verify -fasm-blocks %s +// expected-no-diagnostics +void use_in_asm() { + typedef struct { + int a; + int b; + } A; + __asm mov eax, [eax].A.b + + using Alias = struct { + int a; + int b; + }; + __asm mov eax, [eax].Alias.b +} diff --git a/test/SemaCXX/warn-unused-local-typedef.cpp b/test/SemaCXX/warn-unused-local-typedef.cpp index 8861a48d47..e443427672 100644 --- a/test/SemaCXX/warn-unused-local-typedef.cpp +++ b/test/SemaCXX/warn-unused-local-typedef.cpp @@ -1,5 +1,4 @@ -// REQUIRES: x86-registered-target -// RUN: %clang_cc1 -fsyntax-only -Wunused-local-typedef -verify -std=c++1y -fasm-blocks %s +// RUN: %clang_cc1 -fsyntax-only -Wunused-local-typedef -verify -std=c++1y %s struct S { typedef int Foo; // no diag @@ -120,20 +119,6 @@ void typedef_in_nested_name() { A2::Foo adsf2; } -void use_in_asm() { - typedef struct { - int a; - int b; - } A; - __asm mov eax, [eax].A.b - - using Alias = struct { - int a; - int b; - }; - __asm mov eax, [eax].Alias.b -} - auto sneaky() { struct S { // Local typedefs can be used after the scope they were in has closed: