1; REQUIRES: x86
2
3;; Test we don't get "duplicate symbol" error when bitcode/regular object
4;; comdats are used together.
5
6; RUN: llvm-as %s -o %t.o
7; RUN: llvm-mc -triple=x86_64-pc-linux %p/Inputs/comdat.s -o %t2.o -filetype=obj
8; RUN: ld.lld %t.o %t2.o -o %t.so -shared
9; RUN: llvm-readobj --symbols %t.so | FileCheck %s
10; RUN: ld.lld %t2.o %t.o -o %t2.so -shared
11; RUN: llvm-readobj --symbols %t2.so | FileCheck %s --check-prefix=OTHER
12
13
14target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
15target triple = "x86_64-unknown-linux-gnu"
16
17$c = comdat any
18
19define protected void @foo() comdat($c) {
20  ret void
21}
22
23; CHECK: Symbol {
24; CHECK:   Name: foo
25; CHECK-NEXT:   Value:
26; CHECK-NEXT:   Size: 1
27; CHECK-NEXT:   Binding: Global
28; CHECK-NEXT:   Type: Function
29; CHECK-NEXT:   Other [
30; CHECK-NEXT:     STV_PROTECTED
31; CHECK-NEXT:   ]
32; CHECK-NEXT:   Section: .text
33; CHECK-NEXT: }
34
35; OTHER: Symbol {
36; OTHER:   Name: foo
37; OTHER-NEXT:   Value:
38; OTHER-NEXT:   Size: 0
39; OTHER-NEXT:   Binding: Global
40; OTHER-NEXT:   Type: None
41; OTHER-NEXT:   Other [
42; OTHER-NEXT:     STV_PROTECTED
43; OTHER-NEXT:   ]
44; OTHER-NEXT:   Section: .text
45; OTHER-NEXT: }
46