Remove test/FrontendC, almost all of the tests have been migrated

to clang now, the rest are in process (6) or have been deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2011-07-26 23:49:39 +00:00
parent 00005782fa
commit e927dc654f
362 changed files with 0 additions and 5534 deletions

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* Regression test. Just compile .c -> .ll to test */
int foo(void) {
unsigned char *pp;
unsigned w_cnt;
w_cnt += *pp;
return w_cnt;
}

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
// This caused generation of the following type name:
// %Array = uninitialized global [10 x %complex int]
//
// which caused problems because of the space int the complex int type
//
struct { int X, Y; } Array[10];
void foo() {}

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void *dlclose(void*);
void ap_os_dso_unload(void *handle)
{
dlclose(handle);
return; /* This return triggers the bug: Weird */
}

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* Test problem where bad code was generated with a ?: statement was
in a function call argument */
void foo(int, double, float);
void bar(int x) {
foo(x, x ? 1.0 : 12.5, 1.0f);
}

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* This triggered a problem in reload, fixed by disabling most of the
* steps of compilation in GCC. Before this change, the code went through
* the entire backend of GCC, even though it was unnecessary for LLVM output
* now it is skipped entirely, and since reload doesn't run, it can't cause
* a problem.
*/
extern int tolower(int);
const char *rangematch(const char *pattern, int test, int c) {
if ((c <= test) | (tolower(c) <= tolower((unsigned char)test)))
return 0;
return pattern;
}

View File

@ -1,16 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* This testcase causes a symbol table collision. Type names and variable
* names should be in distinct namespaces
*/
typedef struct foo {
int X, Y;
} FOO;
static FOO foo[100];
int test() {
return foo[4].Y;
}

View File

@ -1,21 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* Testcase for a problem where GCC allocated xqic to a register,
* and did not have a VAR_DECL that explained the stack slot to LLVM.
* Now the LLVM code synthesizes a stack slot if one is presented that
* has not been previously recognized. This is where alloca's named
* 'local' come from now.
*/
typedef struct {
short x;
} foostruct;
int foo(foostruct ic);
void test() {
foostruct xqic;
foo(xqic);
}

View File

@ -1,37 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC Used to generate code that contained a branch to the entry node of
* the do_merge function. This is illegal LLVM code. To fix this, GCC now
* inserts an entry node regardless of whether or not it has to insert allocas.
*/
struct edge_rec
{
struct VERTEX *v;
struct edge_rec *next;
int wasseen;
int more_data;
};
typedef struct edge_rec *QUAD_EDGE;
typedef struct {
QUAD_EDGE left, right;
} EDGE_PAIR;
struct EDGE_STACK {
int ptr;
QUAD_EDGE *elts;
int stack_size;
};
int do_merge(QUAD_EDGE ldo, QUAD_EDGE rdo) {
int lvalid;
QUAD_EDGE basel,rcand;
while (1) {
if (!lvalid) {
return (int)basel->next;
}
}
}

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* test that locals are renamed with . notation */
void abc(void *);
void Test5(double X) {
abc(&X);
{
int X;
abc(&X);
{
float X;
abc(&X);
}
}
}

View File

@ -1,39 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
int test(int X) {
return X;
}
void abc(int *X);
int def(int Y, int Z) {
abc(&Z);
return Y;
}
struct Test { short X, x; int Y, Z; };
int Testing(struct Test *A) {
return A->X+A->Y;
}
int Test2(int X, struct Test A, int Y) {
return X+Y+A.X+A.Y;
}
int Test3(struct Test A, struct Test B) {
return A.X+A.Y+B.Y+B.Z;
}
struct Test Test4(struct Test A) {
return A;
}
int Test6() {
int B[200];
return B[4];
}
struct STest2 { int X; short Y[4]; double Z; };
struct STest2 Test7(struct STest2 X) {
return X;
}

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC wasn't handling 64 bit constants right fixed */
#include <stdio.h>
int main() {
long long Var = 123455678902ll;
printf("%lld\n", Var);
}

