[cfe-commits] r136033 - in /cfe/trunk/test/Sema: 2009-03-09-WeakDeclarations-1.c 2009-04-22-UnknownSize.c 2009-07-17-VoidParameter.c 2010-05-31-palignr.c

Eric Christopher echristo at apple.com
Mon Jul 25 17:47:55 PDT 2011


Author: echristo
Date: Mon Jul 25 19:47:54 2011
New Revision: 136033

URL: http://llvm.org/viewvc/llvm-project?rev=136033&view=rev
Log:
Migrate over 2009-04-22-UnknownSize.c, 2009-07-17-VoidParameter.c,
2009-03-09-WeakDeclarations-1.c, and 2010-05-31-palignr.c from
llvm/test/FrontendC.

Added:
    cfe/trunk/test/Sema/2009-03-09-WeakDeclarations-1.c
    cfe/trunk/test/Sema/2009-04-22-UnknownSize.c
    cfe/trunk/test/Sema/2009-07-17-VoidParameter.c
    cfe/trunk/test/Sema/2010-05-31-palignr.c

Added: cfe/trunk/test/Sema/2009-03-09-WeakDeclarations-1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/2009-03-09-WeakDeclarations-1.c?rev=136033&view=auto
==============================================================================
--- cfe/trunk/test/Sema/2009-03-09-WeakDeclarations-1.c (added)
+++ cfe/trunk/test/Sema/2009-03-09-WeakDeclarations-1.c Mon Jul 25 19:47:54 2011
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -triple i686-apple-darwin
+// Insist upon warnings for inappropriate weak attributes.
+
+// O.K.
+extern int ext_weak_import __attribute__ ((__weak_import__));
+
+// These are inappropriate, and should generate warnings:
+int decl_weak_import __attribute__ ((__weak_import__)); // expected-warning {'weak_import' attribute cannot be specified on a definition}
+int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13; // expected-warning {'weak_import' attribute cannot be specified on a definition}
+
+// O.K.
+extern int ext_f(void) __attribute__ ((__weak_import__));
+
+// These are inappropriate, and should generate warnings:
+int def_f(void) __attribute__ ((__weak_import__));
+int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};

Added: cfe/trunk/test/Sema/2009-04-22-UnknownSize.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/2009-04-22-UnknownSize.c?rev=136033&view=auto
==============================================================================
--- cfe/trunk/test/Sema/2009-04-22-UnknownSize.c (added)
+++ cfe/trunk/test/Sema/2009-04-22-UnknownSize.c Mon Jul 25 19:47:54 2011
@@ -0,0 +1,4 @@
+// RUN: not %clang_cc1 %s -emit-llvm -o -
+// PR2958
+static struct foo s; // expected-error { tentative definition has type 'struct foo' that is never completed }
+struct foo *p = &s;

Added: cfe/trunk/test/Sema/2009-07-17-VoidParameter.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/2009-07-17-VoidParameter.c?rev=136033&view=auto
==============================================================================
--- cfe/trunk/test/Sema/2009-07-17-VoidParameter.c (added)
+++ cfe/trunk/test/Sema/2009-07-17-VoidParameter.c Mon Jul 25 19:47:54 2011
@@ -0,0 +1,4 @@
+// RUN: not %clang_cc1 -emit-llvm %s -o -
+// PR4214
+typedef void vt;
+void (*func_ptr)(vt my_vt); // expected-error {argument may not have 'void' type}

Added: cfe/trunk/test/Sema/2010-05-31-palignr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/2010-05-31-palignr.c?rev=136033&view=auto
==============================================================================
--- cfe/trunk/test/Sema/2010-05-31-palignr.c (added)
+++ cfe/trunk/test/Sema/2010-05-31-palignr.c Mon Jul 25 19:47:54 2011
@@ -0,0 +1,22 @@
+// RUN: not %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o /dev/null %s
+
+#include <tmmintrin.h>
+
+extern int i;
+
+int main ()
+{
+#if defined( __SSSE3__ )
+
+  typedef int16_t     vSInt16         __attribute__ ((__vector_size__ (16)));
+
+  short   dtbl[] = {1,2,3,4,5,6,7,8};
+  vSInt16 *vdtbl = (vSInt16*) dtbl;
+
+  vSInt16 v0;
+  v0 = *vdtbl;
+  v0 = _mm_alignr_epi8(v0, v0, i); // expected-error {{argument to '__builtin_ia32_palignr128' must be a constant integer}}
+
+  return 0;
+#endif
+}





More information about the cfe-commits mailing list