| 1 |
# Compile with: |
| 2 |
# cat >modules.modulemap <<EOF |
| 3 |
# module Foo { |
| 4 |
# header "Foo.h" |
| 5 |
# export * |
| 6 |
# } |
| 7 |
# module Bar { |
| 8 |
# header "Bar.h" |
| 9 |
# export * |
| 10 |
# } |
| 11 |
# EOF |
| 12 |
# echo 'typedef int bar;' >Bar.h |
| 13 |
# echo '@import Bar; typedef bar foo;' >Foo.h |
| 14 |
# echo '@import Foo; foo f() { return 0; }' >module-warnings.m |
| 15 |
# clang -cc1 -emit-obj -fmodules -fmodule-map-file=modules.modulemap \ |
| 16 |
# -fmodule-format=obj -debug-info-kind=standalone -dwarf-ext-refs \ |
| 17 |
# -fmodules-cache-path=ModuleCache \ |
| 18 |
# -fdisable-module-hash module-warnings.m -o 1.o |
| 19 |
# |
| 20 |
# Test for module-related warnings. |
| 21 |
# |
| 22 |
# RUN: rm -rf %t.dir && mkdir %t.dir && mkdir %t.dir/ModuleCache |
| 23 |
# RUN: cp %p/../Inputs/module-warnings/1.o %t.dir |
| 24 |
# RUN: cp %p/../Inputs/module-warnings/Foo.pcm %t.dir/ModuleCache |
| 25 |
# |
| 26 |
# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y \ |
| 27 |
# RUN: %p/dummy-debug-map.map -o %t 2>&1 | FileCheck %s |
| 28 |
# |
| 29 |
# Module-not-found should be reported only once. |
| 30 |
# The exact error message depends on the OS so we don't check for it. |
| 31 |
# CHECK: warning: {{.*}}Bar.pcm: |
| 32 |
# CHECK-NOT: warning: {{.*}}Bar.pcm: |
| 33 |
# |
| 34 |
# RUN: cp %p/../Inputs/module-warnings/libstatic.a %t.dir |
| 35 |
# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 | FileCheck %s |
| 36 |
# CHECK: rebuild the module cache |
| 37 |
# CHECK-NOT: static libraries |
| 38 |
# |
| 39 |
# RUN: rm -rf %t.dir/ModuleCache |
| 40 |
# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 \ |
| 41 |
# RUN: | FileCheck %s --check-prefix=STATIC |
| 42 |
# STATIC: warning: {{.*}}Bar.pcm: |
| 43 |
# STATIC: note: Linking a static library |
| 44 |
# STATIC: warning: {{.*}}Foo.pcm: |
| 45 |
# STATIC: warning: couldn`t find compile unit for the macro table with offset = 0x0 |
| 46 |
# STATIC-NOT: warning: |
| 47 |
|
| 48 |
--- |
| 49 |
triple: 'x86_64-apple-darwin' |
| 50 |
objects: |
| 51 |
- filename: libstatic.a(1.o) |
| 52 |
symbols: |
| 53 |
- { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 } |
| 54 |
... |