2010-02-24 15:33:39 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - -verify | FileCheck %s
|
2009-02-19 15:15:39 +08:00
|
|
|
|
2007-12-02 14:27:33 +08:00
|
|
|
int g();
|
|
|
|
|
|
|
|
int foo(int i) {
|
2009-09-09 23:08:12 +08:00
|
|
|
return g(i);
|
2007-12-02 14:27:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int g(int i) {
|
2009-09-09 23:08:12 +08:00
|
|
|
return g(i);
|
2007-12-02 14:27:33 +08:00
|
|
|
}
|
|
|
|
|
2008-07-31 12:58:58 +08:00
|
|
|
// rdar://6110827
|
|
|
|
typedef void T(void);
|
|
|
|
void test3(T f) {
|
|
|
|
f();
|
|
|
|
}
|
|
|
|
|
2009-02-17 04:58:07 +08:00
|
|
|
int a(int);
|
|
|
|
int a() {return 1;}
|
2009-02-19 15:15:39 +08:00
|
|
|
|
|
|
|
void f0() {}
|
2010-02-24 15:33:39 +08:00
|
|
|
// CHECK: define void @f0()
|
2009-02-19 15:15:39 +08:00
|
|
|
|
|
|
|
void f1();
|
|
|
|
void f2(void) {
|
2010-02-24 15:33:39 +08:00
|
|
|
// CHECK: call void @f1()
|
2009-02-19 15:15:39 +08:00
|
|
|
f1(1, 2, 3);
|
|
|
|
}
|
2010-02-24 15:33:39 +08:00
|
|
|
// CHECK: define void @f1()
|
2009-02-19 15:15:39 +08:00
|
|
|
void f1() {}
|
2009-03-23 03:35:37 +08:00
|
|
|
|
2010-02-24 16:14:27 +08:00
|
|
|
// CHECK: define {{.*}} @f3{{\(\)|\(.*sret.*\)}}
|
2009-03-23 03:35:37 +08:00
|
|
|
struct foo { int X, Y, Z; } f3() {
|
2009-07-22 04:52:43 +08:00
|
|
|
while (1) {}
|
2009-03-23 03:35:37 +08:00
|
|
|
}
|
2009-06-23 09:38:41 +08:00
|
|
|
|
|
|
|
// PR4423 - This shouldn't crash in codegen
|
|
|
|
void f4() {}
|
2010-02-24 15:33:39 +08:00
|
|
|
void f5() { f4(42); } //expected-warning {{too many arguments}}
|
2010-02-24 15:14:12 +08:00
|
|
|
|
|
|
|
// Qualifiers on parameter types shouldn't make a difference.
|
|
|
|
static void f6(const float f, const float g) {
|
|
|
|
}
|
|
|
|
void f7(float f, float g) {
|
|
|
|
f6(f, g);
|
|
|
|
// CHECK: define void @f7(float{{.*}}, float{{.*}})
|
|
|
|
// CHECK: call void @f6(float{{.*}}, float{{.*}})
|
|
|
|
}
|