2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc %s -emit-llvm -o %t &&
|
2009-02-19 15:15:39 +08:00
|
|
|
|
2007-12-02 14:27:33 +08:00
|
|
|
int g();
|
|
|
|
|
|
|
|
int foo(int i) {
|
|
|
|
return g(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
int g(int i) {
|
|
|
|
return g(i);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
|
|
// RUN: grep 'define void @f0()' %t &&
|
|
|
|
void f0() {}
|
|
|
|
|
|
|
|
void f1();
|
2009-05-05 14:16:31 +08:00
|
|
|
// RUN: grep 'call void @f1()' %t &&
|
2009-02-19 15:15:39 +08:00
|
|
|
void f2(void) {
|
|
|
|
f1(1, 2, 3);
|
|
|
|
}
|
2009-03-23 03:35:37 +08:00
|
|
|
// RUN: grep 'define void @f1()' %t &&
|
2009-02-19 15:15:39 +08:00
|
|
|
void f1() {}
|
2009-03-23 03:35:37 +08:00
|
|
|
|
|
|
|
// RUN: grep 'define .* @f3' %t | not grep -F '...'
|
|
|
|
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() {}
|
|
|
|
void f5() { f4(42); }
|