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.

llvm-svn: 136033
This commit is contained in:
Eric Christopher 2011-07-26 00:47:54 +00:00
parent 9568f27950
commit 06b9d065a2
4 changed files with 46 additions and 0 deletions

View File

@ -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;};

View File

@ -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;

View File

@ -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}

View File

@ -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
}