]> granicus.if.org Git - clang/commitdiff
Move x86-specific bits of warn-unused-local-typedef.cpp into their own file.
authorNico Weber <nicolasweber@gmx.de>
Sat, 6 Sep 2014 18:16:37 +0000 (18:16 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 6 Sep 2014 18:16:37 +0000 (18:16 +0000)
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

test/SemaCXX/warn-unused-local-typedef-x86asm.cpp [new file with mode: 0644]
test/SemaCXX/warn-unused-local-typedef.cpp

diff --git a/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp b/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp
new file mode 100644 (file)
index 0000000..d7792c0
--- /dev/null
@@ -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
+}
index 8861a48d47bb15661a1797cd5838eb0bb39eee7c..e4434276721f5cec2bfd70a821b82d0bab80270a 100644 (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: