Peter Collingbourne | 22a7dfe | 2011-10-30 17:30:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s |
| 2 | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s |
| 3 | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s 2>&1 | FileCheck -check-prefix=CHECK-BC %s |
| 4 | |
| 5 | int f(void); |
| 6 | |
| 7 | #ifdef BITCODE |
| 8 | |
| 9 | // CHECK-BC: 'f': symbol multiply defined |
| 10 | int f(void) { |
| 11 | return 42; |
| 12 | } |
| 13 | |
| 14 | #else |
| 15 | |
| 16 | // CHECK-NO-BC: define i32 @g |
| 17 | // CHECK-NO-BC: ret i32 42 |
| 18 | int g(void) { |
| 19 | return f(); |
| 20 | } |
| 21 | |
| 22 | // CHECK-NO-BC: define i32 @f |
| 23 | |
| 24 | #endif |