View File

@ -1,13 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
double FOO = 17;
double BAR = 12.0;
float XX = 12.0f;
static char *procnames[] = {
"EXIT"
};
void *Data[] = { &FOO, &BAR, &XX };

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <string.h>
int test(char *X) {
/* LLVM-GCC used to emit:
%.LC0 = internal global [3 x sbyte] c"\1F\FFFFFF8B\00"
*/
return strcmp(X, "\037\213");
}

View File

@ -1,19 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC would generate bad code if not enough initializers are
specified for an array.
*/
int a[10] = { 0, 2};
char str[10] = "x";
void *Arr[5] = { 0, 0 };
float F[12] = { 1.23f, 34.7f };
struct Test { int X; double Y; };
struct Test Array[10] = { { 2, 12.0 }, { 3, 24.0 } };
int B[4][4] = { { 1, 2, 3, 4}, { 5, 6, 7 }, { 8, 9 } };

View File

@ -1,14 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct Connection_Type {
long to;
char type[10];
long length;
} Connection;
Connection link[3]
= { {1, "link1", 10},
{2, "link2", 20},
{3, "link3", 30} };

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC was not emitting string constants of the correct length when
* embedded into a structure field like this. It thought the strlength
* was -1.
*/
typedef struct Connection_Type {
long to;
char type[10];
long length;
} Connection;
Connection link[3]
= { {1, "link1", 10},
{2, "link2", 20},
{3, "link3", 30} };

View File

@ -1,19 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC was generating PHI nodes with an arity < #pred of the basic block the
* PHI node lived in. This was breaking LLVM because the number of entries
* in a PHI node must equal the number of predecessors for a basic block.
*/
int trys(char *s, int x)
{
int asa;
double Val;
int LLS;
if (x) {
asa = LLS + asa;
} else {
}
return asa+(int)Val;
}

View File

@ -1,17 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* This code used to break GCC's SSA computation code. It would create
uses of B & C that are not dominated by their definitions. See:
http://gcc.gnu.org/ml/gcc/2002-03/msg00697.html
*/
int bar();
int foo()
{
int a,b,c;
a = b + c;
b = bar();
c = bar();
return a + b + c;
}

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC was not escaping quotes in string constants correctly, so this would
* get emitted:
* %.LC1 = internal global [32 x sbyte] c"*** Word "%s" on line %d is not\00"
*/
const char *Foo() {
return "*** Word \"%s\" on line %d is not";
}

View File

@ -1,22 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
int printf(const char *, ...);
int foo();
int main() {
while (foo()) {
switch (foo()) {
case 0:
case 1:
case 2:
case 3:
printf("3");
case 4: printf("4");
case 5:
case 6:
default:
break;
}
}
return 0;
}

View File

@ -1,14 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* GCC is not outputting the static array to the LLVM backend, so bad things
* happen. Note that if this is defined static, everything seems fine.
*/
double test(unsigned X) {
double student_t[30]={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 ,
2.447 , 2.365 , 2.306 , 2.262 , 2.228 ,
2.201 , 2.179 , 2.160 , 2.145 , 2.131 ,
2.120 , 2.110 , 2.101 , 2.093 , 2.086 ,
2.080 , 2.074 , 2.069 , 2.064 , 2.060 ,
2.056 , 2.052 , 2.048 , 2.045 };
return student_t[X];
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct S {
int i;
short s1, s2;
};
struct S func_returning_struct(void);
void loop(void) {
func_returning_struct();
}

View File

@ -1,25 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct {
char p;
short q;
char r;
int X;
short Y, Z;
int Q;
} foo;
int test(foo X, float);
int testE(char,short,char,int,int,float);
void test3(foo *X) {
X->q = 1;
}
void test2(foo Y) {
testE(Y.p, Y.q, Y.r, Y.X, Y.Y, 0.1f);
test(Y, 0.1f);
test2(Y);
test3(&Y);
}

View File

@ -1,15 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* Make sure the frontend is correctly marking static stuff as internal! */
int X;
static int Y = 12;
static void foo(int Z) {
Y = Z;
}
void *test() {
foo(12);
return &Y;
}

View File

@ -1,19 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* Testcase for when struct tag conflicts with typedef name... grr */
typedef struct foo {
struct foo *X;
int Y;
} * foo;
foo F1;
struct foo *F2;
enum bar { test1, test2 };
typedef float bar;
enum bar B1;
bar B2;

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
char *C = (char*)alloca(argc);
strcpy(C, argv[0]);
puts(C);
}

