]> granicus.if.org Git - clang/commitdiff
Prep for new warning.
authorMike Stump <mrs@apple.com>
Tue, 21 Jul 2009 20:52:43 +0000 (20:52 +0000)
committerMike Stump <mrs@apple.com>
Tue, 21 Jul 2009 20:52:43 +0000 (20:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76638 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
test/CodeGen/2008-07-29-override-alias-decl.c
test/CodeGen/2009-01-21-invalid-debug-info.m
test/CodeGen/2009-06-01-addrofknr.c
test/CodeGen/boolassign.c
test/CodeGen/exprs.c
test/CodeGen/function-attributes.c
test/CodeGen/functions.c
test/CodeGen/global-decls.c
test/CodeGen/inline.c
test/CodeGen/unwind-attr.c
test/CodeGen/x86_32-arguments.c
test/CodeGen/x86_64-arguments.c

index 43f4e3ecedae08d63049d9942678fcf99ba1a7cd..4a36e0f13d5c685a3f2255745a601abccd2df01a 100644 (file)
@@ -1,6 +1,6 @@
 // RUN: clang-cc -emit-llvm -o - %s | grep -e "^@f" | count 1
 
-int x() {}
+int x() { return 1; }
 
 int f() __attribute__((weak, alias("x")));
 
index 9a955a1c0d95543b43d2828a5682d6ea3f995a69..2662b922a03c1b10256001588c75c5bbf0d332ae 100644 (file)
@@ -10,7 +10,7 @@
 @interface I1 @end
 
 @implementation I1
--im0 {}
+-im0 { return 0; }
 @end
 
 I1 *f1(void) { return 0; }
index 16a5bbffc3afed7c1075724a65afe2fe1863958d..214318719c3724be7b365368e0311e4156dad04f 100644 (file)
@@ -2,20 +2,21 @@
 // PR4289
 
 struct funcptr {
-    int (*func)();
+  int (*func)();
 };
 
 static int func(f)
-        void *f;
+  void *f;
 {
+  return 0;
 }
 
 int
 main(int argc, char *argv[])
 {
-        struct funcptr fp;
+  struct funcptr fp;
 
-        fp.func = &func;
-        fp.func = func;
+  fp.func = &func;
+  fp.func = func;
+  return 0;
 }
-
index 2d14f8c1de19b14ca6887395ebad648c67bbf2d9..73aab8db7cb17ca2580078816970dc82d2a4628a 100644 (file)
@@ -1,6 +1,7 @@
 // RUN: clang-cc %s -emit-llvm -o %t
 
 int testBoolAssign(void) {
-int ss;
-if ((ss = ss && ss)) {}
+  int ss;
+  if ((ss = ss && ss)) {}
+  return 1;
 }
index 36cfff9e8a699e9744c0a932daf699bc4ce99dae..599e541d947d2c2453333c795e7f768d851fbb90 100644 (file)
@@ -15,7 +15,7 @@ void *test(int *i) {
 }
 
 _Bool test2b; 
-int test2() {if (test2b);}
+int test2() { if (test2b); return 0; }
 
 // PR1921
 int test3() {
index ba2e4e4d564d329ada4a961d7c0339b1b35b9623..d2d3b031a83b2fe2a4da9a4f023422c19d0357d6 100644 (file)
@@ -56,7 +56,7 @@ int ai_1() {  return 4; }
 static __inline__ __attribute__((always_inline))
 struct {
   int a, b, c, d, e;
-} ai_2() { }
+} ai_2() { while (1) {} }
 
 
 int foo() {
index 12dff1b72cbc02851b3f232ab36fd986d58f05dd..685afb2225fdc7e17bbcdea6e3d2fb09e6d9e12f 100644 (file)
@@ -32,6 +32,7 @@ void f1() {}
 
 // RUN: grep 'define .* @f3' %t | not grep -F '...'
 struct foo { int X, Y, Z; } f3() {
+  while (1) {}
 }
 
 // PR4423 - This shouldn't crash in codegen
index 80222ea85ef12942e6bb9d52be2e5dd4d9885f00..decb6a981c7fb91c2e94cdaaa420f12412c53097 100644 (file)
@@ -11,7 +11,7 @@ int g0_common __attribute__((weak));
 // RUN: grep '@g0_def = weak global i32' %t &&
 int g0_def __attribute__((weak)) = 52;
 // RUN: grep 'define weak i32 @g1_def()' %t &&
-int __attribute__((weak)) g1_def (void) {}
+int __attribute__((weak)) g1_def (void) { return 0; }
 
 // Force _ext references
 void f0() {
index 234f1f8d93a807576aa320f2ed8cc604747d5bd5..2df00db22119cb7f3ec9d52e33e2bd606b5011d2 100644 (file)
@@ -74,6 +74,7 @@ void test_test3() { test3(); }
 extern int test4(void);
 extern __inline __attribute__ ((__gnu_inline__)) int test4(void)
 {
+  return 0;
 }
 
 void test_test4() { test4(); }
@@ -81,6 +82,7 @@ void test_test4() { test4(); }
 extern __inline int test5(void);
 extern __inline int __attribute__ ((__gnu_inline__)) test5(void)
 {
+  return 0;
 }
 
 void test_test5() { test5(); }
index 4954a0b59ce45afd605ba03cc2f68c52ca830cca..86036f94b98138c110c10bcdd01548bb1576b82a 100644 (file)
@@ -2,4 +2,5 @@
 // RUN: clang-cc -emit-llvm -o - %s | grep "@foo()" | grep nounwind 
 
 int foo(void) {
+  return 0;
 }
index 43a3ab246c71dff0d242923d5ce016e76646c335..7464595dce54a7e4c0232c4576089cecb25a1555 100644 (file)
 // RUN: grep 'define void @f8_2(i32 %a0.0, i32 %a0.1)' %t &&
 
 char f0(void) {
+  return 0;
 }
 
 short f1(void) {
+  return 0;
 }
 
 int f2(void) {
+  return 0;
 }
 
 float f3(void) {
+  return 0;
 }
 
 double f4(void) {
+  return 0;
 }
 
 long double f5(void) {
+  return 0;
 }
 
-void f6(char a0, short a1, int a2, long long a3, void *a4) {
-}
+void f6(char a0, short a1, int a2, long long a3, void *a4) {}
 
 typedef enum { A, B, C } E;
 
-void f7(E a0) {
-}
+void f7(E a0) {}
 
 struct s8 {
   int a;
   int b;
 };
-struct s8 f8_1(void) {
-}
-void f8_2(struct s8 a0) {
-}
+struct s8 f8_1(void) { while (1) {} }
+void f8_2(struct s8 a0) {}
 
 // This should be passed just as s8.
 
@@ -56,10 +58,8 @@ struct s9 {
   int a : 17;
   int b;
 };
-struct s9 f9_1(void) {
-}
-void f9_2(struct s9 a0) {
-}
+struct s9 f9_1(void) { while (1) {} }
+void f9_2(struct s9 a0) {}
 
 // Return of small structures and unions
 
@@ -67,7 +67,7 @@ void f9_2(struct s9 a0) {
 struct s10 {
   union { };
   float f;
-} f10(void) {}
+} f10(void) { while (1) {} }
 
 // Small vectors and 1 x {i64,double} are returned in registers
 
@@ -78,17 +78,17 @@ struct s10 {
 // RUN: grep '<2 x i64> @f15()' %t &&
 // RUN: grep '<2 x i64> @f16()' %t &&
 typedef short T11 __attribute__ ((vector_size (4)));
-T11 f11(void) {}
+T11 f11(void) { while (1) {} }
 typedef int T12 __attribute__ ((vector_size (8)));
-T12 f12(void) {}
+T12 f12(void) { while (1) {} }
 typedef long long T13 __attribute__ ((vector_size (8)));
-T13 f13(void) {}
+T13 f13(void) { while (1) {} }
 typedef double T14 __attribute__ ((vector_size (8)));
-T14 f14(void) {}
+T14 f14(void) { while (1) {} }
 typedef long long T15 __attribute__ ((vector_size (16)));
-T15 f15(void) {}
+T15 f15(void) { while (1) {} }
 typedef double T16 __attribute__ ((vector_size (16)));
-T16 f16(void) {}
+T16 f16(void) { while (1) {} }
 
 // And when the single element in a struct (but not for 64 and
 // 128-bits).
@@ -99,60 +99,60 @@ T16 f16(void) {}
 // RUN: grep -F 'void @f20(%4* noalias sret %agg.result)' %t &&
 // RUN: grep -F 'void @f21(%5* noalias sret %agg.result)' %t &&
 // RUN: grep -F 'void @f22(%6* noalias sret %agg.result)' %t &&
-struct { T11 a; } f17(void) {}
-struct { T12 a; } f18(void) {}
-struct { T13 a; } f19(void) {}
-struct { T14 a; } f20(void) {}
-struct { T15 a; } f21(void) {}
-struct { T16 a; } f22(void) {}
+struct { T11 a; } f17(void) { while (1) {} }
+struct { T12 a; } f18(void) { while (1) {} }
+struct { T13 a; } f19(void) { while (1) {} }
+struct { T14 a; } f20(void) { while (1) {} }
+struct { T15 a; } f21(void) { while (1) {} }
+struct { T16 a; } f22(void) { while (1) {} }
 
 // Single element structures are handled specially
 
 // RUN: grep -F 'float @f23()' %t &&
 // RUN: grep -F 'float @f24()' %t &&
 // RUN: grep -F 'float @f25()' %t &&
-struct { float a; } f23(void) {}
-struct { float a[1]; } f24(void) {}
-struct { struct {} a; struct { float a[1]; } b; } f25(void) {}
+struct { float a; } f23(void) { while (1) {} }
+struct { float a[1]; } f24(void) { while (1) {} }
+struct { struct {} a; struct { float a[1]; } b; } f25(void) { while (1) {} }
 
 // Small structures are handled recursively
 // RUN: grep -F 'i32 @f26()' %t &&
 // RUN: grep 'void @f27(%.truct.s27\* noalias sret %agg.result)' %t &&
-struct s26 { struct { char a, b; } a; struct { char a, b; } b; } f26(void) {}
-struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) {}
+struct s26 { struct { char a, b; } a; struct { char a, b; } b; } f26(void) { while (1) {} }
+struct s27 { struct { char a, b, c; } a; struct { char a; } b; } f27(void) { while (1) {} }
 
 // RUN: grep 'void @f28(%.truct.s28\* noalias sret %agg.result)' %t &&
-struct s28 { int a; int b[]; } f28(void) {}
+struct s28 { int a; int b[]; } f28(void) { while (1) {} }
 
 // RUN: grep 'define i16 @f29()' %t &&
-struct s29 { struct { } a[1]; char b; char c; } f29(void) {}
+struct s29 { struct { } a[1]; char b; char c; } f29(void) { while (1) {} }
 
 // RUN: grep 'define i16 @f30()' %t &&
-struct s30 { char a; char b : 4; } f30(void) {}
+struct s30 { char a; char b : 4; } f30(void) { while (1) {} }
 
 // RUN: grep 'define float @f31()' %t &&
-struct s31 { char : 0; float b; char : 0; } f31(void) {}
+struct s31 { char : 0; float b; char : 0; } f31(void) { while (1) {} }
 
 // RUN: grep 'define i32 @f32()' %t &&
-struct s32 { char a; unsigned : 0; } f32(void) {}
+struct s32 { char a; unsigned : 0; } f32(void) { while (1) {} }
 
 // RUN: grep 'define float @f33()' %t &&
-struct s33 { float a; long long : 0; } f33(void) {}
+struct s33 { float a; long long : 0; } f33(void) { while (1) {} }
 
 // RUN: grep 'define float @f34()' %t &&
-struct s34 { struct { int : 0; } a; float b; } f34(void) {}
+struct s34 { struct { int : 0; } a; float b; } f34(void) { while (1) {} }
 
 // RUN: grep 'define i16 @f35()' %t &&
-struct s35 { struct { int : 0; } a; char b; char c; } f35(void) {}
+struct s35 { struct { int : 0; } a; char b; char c; } f35(void) { while (1) {} }
 
 // RUN: grep 'define i16 @f36()' %t &&
-struct s36 { struct { int : 0; } a[2][10]; char b; char c; } f36(void) {}
+struct s36 { struct { int : 0; } a[2][10]; char b; char c; } f36(void) { while (1) {} }
 
 // RUN: grep 'define float @f37()' %t &&
-struct s37 { float c[1][1]; } f37(void) {}
+struct s37 { float c[1][1]; } f37(void) { while (1) {} }
 
 // RUN: grep 'define void @f38(.struct.s38. noalias sret .agg.result)' %t &&
-struct s38 { char a[3]; short b; } f38(void) {}
+struct s38 { char a[3]; short b; } f38(void) { while (1) {} }
 
 // RUN: grep 'define void @f39(.struct.s39. byval align 16 .x)' %t &&
 typedef int v39 __attribute((vector_size(16)));
index 0b68afdb4edddb778ea0fd0a95aadede24198d6b..a274601ffb5038411727b8ca52be95d5a2c12f38 100644 (file)
 // RUN: grep 'define void @f8_2(.0)' %t &&
 
 char f0(void) {
+  return 0;
 }
 
 short f1(void) {
+  return 0;
 }
 
 int f2(void) {
+  return 0;
 }
 
 float f3(void) {
+  return 0;
 }
 
 double f4(void) {
+  return 0;
 }
 
 long double f5(void) {
+  return 0;
 }
 
 void f6(char a0, short a1, int a2, long long a3, void *a4) {
@@ -42,23 +48,23 @@ union u8 {
   long double a;
   int b;
 };
-union u8 f8_1() {}
+union u8 f8_1() { while (1) {} }
 void f8_2(union u8 a0) {}
 
 // RUN: grep 'define i64 @f9()' %t &&
-struct s9 { int a; int b; int : 0; } f9(void) {}
+struct s9 { int a; int b; int : 0; } f9(void) { while (1) {} }
 
 // RUN: grep 'define void @f10(i64)' %t &&
 struct s10 { int a; int b; int : 0; };
 void f10(struct s10 a0) {}
 
 // RUN: grep 'define void @f11(.union.anon. noalias sret .agg.result)' %t &&
-union { long double a; float b; } f11() {}
+union { long double a; float b; } f11() { while (1) {} }
 
 // RUN: grep 'define i64 @f12_0()' %t &&
 // RUN: grep 'define void @f12_1(i64)' %t &&
 struct s12 { int a __attribute__((aligned(16))); };
-struct s12 f12_0(void) {}
+struct s12 f12_0(void) { while (1) {} }
 void f12_1(struct s12 a0) {}
 
 // Check that sret parameter is accounted for when checking available integer
@@ -67,7 +73,7 @@ void f12_1(struct s12 a0) {}
 
 struct s13_0 { long long f0[3]; };
 struct s13_0 f13(int a, int b, int c, int d, 
-                 struct s13_1 { long long f0[2]; } e, int f) {}
+                 struct s13_1 { long long f0[2]; } e, int f) { while (1) {} }
 
 // RUN: grep 'define void @f14(.*, i8 signext .X)' %t &&
 void f14(int a, int b, int c, int d, int e, int f, 
@@ -86,6 +92,6 @@ void f17(float a, float b, float c, float d, float e, float f, float g, float h,
 // RUN: grep '.1 = bitcast i64. .tmp to .struct.f18_s0.' %t &&
 // RUN: grep '.2 = load .struct.f18_s0. .1, align 1' %t &&
 // RUN: grep 'store .struct.f18_s0 .2, .struct.f18_s0. .f18_arg1' %t &&
-void f18(int a, struct f18_s0 { int f0; } f18_arg1) {}
+void f18(int a, struct f18_s0 { int f0; } f18_arg1) { while (1) {} }
 
 // RUN: true