diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-05-20 20:36:06 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-05-20 20:36:06 +0000 |
commit | 9e7e8839b2bb372fbe76703cc0702fa9a8404057 (patch) | |
tree | 127c3da33dc272601807d227db83d1725f7410bb /llvm/test/tools | |
parent | f45e5b58b8407a02f87e50e6c77137a273ada8ba (diff) | |
download | bcm5719-llvm-9e7e8839b2bb372fbe76703cc0702fa9a8404057.tar.gz bcm5719-llvm-9e7e8839b2bb372fbe76703cc0702fa9a8404057.zip |
dsymutil/modules: Reword the warning for static libraries without module caches
In addition to clarifying the warning message this contains a minor functional
change in that it now warns if the *immediate* parent directory in which the
missing PCM is expected to be isn't found.
This patch also includes a more comprehensive testcase.
rdar://problem/25860711
llvm-svn: 270269
Diffstat (limited to 'llvm/test/tools')
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/module-warnings/1.o | bin | 0 -> 2320 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/module-warnings/Bar.pcm | bin | 0 -> 17220 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/module-warnings/Foo.pcm | bin | 0 -> 17588 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/module-warnings/libstatic.a | bin | 0 -> 2504 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/Inputs/modules/libstatic.a | bin | 2632 -> 0 bytes | |||
-rw-r--r-- | llvm/test/tools/dsymutil/X86/module-warnings.test | 53 | ||||
-rw-r--r-- | llvm/test/tools/dsymutil/X86/modules-warnings.test | 26 |
7 files changed, 53 insertions, 26 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/module-warnings/1.o b/llvm/test/tools/dsymutil/Inputs/module-warnings/1.o Binary files differnew file mode 100644 index 00000000000..73531e27855 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/module-warnings/1.o diff --git a/llvm/test/tools/dsymutil/Inputs/module-warnings/Bar.pcm b/llvm/test/tools/dsymutil/Inputs/module-warnings/Bar.pcm Binary files differnew file mode 100644 index 00000000000..fdd8f8c7ffb --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/module-warnings/Bar.pcm diff --git a/llvm/test/tools/dsymutil/Inputs/module-warnings/Foo.pcm b/llvm/test/tools/dsymutil/Inputs/module-warnings/Foo.pcm Binary files differnew file mode 100644 index 00000000000..2b1ca6f1ae1 --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/module-warnings/Foo.pcm diff --git a/llvm/test/tools/dsymutil/Inputs/module-warnings/libstatic.a b/llvm/test/tools/dsymutil/Inputs/module-warnings/libstatic.a Binary files differnew file mode 100644 index 00000000000..48f161853ab --- /dev/null +++ b/llvm/test/tools/dsymutil/Inputs/module-warnings/libstatic.a diff --git a/llvm/test/tools/dsymutil/Inputs/modules/libstatic.a b/llvm/test/tools/dsymutil/Inputs/modules/libstatic.a Binary files differdeleted file mode 100644 index 46e79a5dd94..00000000000 --- a/llvm/test/tools/dsymutil/Inputs/modules/libstatic.a +++ /dev/null diff --git a/llvm/test/tools/dsymutil/X86/module-warnings.test b/llvm/test/tools/dsymutil/X86/module-warnings.test new file mode 100644 index 00000000000..3240a265058 --- /dev/null +++ b/llvm/test/tools/dsymutil/X86/module-warnings.test @@ -0,0 +1,53 @@ +# Compile with: +# cat >modules.modulemap <<EOF +# module Foo { +# header "Foo.h" +# export * +# } +# module Bar { +# header "Bar.h" +# export * +# } +# EOF +# echo 'typedef int bar;' >Bar.h +# echo '@import Bar; typedef bar foo;' >Foo.h +# echo '@import Foo; foo f() { return 0; }' >module-warnings.m +# clang -cc1 -emit-obj -fmodules -fmodule-map-file=modules.modulemap \ +# -fmodule-format=obj -debug-info-kind=standalone -dwarf-ext-refs \ +# -fmodules-cache-path=ModuleCache \ +# -fdisable-module-hash module-warnings.m -o 1.o +# +# Test for module-related warnings. +# +# RUN: rm -rf %t.dir && mkdir %t.dir && mkdir %t.dir/ModuleCache +# RUN: cp %p/../Inputs/module-warnings/1.o %t.dir +# RUN: cp %p/../Inputs/module-warnings/Foo.pcm %t.dir/ModuleCache +# +# RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y \ +# RUN: %p/dummy-debug-map.map -o %t 2>&1 | FileCheck %s +# +# Module-not-found should be reported only once. +# The exact error message depends on the OS so we don't check for it. +# CHECK: warning: {{.*}}Bar.pcm: +# CHECK-NOT: warning: {{.*}}Bar.pcm: +# +# RUN: cp %p/../Inputs/module-warnings/libstatic.a %t.dir +# RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 | FileCheck %s +# CHECK: rebuild the module cache +# CHECK-NOT: static libraries +# +# RUN: rm -rf %t.dir/ModuleCache +# RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 \ +# RUN: | FileCheck %s --check-prefix=STATIC +# STATIC: warning: {{.*}}Bar.pcm: +# STATIC: note: Linking a static library +# STATIC: warning: {{.*}}Foo.pcm: +# STATIC-NOT: note: + +--- +triple: 'x86_64-apple-darwin' +objects: + - filename: libstatic.a(1.o) + symbols: + - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 } +... diff --git a/llvm/test/tools/dsymutil/X86/modules-warnings.test b/llvm/test/tools/dsymutil/X86/modules-warnings.test deleted file mode 100644 index 35538d60bb1..00000000000 --- a/llvm/test/tools/dsymutil/X86/modules-warnings.test +++ /dev/null @@ -1,26 +0,0 @@ -# Test for module-related warnings. -# This reuses the inputs from the modules.m testcase. -# -# RUN: rm -rf %t.dir && mkdir %t.dir -# RUN: cp %p/../Inputs/modules/1.o %p/../Inputs/modules/Foo.pcm %t.dir -# -# RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y \ -# RUN: %p/dummy-debug-map.map -o %t 2>&1 | FileCheck %s -# -# Module-not-found should be reported only once. -# The exact error message depends on the OS so we don't check for it. -# CHECK: warning: {{.*}}Bar.pcm: -# CHECK-NOT: warning: {{.*}}Bar.pcm: -# -# RUN: cp %p/../Inputs/modules/libstatic.a %t.dir -# RUN: llvm-dsymutil -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 | FileCheck %s -# CHECK: rebuild the module cache -# CHECK-NOT: static libraries - ---- -triple: 'x86_64-apple-darwin' -objects: - - filename: libstatic.a(1.o) - symbols: - - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 } -... |