View File

@ -1,7 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <stdio.h>
void test() {
fprintf(stderr, "testing\n");
}

View File

@ -1,71 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
// Test list stuff
void *malloc(unsigned);
// Test opaque structure support. the list type is defined later
struct list;
struct list *PassThroughList(struct list *L) {
return L;
}
// Recursive data structure tests...
typedef struct list {
int Data;
struct list *Next;
} list;
list *Data;
void foo() {
static int Foo = 0; // Test static local variable
Foo += 1; // Increment static variable
Data = (list*)malloc(12); // This is not a proper list allocation
}
extern list ListNode1;
list ListNode3 = { 4, 0 };
list ListNode2 = { 3, &ListNode3 };
list ListNode0 = { 1, &ListNode1 };
list ListNode1 = { 2, &ListNode2 };
list ListArray[10];
// Iterative insert fn
void InsertIntoListTail(list **L, int Data) {
while (*L)
L = &(*L)->Next;
*L = (list*)malloc(sizeof(list));
(*L)->Data = Data;
(*L)->Next = 0;
}
// Recursive list search fn
list *FindData(list *L, int Data) {
if (L == 0) return 0;
if (L->Data == Data) return L;
return FindData(L->Next, Data);
}
void foundIt(void);
// Driver fn...
void DoListStuff() {
list *MyList = 0;
InsertIntoListTail(&MyList, 100);
InsertIntoListTail(&MyList, 12);
InsertIntoListTail(&MyList, 42);
InsertIntoListTail(&MyList, 1123);
InsertIntoListTail(&MyList, 1213);
if (FindData(MyList, 75)) foundIt();
if (FindData(MyList, 42)) foundIt();
if (FindData(MyList, 700)) foundIt();
}

View File

@ -1,57 +0,0 @@
// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null
/* These are random tests that I used when working on the GCC frontend
originally. */
// test floating point comparison!
int floatcomptest(double *X, double *Y, float *x, float *y) {
return *X < *Y || *x < *y;
}
extern void *malloc(unsigned);
// Exposed a bug
void *memset_impl(void *dstpp, int c, unsigned len) {
long long int dstp = (long long int) dstpp;
while (dstp % 4 != 0)
{
((unsigned char *) dstp)[0] = c;
dstp += 1;
len -= 1;
}
return dstpp;
}
// TEST problem with signed/unsigned versions of the same constants being shared
// incorrectly!
//
static char *temp;
static int remaining;
static char *localmalloc(int size) {
char *blah;
if (size>remaining)
{
temp = (char *) malloc(32768);
remaining = 32768;
return temp;
}
return 0;
}
typedef struct { double X; double Y; int Z; } PBVTest;
PBVTest testRetStruct(float X, double Y, int Z) {
PBVTest T = { X, Y, Z };
return T;
}
PBVTest testRetStruct2(void); // external func no inlining
double CallRetStruct(float X, double Y, int Z) {
PBVTest T = testRetStruct2();
return T.X+X+Y+Z;
}

View File

@ -1,13 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
// Test ?: in function calls
extern fp(int, char*);
char *Ext;
void
__bb_exit_func (void)
{
fp (12, Ext ? Ext : "<none>");
}

View File

