1; RUN: opt -module-summary %s -o %t1.bc
2; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t1.bc
3;; Check baseline when both of them internalized when not exported.
4; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - --exported-symbol=_exported | llvm-dis -o - | FileCheck %s --check-prefix=INTERNALIZED
5;; Check symbols are exported, including the ones with `\01` prefix.
6; RUN: llvm-lto -thinlto-action=internalize -thinlto-index %t.index.bc %t1.bc -o - --exported-symbol=_exported --exported-symbol=_extern_not_mangled --exported-symbol=_extern_mangled | llvm-dis -o - | FileCheck %s --check-prefix=EXPORTED
7
8; INTERNALIZED: define internal void @extern_not_mangled
9; INTERNALIZED: define internal void @"\01_extern_mangled"
10; EXPORTED: define void @extern_not_mangled
11; EXPORTED: define void @"\01_extern_mangled"
12
13target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
14target triple = "x86_64-apple-macosx10.11.0"
15
16define void @exported() {
17  ret void
18}
19
20define void @extern_not_mangled() {
21  ret void
22}
23
24define void @"\01_extern_mangled"() {
25  ret void
26}
27