| Sergei Larin | d19d4d3 | 2016-01-18 21:07:13 +0000 | [diff] [blame] | 1 | ; All functions in the same comdat group must | 
|  | 2 | ; be in the same module | 
|  | 3 |  | 
|  | 4 | ; RUN: llvm-split -j=2 -preserve-locals -o %t %s | 
|  | 5 | ; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK1 %s | 
|  | 6 | ; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK0 %s | 
|  | 7 |  | 
|  | 8 | ; CHECK0: declare i32 @fun1 | 
|  | 9 | ; CHECK0: declare i32 @fun2 | 
|  | 10 | ; CHECK0: declare i32 @fun3 | 
|  | 11 |  | 
|  | 12 | ; CHECK1: define internal i32 @fun1 | 
|  | 13 | ; CHECK1: define internal i32 @fun2 | 
|  | 14 | ; CHECK1: define i32 @fun3 | 
|  | 15 |  | 
|  | 16 | $fun = comdat any | 
|  | 17 |  | 
|  | 18 | define internal i32 @fun1() section ".text.funs" comdat($fun) { | 
|  | 19 | entry: | 
|  | 20 | ret i32 0 | 
|  | 21 | } | 
|  | 22 |  | 
|  | 23 | define internal i32 @fun2() section ".text.funs" comdat($fun) { | 
|  | 24 | entry: | 
|  | 25 | ret i32 0 | 
|  | 26 | } | 
|  | 27 |  | 
|  | 28 | define i32 @fun3() section ".text.funs" comdat($fun) { | 
|  | 29 | entry: | 
|  | 30 | ret i32 0 | 
|  | 31 | } | 
|  | 32 |  |