2011-10-31 01:30:44 +08:00
|
|
|
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
|
|
|
|
// 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
|
2013-07-05 00:16:58 +08:00
|
|
|
// RUN: not %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
|
2011-10-31 01:30:44 +08:00
|
|
|
|
|
|
|
int f(void);
|
|
|
|
|
|
|
|
#ifdef BITCODE
|
|
|
|
|
2014-10-25 09:51:19 +08:00
|
|
|
// CHECK-BC: fatal error: cannot link module {{.*}}'f': symbol multiply defined
|
2011-10-31 01:30:44 +08:00
|
|
|
int f(void) {
|
|
|
|
return 42;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-NO-BC-LABEL: define i32 @g
|
2011-10-31 01:30:44 +08:00
|
|
|
// CHECK-NO-BC: ret i32 42
|
|
|
|
int g(void) {
|
|
|
|
return f();
|
|
|
|
}
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-NO-BC-LABEL: define i32 @f
|
2011-10-31 01:30:44 +08:00
|
|
|
|
|
|
|
#endif
|