2009-04-15 00:44:36 +08:00
|
|
|
// RUN: echo "C89 tests:" &&
|
2009-04-14 14:27:57 +08:00
|
|
|
// RUN: clang %s -emit-llvm -S -o %t -std=c89 &&
|
|
|
|
// RUN: grep "define available_externally i32 @ei()" %t &&
|
|
|
|
// RUN: grep "define i32 @foo()" %t &&
|
|
|
|
// RUN: grep "define i32 @bar()" %t &&
|
2009-04-14 14:44:48 +08:00
|
|
|
// RUN: grep "define void @unreferenced1()" %t &&
|
|
|
|
// RUN: not grep unreferenced2 %t &&
|
2009-04-15 00:44:36 +08:00
|
|
|
// RUN: grep "define void @gnu_inline()" %t &&
|
2009-04-14 14:27:57 +08:00
|
|
|
|
2009-04-15 00:44:36 +08:00
|
|
|
// RUN: echo "\nC99 tests:" &&
|
2009-04-14 14:27:57 +08:00
|
|
|
// RUN: clang %s -emit-llvm -S -o %t -std=c99 &&
|
2009-04-15 04:25:53 +08:00
|
|
|
// RUN: grep "define i32 @ei()" %t &&
|
2009-04-14 14:27:57 +08:00
|
|
|
// RUN: grep "define available_externally i32 @foo()" %t &&
|
|
|
|
// RUN: grep "define i32 @bar()" %t &&
|
2009-04-15 04:25:53 +08:00
|
|
|
// RUN: not grep unreferenced1 %t &&
|
|
|
|
// RUN: grep "define void @unreferenced2()" %t &&
|
2009-04-15 00:44:36 +08:00
|
|
|
// RUN: grep "define void @gnu_inline()" %t &&
|
2009-04-14 14:27:57 +08:00
|
|
|
|
2009-04-15 00:44:36 +08:00
|
|
|
// RUN: echo "\nC++ tests:" &&
|
2009-04-14 14:27:57 +08:00
|
|
|
// RUN: clang %s -emit-llvm -S -o %t -std=c++98 &&
|
2009-04-15 04:25:53 +08:00
|
|
|
// RUN: grep "define linkonce_odr i32 @_Z2eiv()" %t &&
|
2009-04-14 14:27:57 +08:00
|
|
|
// RUN: grep "define linkonce_odr i32 @_Z3foov()" %t &&
|
|
|
|
// RUN: grep "define i32 @_Z3barv()" %t &&
|
2009-04-15 00:44:36 +08:00
|
|
|
// RUN: not grep unreferenced %t &&
|
|
|
|
// RUN: grep "define void @_Z10gnu_inlinev()" %t
|
2009-04-14 14:27:57 +08:00
|
|
|
|
|
|
|
extern inline int ei() { return 123; }
|
|
|
|
|
|
|
|
inline int foo() {
|
|
|
|
return ei();
|
|
|
|
}
|
|
|
|
|
|
|
|
int bar() { return foo(); }
|
|
|
|
|
|
|
|
|
2009-04-14 14:44:48 +08:00
|
|
|
inline void unreferenced1() {}
|
|
|
|
extern inline void unreferenced2() {}
|
2009-04-14 14:27:57 +08:00
|
|
|
|
2009-04-21 03:12:28 +08:00
|
|
|
__inline __attribute((__gnu_inline__)) void gnu_inline() {}
|