2014-06-27 20:19:56 +02:00
|
|
|
; RUN: llvm-link %s %p/Inputs/comdat.ll -S -o - | FileCheck %s
|
|
|
|
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
|
|
|
|
target triple = "i686-pc-windows-msvc"
|
|
|
|
|
|
|
|
$foo = comdat largest
|
2015-01-06 23:55:16 +01:00
|
|
|
@foo = global i32 42, comdat($foo)
|
2014-06-27 20:19:56 +02:00
|
|
|
|
2015-01-06 23:55:16 +01:00
|
|
|
define i32 @bar() comdat($foo) {
|
2014-06-27 20:19:56 +02:00
|
|
|
ret i32 42
|
|
|
|
}
|
|
|
|
|
|
|
|
$qux = comdat largest
|
2015-01-06 23:55:16 +01:00
|
|
|
@qux = global i64 12, comdat($qux)
|
2014-06-27 20:19:56 +02:00
|
|
|
|
2015-01-06 23:55:16 +01:00
|
|
|
define i32 @baz() comdat($qux) {
|
2014-06-27 20:19:56 +02:00
|
|
|
ret i32 12
|
|
|
|
}
|
|
|
|
|
|
|
|
$any = comdat any
|
2015-01-06 23:55:16 +01:00
|
|
|
@any = global i64 6, comdat($any)
|
2014-06-27 20:19:56 +02:00
|
|
|
|
|
|
|
; CHECK: $qux = comdat largest
|
|
|
|
; CHECK: $foo = comdat largest
|
|
|
|
; CHECK: $any = comdat any
|
|
|
|
|
2015-01-06 23:55:16 +01:00
|
|
|
; CHECK: @qux = global i64 12, comdat{{$}}
|
|
|
|
; CHECK: @any = global i64 6, comdat{{$}}
|
|
|
|
; CHECK: @foo = global i64 43, comdat{{$}}
|
2014-06-27 20:19:56 +02:00
|
|
|
; CHECK-NOT: @in_unselected_group = global i32 13, comdat $qux
|
|
|
|
|
2015-01-06 23:55:16 +01:00
|
|
|
; CHECK: define i32 @baz() comdat($qux)
|
|
|
|
; CHECK: define i32 @bar() comdat($foo)
|