diff --git a/test/FrontendC++/2005-02-11-AnonymousUnion.cpp b/test/FrontendC++/2005-02-11-AnonymousUnion.cpp index b0ff7e75075..87ababc5f18 100644 --- a/test/FrontendC++/2005-02-11-AnonymousUnion.cpp +++ b/test/FrontendC++/2005-02-11-AnonymousUnion.cpp @@ -21,7 +21,7 @@ int test2(short F) { } // Make sure that normal unions work. duh :) -volatile union { +volatile union U_t { short S; int i; } U; diff --git a/test/FrontendC/2002-02-18-64bitConstant.c b/test/FrontendC/2002-02-18-64bitConstant.c index 6fd3e29d242..31e5c6eada4 100644 --- a/test/FrontendC/2002-02-18-64bitConstant.c +++ b/test/FrontendC/2002-02-18-64bitConstant.c @@ -2,7 +2,9 @@ /* GCC wasn't handling 64 bit constants right fixed */ -void main() { +#include + +int main() { long long Var = 123455678902ll; printf("%lld\n", Var); } diff --git a/test/FrontendC/2002-04-08-LocalArray.c b/test/FrontendC/2002-04-08-LocalArray.c index af6ebd6bdf9..75475a1b3bd 100644 --- a/test/FrontendC/2002-04-08-LocalArray.c +++ b/test/FrontendC/2002-04-08-LocalArray.c @@ -3,7 +3,7 @@ /* 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. */ -void test(unsigned X) { +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 , diff --git a/test/FrontendC/2002-08-02-UnionTest.c b/test/FrontendC/2002-08-02-UnionTest.c index bc44e461dec..e0862ed10cf 100644 --- a/test/FrontendC/2002-08-02-UnionTest.c +++ b/test/FrontendC/2002-08-02-UnionTest.c @@ -13,7 +13,7 @@ union X foo() { return Global; } -void main() { +int main() { union X test = foo(); printf("0x%p", test.B); } diff --git a/test/FrontendC/2003-10-02-UnionLValueError.c b/test/FrontendC/2003-10-02-UnionLValueError.c index 732f93a7731..2ded0c64b42 100644 --- a/test/FrontendC/2003-10-02-UnionLValueError.c +++ b/test/FrontendC/2003-10-02-UnionLValueError.c @@ -1,5 +1,7 @@ // RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null +#include + union U{ int i[8]; char s[80]; diff --git a/test/FrontendC/2004-02-13-Memset.c b/test/FrontendC/2004-02-13-Memset.c index 89ab9b9e4c0..423108b4475 100644 --- a/test/FrontendC/2004-02-13-Memset.c +++ b/test/FrontendC/2004-02-13-Memset.c @@ -1,5 +1,7 @@ // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3 +#include + void test(int* X, char *Y) { memset(X, 4, 1000); bzero(Y, 100); diff --git a/test/FrontendC/2004-02-20-Builtins.c b/test/FrontendC/2004-02-20-Builtins.c index 82b7dc1f34c..0c9ac7cae8a 100644 --- a/test/FrontendC/2004-02-20-Builtins.c +++ b/test/FrontendC/2004-02-20-Builtins.c @@ -1,5 +1,7 @@ // RUN: %llvmgcc -O3 -xc %s -c -o - | llvm-dis | not grep builtin +#include + void zsqrtxxx(float num) { num = sqrt(num); } diff --git a/test/FrontendC/2005-07-20-SqrtNoErrno.c b/test/FrontendC/2005-07-20-SqrtNoErrno.c index fd976a67933..3f85f728019 100644 --- a/test/FrontendC/2005-07-20-SqrtNoErrno.c +++ b/test/FrontendC/2005-07-20-SqrtNoErrno.c @@ -1,4 +1,4 @@ -// RUN: %llvmgcc %s -S -o - -fno-math-errno | gccas | llvm-dis | grep llvm.sqrt +// RUN: %llvmgcc %s -S -o - -fno-math-errno | grep llvm.sqrt #include float foo(float X) { diff --git a/test/FrontendC/2005-10-18-VariableSizedElementCrash.c b/test/FrontendC/2005-10-18-VariableSizedElementCrash.c index 867e4d285e6..b9166621db4 100644 --- a/test/FrontendC/2005-10-18-VariableSizedElementCrash.c +++ b/test/FrontendC/2005-10-18-VariableSizedElementCrash.c @@ -2,7 +2,7 @@ int sub1(int i, char *pi) { typedef int foo[i]; - struct bar {foo f1; int f2:3; int f3:4} *p = (struct bar *) pi; + struct bar {foo f1; int f2:3; int f3:4;} *p = (struct bar *) pi; xxx(p->f1); return p->f3; } diff --git a/test/FrontendC/2007-09-27-ComplexIntCompare.c b/test/FrontendC/2007-09-27-ComplexIntCompare.c index ee9a85c2454..50626e548c6 100644 --- a/test/FrontendC/2007-09-27-ComplexIntCompare.c +++ b/test/FrontendC/2007-09-27-ComplexIntCompare.c @@ -1,5 +1,8 @@ // RUN: %llvmgcc -S %s -o - // PR1708 + +#include + struct s { _Complex unsigned short x; }; struct s gs = { 100 + 200i }; struct s __attribute__((noinline)) foo (void) { return gs; } diff --git a/test/FrontendC/libcalls.c b/test/FrontendC/libcalls.c index c027ea4125e..648dc6f7226 100644 --- a/test/FrontendC/libcalls.c +++ b/test/FrontendC/libcalls.c @@ -4,6 +4,8 @@ // RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp} // RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f} +float exp2f(float); + float t4(unsigned char x) { return exp2f(x); }