1 // Test that modules with different visibility mode can be shared.
2 // REQUIRES: aarch64-registered-target
4 // RUN: rm -rf %t && mkdir %t
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -triple arm64e-apple-macos -x c++ -fvisibility=default -fmodules-codegen -fmodules -emit-module -fmodule-name=foo %t/foo.modulemap -o %t/foo.pcm
9 // RUN: %clang_cc1 -emit-llvm %t/foo.pcm -o - | FileCheck %s --check-prefix=DEF
10 // RUN: %clang_cc1 -triple arm64e-apple-macos -x c++ -fvisibility=hidden -fmodules -fmodule-file=%t/foo.pcm -I%t -emit-llvm %t/test.cpp -o - | FileCheck %s --check-prefixes=USE
12 // DEF: define void @_Z2f4v()
13 // DEF: define weak_odr void @_Z2f3v()
15 // USE: define hidden void @_Z4testv()
16 // USE: declare void @_Z2f1v()
17 // USE: define internal void @_ZL2f2v()
18 // USE: declare void @_Z2f3v()
19 // USE: declare void @_Z2f4v()
39 module foo
{ header
"foo.h" }