2009-11-08 09:45:36 +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) {
|
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
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep 'define void @f0()' %t
|
2009-02-19 15:15:39 +08:00
|
|
|
void f0() {}
|
|
|
|
|
|
|
|
void f1();
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep 'call void @f1()' %t
|
2009-02-19 15:15:39 +08:00
|
|
|
void f2(void) {
|
|
|
|
f1(1, 2, 3);
|
|
|
|
}
|
2009-11-08 09:45:36 +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); }
|