[llvm-commits] [llvm] r52176 - in /llvm/trunk/test: FrontendC++/2005-02-11-AnonymousUnion.cpp FrontendC/2002-02-18-64bitConstant.c FrontendC/2002-04-08-LocalArray.c FrontendC/2002-08-02-UnionTest.c FrontendC/2003-10-02-UnionLValueError.c FrontendC/2004-02-13-Memset.c FrontendC/2004-02-20-Builtins.c FrontendC/2005-07-20-SqrtNoErrno.c FrontendC/2005-10-18-VariableSizedElementCrash.c FrontendC/2007-09-27-ComplexIntCompare.c FrontendC/libcalls.c

Matthijs Kooijman matthijs at stdin.nl
Tue Jun 10 07:37:45 PDT 2008


Author: matthijs
Date: Tue Jun 10 09:37:44 2008
New Revision: 52176

URL: http://llvm.org/viewvc/llvm-project?rev=52176&view=rev
Log:
Fix some llvm-gcc warnings in testcases, mostly by adding includes or adding
declarations. These are the fixes that I was pretty confident about, there are
still a lot of other llvm-gcc warnings of which I'm not sure if they can be
safely ignored or fixed, without breaking the test case.

This fixes 11 testcases.

Modified:
    llvm/trunk/test/FrontendC++/2005-02-11-AnonymousUnion.cpp
    llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c
    llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c
    llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c
    llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c
    llvm/trunk/test/FrontendC/2004-02-13-Memset.c
    llvm/trunk/test/FrontendC/2004-02-20-Builtins.c
    llvm/trunk/test/FrontendC/2005-07-20-SqrtNoErrno.c
    llvm/trunk/test/FrontendC/2005-10-18-VariableSizedElementCrash.c
    llvm/trunk/test/FrontendC/2007-09-27-ComplexIntCompare.c
    llvm/trunk/test/FrontendC/libcalls.c

Modified: llvm/trunk/test/FrontendC++/2005-02-11-AnonymousUnion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2005-02-11-AnonymousUnion.cpp?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC++/2005-02-11-AnonymousUnion.cpp (original)
+++ llvm/trunk/test/FrontendC++/2005-02-11-AnonymousUnion.cpp Tue Jun 10 09:37:44 2008
@@ -21,7 +21,7 @@
 }
 
 // Make sure that normal unions work.  duh :)
-volatile union {
+volatile union U_t {
   short S;
   int i;
 } U;

Modified: llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c (original)
+++ llvm/trunk/test/FrontendC/2002-02-18-64bitConstant.c Tue Jun 10 09:37:44 2008
@@ -2,7 +2,9 @@
 
 /* GCC wasn't handling 64 bit constants right fixed */
 
-void main() {
+#include <stdio.h>
+
+int main() {
   long long Var = 123455678902ll;
   printf("%lld\n", Var);
 }

Modified: llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c (original)
+++ llvm/trunk/test/FrontendC/2002-04-08-LocalArray.c Tue Jun 10 09:37:44 2008
@@ -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 ,

Modified: llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c (original)
+++ llvm/trunk/test/FrontendC/2002-08-02-UnionTest.c Tue Jun 10 09:37:44 2008
@@ -13,7 +13,7 @@
   return Global;
 }
 
-void main() {
+int main() {
   union X test = foo();
   printf("0x%p", test.B);
 }

Modified: llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c (original)
+++ llvm/trunk/test/FrontendC/2003-10-02-UnionLValueError.c Tue Jun 10 09:37:44 2008
@@ -1,5 +1,7 @@
 // RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
 
+#include <stdio.h>
+
 union U{
   int i[8];
   char s[80];

Modified: llvm/trunk/test/FrontendC/2004-02-13-Memset.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-02-13-Memset.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2004-02-13-Memset.c (original)
+++ llvm/trunk/test/FrontendC/2004-02-13-Memset.c Tue Jun 10 09:37:44 2008
@@ -1,5 +1,7 @@
 // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3
 
+#include <memory.h>
+
 void test(int* X, char *Y) {
   memset(X, 4, 1000);
   bzero(Y, 100);

Modified: llvm/trunk/test/FrontendC/2004-02-20-Builtins.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2004-02-20-Builtins.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2004-02-20-Builtins.c (original)
+++ llvm/trunk/test/FrontendC/2004-02-20-Builtins.c Tue Jun 10 09:37:44 2008
@@ -1,5 +1,7 @@
 // RUN: %llvmgcc -O3 -xc %s -c -o - | llvm-dis | not grep builtin
 
+#include <math.h>
+
 void zsqrtxxx(float num) {
    num = sqrt(num);
 }

Modified: llvm/trunk/test/FrontendC/2005-07-20-SqrtNoErrno.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2005-07-20-SqrtNoErrno.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2005-07-20-SqrtNoErrno.c (original)
+++ llvm/trunk/test/FrontendC/2005-07-20-SqrtNoErrno.c Tue Jun 10 09:37:44 2008
@@ -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 <math.h>
 
 float foo(float X) {

Modified: llvm/trunk/test/FrontendC/2005-10-18-VariableSizedElementCrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2005-10-18-VariableSizedElementCrash.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2005-10-18-VariableSizedElementCrash.c (original)
+++ llvm/trunk/test/FrontendC/2005-10-18-VariableSizedElementCrash.c Tue Jun 10 09:37:44 2008
@@ -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;
 }

Modified: llvm/trunk/test/FrontendC/2007-09-27-ComplexIntCompare.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2007-09-27-ComplexIntCompare.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/2007-09-27-ComplexIntCompare.c (original)
+++ llvm/trunk/test/FrontendC/2007-09-27-ComplexIntCompare.c Tue Jun 10 09:37:44 2008
@@ -1,5 +1,8 @@
 // RUN: %llvmgcc -S %s -o -  
 // PR1708
+
+#include <stdlib.h>
+
 struct s { _Complex unsigned short x; };
 struct s gs = { 100 + 200i };
 struct s __attribute__((noinline)) foo (void) { return gs; }

Modified: llvm/trunk/test/FrontendC/libcalls.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/libcalls.c?rev=52176&r1=52175&r2=52176&view=diff

==============================================================================
--- llvm/trunk/test/FrontendC/libcalls.c (original)
+++ llvm/trunk/test/FrontendC/libcalls.c Tue Jun 10 09:37:44 2008
@@ -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);
 }





More information about the llvm-commits mailing list