@ -1,187 +0,0 @@
// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null
void *malloc(unsigned);
//#include <stdio.h>
int puts(const char *s);
struct FunStructTest {
int Test1;
char *Pointer;
int Array[12];
};
struct SubStruct {
short X, Y;
};
struct Quad {
int w;
struct SubStruct SS;
struct SubStruct *SSP;
char c;
int y;
};
struct Quad GlobalQuad = { 4, {1, 2}, 0, 3, 156 };
typedef int (*FuncPtr)(int);
unsigned PtrFunc(int (*Func)(int), int X) {
return Func(X);
}
char PtrFunc2(FuncPtr FuncTab[30], int Num) {
return FuncTab[Num]('b');
}
extern char SmallArgs2(char w, char x, long long Zrrk, char y, char z);
extern int SomeFunc(void);
char SmallArgs(char w, char x, char y, char z) {
SomeFunc();
return SmallArgs2(w-1, x+1, y, z, w);
}
static int F0(struct Quad Q, int i) { /* Pass Q by value */
struct Quad R;
if (i) R.SS = Q.SS;
Q.SSP = &R.SS;
Q.w = Q.y = Q.c = 1;
return Q.SS.Y + i + R.y - Q.c;
}
int F1(struct Quad *Q, int i) { /* Pass Q by address */
struct Quad R;
#if 0
if (i) R.SS = Q->SS;
#else
if (i) R = *Q;
#endif
Q->w = Q->y = Q->c = 1;
return Q->SS.Y+i+R.y-Q->c;
}
int BadFunc(float Val) {
int Result;
if (Val > 12.345) Result = 4;
return Result; /* Test use of undefined value */
}
int RealFunc(void) {
return SomeUndefinedFunction(1, 4, 5);
}
extern int EF1(int *, char *, int *);
int Func(int Param, long long Param2) {
int Result = Param;
{{{{
char c; int X;
EF1(&Result, &c, &X);
}}}
{ // c & X are duplicate names!
char c; int X;
EF1(&Result, &c, &X);
}
}
return Result;
}
short FunFunc(long long x, char z) {
return x+z;
}
unsigned castTest(int X) { return X; }
double TestAdd(double X, float Y) {
return X+Y+.5;
}
int func(int i, int j) {
while (i != 20)
i += 2;
j += func(2, i);
return (i * 3 + j*2)*j;
}
int SumArray(int Array[], int Num) {
int i, Result = 0;
for (i = 0; i < Num; ++i)
Result += Array[i];
return Result;
}
int ArrayParam(int Values[100]) {
return EF1((int*)Values[50], (char*)1, &Values[50]);
}
int ArrayToSum(void) {
int A[100], i;
for (i = 0; i < 100; ++i)
A[i] = i*4;
return A[A[0]]; //SumArray(A, 100);
}
int ExternFunc(long long, unsigned*, short, unsigned char);
int main(int argc, char *argv[]) {
unsigned i;
puts("Hello world!\n");
ExternFunc(-1, 0, (short)argc, 2);
//func(argc, argc);
for (i = 0; i < 10; i++)
puts(argv[3]);
return 0;
}
double MathFunc(double X, double Y, double Z,
double AA, double BB, double CC, double DD,
double EE, double FF, double GG, double HH,
double aAA, double aBB, double aCC, double aDD,
double aEE, double aFF) {
return X + Y + Z + AA + BB + CC + DD + EE + FF + GG + HH
+ aAA + aBB + aCC + aDD + aEE + aFF;
}
void strcpy(char *s1, char *s2) {
while (*s1++ = *s2++);
}
void strcat(char *s1, char *s2) {
while (*s1++);
s1--;
while (*s1++ = *s2++);
}
int strcmp(char *s1, char *s2) {
while (*s1++ == *s2++);
if (*s1 == 0) {
if (*s2 == 0) {
return 0;
} else {
return -1;
}
} else {
if (*s2 == 0) {
return 1;
} else {
return (*(--s1) - *(--s2));
}
}
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
char auto_kibitz_list[100][20] = {
{"diepx"},
{"ferret"},
{"knightc"},
{"knightcap"}};

View File

@ -1,4 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
char * foo() { return "\\begin{"; }

View File

@ -1,86 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
int
main(int argc, char** argv)
{
char c1;
short s1, ssf1, ssd1;
unsigned char ubs0;
signed char bs0;
unsigned char ubc0, uc2;
unsigned short us2, usf1, usd1;
int ic3, is3, sif1, sid1;
unsigned int uic4, uis4, uif1, uid1;
long slf1, sld1;
unsigned long ulf1, uld1;
float f1;
double d1;
/* Test integer to integer conversions */
c1 = (char) (argc >= 2)? atoi(argv[1]) : 0xff64; /* 100 = 'd' */
s1 = (short) (argc >= 3)? atoi(argv[2]) : -769; /* 0xf7ff = -769 */
ubc0 = (unsigned char) c1; /* 100 = 'd' */
ubs0 = (unsigned char) s1; /* 0xff = 255 */
bs0 = (signed char) s1; /* 0xff = -1 */
uc2 = (unsigned char) c1; /* 100 = 'd' */
us2 = (unsigned short) s1; /* 0xf7ff = 64767 */
ic3 = (int) c1; /* 100 = 'd' */
is3 = (int) s1; /* 0xfffff7ff = -769 */
uic4 = (unsigned int) c1; /* 100 = 'd' */
uis4 = (unsigned int) s1; /* 0xfffff7ff = 4294966527 */
printf("ubc0 = '%c'\n", ubc0);
printf("ubs0 = %u\n", ubs0);
printf("bs0 = %d\n", bs0);
printf("c1 = '%c'\n", c1);
printf("s1 = %d\n", s1);
printf("uc2 = '%c'\n", uc2);
printf("us2 = %u\n", us2);
printf("ic3 = '%c'\n", ic3);
printf("is3 = %d\n", is3);
printf("uic4 = '%c'\n", uic4);
printf("uis4 = %u\n", uis4);
/* Test floating-point to integer conversions */
f1 = (float) (argc >= 4)? atof(argv[3]) : 1.0;
d1 = (argc >= 5)? atof(argv[4]) : 2.0;
usf1 = (unsigned short) f1;
usd1 = (unsigned short) d1;
uif1 = (unsigned int) f1;
uid1 = (unsigned int) d1;
ulf1 = (unsigned long) f1;
uld1 = (unsigned long) d1;
ssf1 = (short) f1;
ssd1 = (short) d1;
sif1 = (int) f1;
sid1 = (int) d1;
slf1 = (long) f1;
sld1 = (long) d1;
printf("usf1 = %u\n", usf1);
printf("usd1 = %u\n", usd1);
printf("uif1 = %u\n", uif1);
printf("uid1 = %u\n", uid1);
printf("ulf1 = %u\n", ulf1);
printf("uld1 = %u\n", uld1);
printf("ssf1 = %d\n", ssf1);
printf("ssd1 = %d\n", ssd1);
printf("sif1 = %d\n", sif1);
printf("sid1 = %d\n", sid1);
printf("slf1 = %d\n", slf1);
printf("sld1 = %d\n", sld1);
return 0;
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
union X {
void *B;
};
union X foo() {
union X A;
A.B = (void*)123;
return A;
}

View File

@ -1,22 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
union X;
struct Empty {};
union F {};
union Q { union Q *X; };
union X {
char C;
int A, Z;
long long B;
void *b1;
struct { int A; long long Z; } Q;
};
union X foo(union X A) {
A.C = 123;
A.A = 39249;
//A.B = (void*)123040123321;
A.B = 12301230123123LL;
A.Z = 1;
return A;
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
int tcount;
void test(char *, const char*, int);
void foo() {
char Buf[10];
test(Buf, "n%%%d", tcount++);
}

View File

@ -1,16 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct
{
unsigned char type; /* Indicates, NORMAL, SUBNORMAL, etc. */
} InternalFPF;
static void SetInternalFPFZero(InternalFPF *dest) {
dest->type=0;
}
void denormalize(InternalFPF *ptr) {
SetInternalFPFZero(ptr);
}

View File

@ -1,14 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef union {
long (*ap)[4];
} ptrs;
void DoAssignIteration() {
ptrs abase;
abase.ap+=27;
Assignment(*abase.ap);
}

View File

@ -1,19 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* In this testcase, the return value of foo() is being promotedto a register
* which breaks stuff
*/
#include <stdio.h>
union X { char X; void *B; int a, b, c, d;};
union X foo() {
union X Global;
Global.B = (void*)123; /* Interesting part */
return Global;
}
int main() {
union X test = foo();
printf("0x%p", test.B);
}

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* This testcase doesn't actually test a bug, it's just the result of me
* figuring out the syntax for forward declaring a static variable. */
struct list {
int x;
struct list *Next;
};
static struct list B; /* Forward declare static */
static struct list A = { 7, &B };
static struct list B = { 8, &A };
extern struct list D; /* forward declare normal var */
struct list C = { 7, &D };
struct list D = { 8, &C };

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
int foo(int *A, unsigned X) {
return A[X];
}

View File

@ -1,26 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct DWstruct {
char high, low;
};
typedef union {
struct DWstruct s;
short ll;
} DWunion;
short __udivmodhi4 (char n1, char bm) {
DWunion rr;
if (bm == 0)
{
rr.s.high = n1;
}
else
{
rr.s.high = bm;
}
return rr.ll;
}

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
extern void start() __asm__("start");
extern void _start() __asm__("_start");
extern void __start() __asm__("__start");
void start() {}
void _start() {}
void __start() {}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void foo() {}
void bar() {
foo(1, 2, 3); /* Too many arguments passed */
}

View File

@ -1,5 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
_Bool X = 0;

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
const char *W = "foo";
const int X = 7;
int Y = 8;
const char * const Z = "bar";

View File

@ -1,5 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
extern char algbrfile[9];
char algbrfile[9] = "abcdefgh";

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct
{
void *stack;
unsigned size;
unsigned avail;
} compile_stack_type;
void foo(void*);
void bar(compile_stack_type T, unsigned);
void test() {
compile_stack_type CST;
foo(&CST);
bar(CST, 12);
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o /dev/null
union foo {
struct { char A, B; } X;
int C;
};
union foo V = { {1, 2} };

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct foo A;
struct foo {
int x;
double D;
};

View File

@ -1,13 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct Blend_Map_Entry {
union {
float Colour[5];
double Point_Slope[2];
} Vals;
};
void test(struct Blend_Map_Entry* Foo)
{
}

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
double Test(double A, double B, double C, double D) {
return -(A-B) - (C-D);
}

View File

@ -1,19 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct min_info {
long offset;
unsigned file_attr;
} min_info;
typedef struct Globals {
char answerbuf;
min_info info[1];
min_info *pInfo;
} Uz_Globs;
extern Uz_Globs G;
int extract_or_test_files() {
G.pInfo = G.info;
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
/* This is apparently legal C.
*/
extern __inline__ void test() { }
void test() {
}

View File

@ -1,7 +0,0 @@
/* RUN: %llvmgcc -xc %s -S -o - | grep -v alloca | not grep bitcast
*/
void test(int* array, long long N) {
array[N] = N[array] = 33;
}

View File

@ -1,14 +0,0 @@
/* RUN: %llvmgcc -xc %s -S -o - | not grep __builtin_
*
* __builtin_longjmp/setjmp should get transformed into llvm.setjmp/longjmp
* just like explicit setjmp/longjmp calls are.
*/
void jumpaway(int *ptr) {
__builtin_longjmp(ptr,1);
}
int main(void) {
__builtin_setjmp(0);
jumpaway(0);
}

View File

@ -1,7 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o %t.o
int test(_Bool pos, _Bool color) {
return 0;
return (pos && color);
}

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <setjmp.h>
sigjmp_buf B;
int foo() {
sigsetjmp(B, 1);
bar();
}

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct {
int op;
} event_t;
event_t test(int X) {
event_t foo = { 1 }, bar = { 2 };
return X ? foo : bar;
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void foo()
{
char *ap;
ap[1] == '-' && ap[2] == 0;
}

View File

@ -1,15 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
static int foo(int);
static int foo(C)
char C;
{
return C;
}
void test() {
foo(7);
}

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
extern int vfork(void);
test() {
vfork();
}

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct bar;
void foo()
{
unsigned int frame, focus;
(struct bar *) focus == (focus ? ((struct bar *) frame) : 0);
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct {
unsigned long val;
} structty;
void bar(structty new_mask);
static void foo() {
bar(({ structty mask; mask; }));
}

View File

@ -1,7 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <wchar.h>
struct {
wchar_t *name;
} syms = { L"NUL" };

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
union foo { int X; };
int test(union foo* F) {
{
union foo { float X; } A;
}
}

View File

@ -1,13 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct Word {
short bar;
short baz;
int final:1;
short quux;
} *word_limit;
void foo ()
{
word_limit->final = (word_limit->final && word_limit->final);
}

View File

@ -1,5 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void foo() {
unsigned char int_latin1[] = "f\200\372b\200\343\200\340";
}

View File

@ -1,10 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct foo {
unsigned int I:1;
unsigned char J[1];
unsigned int K:1;
};
void test(struct foo *X) {}

View File

@ -1,16 +0,0 @@
// RUN: %llvmgcc -S %s -o /dev/null
struct istruct {
unsigned char C;
};
struct foo {
unsigned int I:1;
struct istruct J;
unsigned char L[1];
unsigned int K:1;
};
struct foo F = { 1, { 7 }, { 123 } , 1 };

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct foo {
unsigned int I:1;
unsigned char J[1][123];
unsigned int K:1;
};
struct foo F;

View File

@ -1,30 +0,0 @@
// RUN: %llvmgcc -w -S %s -o - | llvm-as -o /dev/null
typedef struct BF {
int A : 1;
char B;
int C : 13;
} BF;
char *test1(BF *b) {
return &b->B; // Must be able to address non-bitfield
}
void test2(BF *b) { // Increment and decrement operators
b->A++;
--b->C;
}
void test3(BF *b) {
b->C = 12345; // Store
}
int test4(BF *b) {
return b->C; // Load
}
void test5(BF *b, int i) { // array ref
b[i].C = 12345;
}

View File

@ -1,18 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
enum En {
ENUM_VAL
};
struct St {
unsigned char A;
enum En B;
unsigned char C;
enum En D;
float E;
};
void func(struct St* A) {
A->D = ENUM_VAL;
}

View File

@ -1,13 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#include <stdio.h>
union U{
int i[8];
char s[80];
};
void format_message(char *buffer, union U *u) {
sprintf(buffer, u->s);
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
extern int A[10];
void Func(int *B) {
B - &A[5];
}

View File

@ -1,17 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct Foo {
unsigned a;
unsigned b;
unsigned c;
};
struct Bar {
union {
void **a;
struct Foo b;
}u;
};
struct Bar test = {0};

View File

@ -1,4 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
#ident "foo"

View File

@ -1,22 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct foo { int X; };
struct bar { int Y; };
extern int Func(struct foo*) __asm__("Func64");
extern int Func64(struct bar*);
int Func(struct foo *F) {
return 1;
}
int Func64(struct bar* B) {
return 0;
}
int test() {
Func(0); /* should be renamed to call Func64 */
Func64(0);
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct { int foo; } spinlock_t;
typedef struct wait_queue_head_t { spinlock_t lock; } wait_queue_head_t;
void call_usermodehelper(void) {
struct wait_queue_head_t work = { lock: (spinlock_t) { 0 }, };
}

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct { } the_coolest_struct_in_the_world;
extern the_coolest_struct_in_the_world xyzzy;
void *foo() { return &xyzzy; }

View File

@ -1,7 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
union bdflush_param {
struct { int x; } b_un;
int y[1];
} bdf_prm = {{30}};

View File

@ -1,11 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o - | grep getelementptr
// This should be turned into a tasty getelementptr instruction, not a nasty
// series of casts and address arithmetic.
char Global[100];
char *test1(unsigned i) {
return &Global[i];
}

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct { } rwlock_t;
struct fs_struct { rwlock_t lock; int umask; };
void __copy_fs_struct(struct fs_struct *fs) { fs->lock = (rwlock_t) { }; }

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void schedule_timeout(signed long timeout)
{
switch (timeout)
{
case ((long)(~0UL>>1)): break;
}
}

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o - | grep getelementptr
char *test(char* C) {
return C-1; // Should turn into a GEP
}
int *test2(int* I) {
return I-1;
}

View File

@ -1,4 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void query_newnamebuf(void) { ((void)"query_newnamebuf"); }

View File

@ -1,5 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o - | grep getelementptr
int *test(int *X, int Y) {
return X + Y;
}

View File

@ -1,8 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
void bar () {
static char x[10];
static char *xend = x + 10;
}

View File

@ -1,9 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
typedef struct { unsigned long pgprot; } pgprot_t;
void split_large_page(unsigned long addr, pgprot_t prot)
{
(addr ? prot : ((pgprot_t) { 0x001 } )).pgprot;
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep warning
struct item {
short delta[4];
};
int TEST(int nt) {
register struct item *aa;
aa[nt].delta;
return 1;
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct _GIOChannel {
int write_buf;
char partial_write_buf[6];
int d :1;
};
void g_io_channel_init (struct _GIOChannel *channel) {
channel->partial_write_buf[0];
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct face_cachel {
unsigned int reverse :1;
unsigned char font_specified[1];
};
void
ensure_face_cachel_contains_charset (struct face_cachel *cachel) {
cachel->font_specified[0] = 0;
}

View File

@ -1,7 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
int test() {
__complex__ double C;
double D;
C / D;
}

View File

@ -1,12 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct printf_spec {
unsigned int minus_flag:1;
char converter;
};
void parse_doprnt_spec () {
struct printf_spec spec;
spec.minus_flag = 1;
}

View File

@ -1,6 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
unsigned long do_csum(const unsigned char *buff, int len, unsigned long result) {
if (2 & (unsigned long) buff) result += 1;
return result;
}

View File

@ -1,14 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct i387_soft_struct {
long cwd;
};
union i387_union {
struct i387_soft_struct soft;
};
struct thread_struct {
union i387_union i387;
};
void _init_task_union(void) {
struct thread_struct thread = (struct thread_struct) { {{0}} };
}

View File

@ -1,16 +0,0 @@
// RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
struct i387_soft_struct {
long cwd;
long twd;
long fip;
};
union i387_union {
struct i387_soft_struct soft;
};
struct thread_struct {
union i387_union i387;
};
void _init_task_union(void) {
struct thread_struct thread = (struct thread_struct) { {{0}} };
}

View File

@ -1,3 +0,0 @@
// RUN: %llvmgcc -xc %s -S -o - | not grep dead_function
extern __inline__ void dead_function() {}

View File

@ -1,14 +0,0 @@
// RUN: %llvmgcc -S %s -o /dev/null
/*
* This regression test ensures that the C front end can compile initializers
* even when it cannot determine the size (as below).
*/
struct one
{
int a;
int values [];
};
struct one hobbit = {5, {1, 2, 3}};

Some files were not shown because too many files have changed in this diff Show More