r176888 - Move the extern "C" sema tests to a new file.

Rafael Espindola rafael.espindola at gmail.com
Tue Mar 12 12:45:57 PDT 2013


Author: rafael
Date: Tue Mar 12 14:45:57 2013
New Revision: 176888

URL: http://llvm.org/viewvc/llvm-project?rev=176888&view=rev
Log:
Move the extern "C" sema tests to a new file.

Added:
    cfe/trunk/test/SemaCXX/extern-c.cpp
Modified:
    cfe/trunk/test/SemaCXX/function-redecl.cpp

Added: cfe/trunk/test/SemaCXX/extern-c.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/extern-c.cpp?rev=176888&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/extern-c.cpp (added)
+++ cfe/trunk/test/SemaCXX/extern-c.cpp Tue Mar 12 14:45:57 2013
@@ -0,0 +1,46 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+namespace test1 {
+  extern "C" {
+    void f() {
+      void test1_g(int); // expected-note {{previous declaration is here}}
+    }
+  }
+}
+int test1_g(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+
+namespace test2 {
+  extern "C" {
+    void f() {
+      extern int test2_x; // expected-note {{previous definition is here}}
+    }
+  }
+}
+float test2_x; // expected-error {{redefinition of 'test2_x' with a different type: 'float' vs 'int'}}
+
+namespace test3 {
+  extern "C" {
+    void f() {
+      extern int test3_b; // expected-note {{previous definition is here}}
+    }
+  }
+  extern "C" {
+    float test3_b; // expected-error {{redefinition of 'test3_b' with a different type: 'float' vs 'int'}}
+  }
+}
+
+extern "C" {
+  void test4_f() {
+    extern int test4_b; // expected-note {{previous definition is here}}
+  }
+}
+static float test4_b; // expected-error {{redefinition of 'test4_b' with a different type: 'float' vs 'int'}}
+
+extern "C" {
+  void test5_f() {
+    extern int test5_b; // expected-note {{previous definition is here}}
+  }
+}
+extern "C" {
+  static float test5_b; // expected-error {{redefinition of 'test5_b' with a different type: 'float' vs 'int'}}
+}

Modified: cfe/trunk/test/SemaCXX/function-redecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/function-redecl.cpp?rev=176888&r1=176887&r2=176888&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/function-redecl.cpp (original)
+++ cfe/trunk/test/SemaCXX/function-redecl.cpp Tue Mar 12 14:45:57 2013
@@ -116,48 +116,3 @@ bool Foo::isGood() { // expected-error {
 }
 void Foo::beEvil() {} // expected-error {{out-of-line definition of 'beEvil' does not match any declaration in namespace 'redecl_typo::Foo'; did you mean 'BeEvil'?}}
 }
-
-namespace test2 {
-  extern "C" {
-    void f() {
-      void test2_g(int); // expected-note {{previous declaration is here}}
-    }
-  }
-}
-int test2_g(int); // expected-error {{functions that differ only in their return type cannot be overloaded}}
-
-namespace test3 {
-  extern "C" {
-    void f() {
-      extern int test3_x; // expected-note {{previous definition is here}}
-    }
-  }
-}
-float test3_x; // expected-error {{redefinition of 'test3_x' with a different type: 'float' vs 'int'}}
-
-namespace test4 {
-  extern "C" {
-    void f() {
-      extern int b; // expected-note {{previous definition is here}}
-    }
-  }
-  extern "C" {
-    float b; // expected-error {{redefinition of 'b' with a different type: 'float' vs 'int'}}
-  }
-}
-
-extern "C" {
-  void test5_f() {
-    extern int test5_b; // expected-note {{previous definition is here}}
-  }
-}
-static float test5_b; // expected-error {{redefinition of 'test5_b' with a different type: 'float' vs 'int'}}
-
-extern "C" {
-  void test6_f() {
-    extern int test6_b; // expected-note {{previous definition is here}}
-  }
-}
-extern "C" {
-  static float test6_b; // expected-error {{redefinition of 'test6_b' with a different type: 'float' vs 'int'}}
-}





More information about the cfe-commits mailing list