StmtPrinter: factor out arg printing code to PrintCallArgs
[clang.git] / test / CodeGen / functions.c
bloba2c692d0ce3ea517b36111e73fad6dfdc10a96cb
1 // RUN: %clang_cc1 %s -emit-llvm -o - -verify | FileCheck %s
3 int g();
5 int foo(int i) {
6 return g(i);
9 int g(int i) {
10 return g(i);
13 // rdar://6110827
14 typedef void T(void);
15 void test3(T f) {
16 f();
19 int a(int);
20 int a() {return 1;}
22 void f0() {}
23 // CHECK: define void @f0()
25 void f1();
26 void f2(void) {
27 // CHECK: call void @f1()
28 f1(1, 2, 3);
30 // CHECK: define void @f1()
31 void f1() {}
33 // CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
34 struct foo { int X, Y, Z; } f3() {
35 while (1) {}
38 // PR4423 - This shouldn't crash in codegen
39 void f4() {}
40 void f5() { f4(42); } //expected-warning {{too many arguments}}
42 // Qualifiers on parameter types shouldn't make a difference.
43 static void f6(const float f, const float g) {
45 void f7(float f, float g) {
46 f6(f, g);
47 // CHECK: define void @f7(float{{.*}}, float{{.*}})
48 // CHECK: call void @f6(float{{.*}}, float{{.*}})
51 // PR6911 - incomplete function types
52 struct Incomplete;
53 void f8_callback(struct Incomplete);
54 void f8_user(void (*callback)(struct Incomplete));
55 void f8_test() {
56 f8_user(&f8_callback);
57 // CHECK: define void @f8_test()
58 // CHECK: call void @f8_user({{.*}}* bitcast (void ()* @f8_callback to {{.*}}*))
59 // CHECK: declare void @f8_user({{.*}}*)
60 // CHECK: declare void @f8_callback()