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.

llvm-svn: 217314
This commit is contained in:
Nico Weber 2014-09-06 18:16:37 +00:00
parent 6211259759
commit c839c2bc20
2 changed files with 17 additions and 16 deletions

View File

@ -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
}

View File

@ -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: