mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-14 14:56:47 +00:00
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:
parent
6211259759
commit
c839c2bc20
16
clang/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp
Normal file
16
clang/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp
Normal 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
|
||||
}
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user