r217314 - Move x86-specific bits of warn-unused-local-typedef.cpp into their own file.

Nico Weber nicolasweber at gmx.de
Sat Sep 6 11:16:38 PDT 2014


Author: nico
Date: Sat Sep  6 13:16:37 2014
New Revision: 217314

URL: http://llvm.org/viewvc/llvm-project?rev=217314&view=rev
Log:
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.

Added:
    cfe/trunk/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp
Modified:
    cfe/trunk/test/SemaCXX/warn-unused-local-typedef.cpp

Added: cfe/trunk/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp?rev=217314&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp (added)
+++ cfe/trunk/test/SemaCXX/warn-unused-local-typedef-x86asm.cpp Sat Sep  6 13:16:37 2014
@@ -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
+}

Modified: cfe/trunk/test/SemaCXX/warn-unused-local-typedef.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-unused-local-typedef.cpp?rev=217314&r1=217313&r2=217314&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-unused-local-typedef.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-unused-local-typedef.cpp Sat Sep  6 13:16:37 2014
@@ -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:





More information about the cfe-commits mailing list