diff options
-rw-r--r-- | test/CodeGen/2008-07-29-override-alias-decl.c | 2 | ||||
-rw-r--r-- | test/CodeGen/2009-01-21-invalid-debug-info.m | 2 | ||||
-rw-r--r-- | test/CodeGen/2009-06-01-addrofknr.c | 13 | ||||
-rw-r--r-- | test/CodeGen/boolassign.c | 5 | ||||
-rw-r--r-- | test/CodeGen/exprs.c | 2 | ||||
-rw-r--r-- | test/CodeGen/function-attributes.c | 2 | ||||
-rw-r--r-- | test/CodeGen/functions.c | 1 | ||||
-rw-r--r-- | test/CodeGen/global-decls.c | 2 | ||||
-rw-r--r-- | test/CodeGen/inline.c | 2 | ||||
-rw-r--r-- | test/CodeGen/unwind-attr.c | 1 | ||||
-rw-r--r-- | test/CodeGen/x86_32-arguments.c | 82 | ||||
-rw-r--r-- | test/CodeGen/x86_64-arguments.c | 18 |
12 files changed, 72 insertions, 60 deletions
diff --git a/test/CodeGen/2008-07-29-override-alias-decl.c b/test/CodeGen/2008-07-29-override-alias-decl.c index 43f4e3eced..4a36e0f13d 100644 --- a/test/CodeGen/2008-07-29-override-alias-decl.c +++ b/test/CodeGen/2008-07-29-override-alias-decl.c @@ -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"))); diff --git a/test/CodeGen/2009-01-21-invalid-debug-info.m b/test/CodeGen/2009-01-21-invalid-debug-info.m index 9a955a1c0d..2662b922a0 100644 --- a/test/CodeGen/2009-01-21-invalid-debug-info.m +++ b/test/CodeGen/2009-01-21-invalid-debug-info.m @@ -10,7 +10,7 @@ @interface I1 @end @implementation I1 --im0 {} +-im0 { return 0; } @end I1 *f1(void) { return 0; } diff --git a/test/CodeGen/2009-06-01-addrofknr.c b/test/CodeGen/2009-06-01-addrofknr.c index 16a5bbffc3..214318719c 100644 --- a/test/CodeGen/2009-06-01-addrofknr.c +++ b/test/CodeGen/2009-06-01-addrofknr.c @@ -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; } - diff --git a/test/CodeGen/boolassign.c b/test/CodeGen/boolassign.c index 2d14f8c1de..73aab8db7c 100644 --- a/test/CodeGen/boolassign.c +++ b/test/CodeGen/boolassign.c @@ -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; } diff --git a/test/CodeGen/exprs.c b/test/CodeGen/exprs.c index 36cfff9e8a..599e541d94 100644 --- a/test/CodeGen/exprs.c +++ b/test/CodeGen/exprs.c @@ -15,7 +15,7 @@ void *test(int *i) { } _Bool test2b; -int test2() {if (test2b);} +int test2() { if (test2b); return 0; } // PR1921 int test3() { diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c index ba2e4e4d56..d2d3b031a8 100644 --- a/test/CodeGen/function-attributes.c +++ b/test/CodeGen/function-attributes.c @@ -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() { diff --git a/test/CodeGen/functions.c b/test/CodeGen/functions.c index 12dff1b72c..685afb2225 100644 --- a/test/CodeGen/functions.c +++ b/test/CodeGen/functions.c @@ -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 diff --git a/test/CodeGen/global-decls.c b/test/CodeGen/global-decls.c index 80222ea85e..decb6a981c 100644 --- a/test/CodeGen/global-decls.c +++ b/test/CodeGen/global-decls.c @@ -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() { diff --git a/test/CodeGen/inline.c b/test/CodeGen/inline.c index 234f1f8d93..2df00db221 100644 --- a/test/CodeGen/inline.c +++ b/test/CodeGen/inline.c @@ -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(); } diff --git a/test/CodeGen/unwind-attr.c b/test/CodeGen/unwind-attr.c index 4954a0b59c..86036f94b9 100644 --- a/test/CodeGen/unwind-attr.c +++ b/test/CodeGen/unwind-attr.c @@ -2,4 +2,5 @@ // RUN: clang-cc -emit-llvm -o - %s | grep "@foo()" | grep nounwind int foo(void) { + return 0; } diff --git a/test/CodeGen/x86_32-arguments.c b/test/CodeGen/x86_32-arguments.c index 43a3ab246c..7464595dce 100644 --- a/test/CodeGen/x86_32-arguments.c +++ b/test/CodeGen/x86_32-arguments.c @@ -11,39 +11,41 @@ // 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))); diff --git a/test/CodeGen/x86_64-arguments.c b/test/CodeGen/x86_64-arguments.c index 0b68afdb4e..a274601ffb 100644 --- a/test/CodeGen/x86_64-arguments.c +++ b/test/CodeGen/x86_64-arguments.c @@ -12,21 +12,27 @@ // 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 |