Chris Lattner | d9d049a | 2009-04-14 06:27:57 +0000 | [diff] [blame^] | 1 | // RUN: clang %s -emit-llvm -S -o %t -std=c89 && |
| 2 | // RUN: grep "define available_externally i32 @ei()" %t && |
| 3 | // RUN: grep "define i32 @foo()" %t && |
| 4 | // RUN: grep "define i32 @bar()" %t && |
| 5 | // RUN: grep "define void @unreferenced()" %t && |
| 6 | |
| 7 | // RUN: clang %s -emit-llvm -S -o %t -std=c99 && |
| 8 | // RUN: grep "define available_externally i32 @ei()" %t && |
| 9 | // RUN: grep "define available_externally i32 @foo()" %t && |
| 10 | // RUN: grep "define i32 @bar()" %t && |
| 11 | // RUN: grep "define available_externally void @unreferenced()" %t && |
| 12 | |
| 13 | // RUN: clang %s -emit-llvm -S -o %t -std=c++98 && |
| 14 | // RUN: grep "define available_externally i32 @_Z2eiv()" %t && |
| 15 | // RUN: grep "define linkonce_odr i32 @_Z3foov()" %t && |
| 16 | // RUN: grep "define i32 @_Z3barv()" %t && |
| 17 | // RUN: grep "define linkonce_odr void @_Z12unreferencedv()" %t |
| 18 | |
| 19 | extern inline int ei() { return 123; } |
| 20 | |
| 21 | inline int foo() { |
| 22 | return ei(); |
| 23 | } |
| 24 | |
| 25 | int bar() { return foo(); } |
| 26 | |
| 27 | |
| 28 | inline void unreferenced() {} |
| 29 | |