brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · bb8a23b Raw
55 lines · plain
1# Compile with:2#    cat >modules.modulemap <<EOF3#      module Foo {4#        header "Foo.h"5#        export *6#      }7#      module Bar {8#        header "Bar.h"9#        export *10#      }11# EOF12#    echo 'typedef int bar;' >Bar.h13#    echo '@import Bar; typedef bar foo;' >Foo.h14#    echo '@import Foo; foo f() { return 0; }' >module-warnings.m15#    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.o19#20# Test for module-related warnings.21#22# RUN: rm -rf %t.dir && mkdir %t.dir && mkdir %t.dir/ModuleCache23# RUN: cp %p/../Inputs/module-warnings/1.o %t.dir24# RUN: cp %p/../Inputs/module-warnings/Foo.pcm %t.dir/ModuleCache25#26# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y \27# RUN:   %p/dummy-debug-map.map -o %t 2>&1 | FileCheck %s28#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.dir35# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 | FileCheck %s36# CHECK: rebuild the module cache37# CHECK-NOT: static libraries38#39# RUN: rm -rf %t.dir/ModuleCache40# RUN: dsymutil -verify -f -oso-prepend-path=%t.dir -y %s -o %t 2>&1 \41# RUN:   | FileCheck %s --check-prefix=STATIC42# STATIC: warning: {{.*}}Bar.pcm:43# STATIC: note: Linking a static library44# STATIC: warning: {{.*}}Foo.pcm:45# STATIC: warning: couldn`t find compile unit for the macro table with offset = 0x046# STATIC-NOT: warning:47 48---49triple:          'x86_64-apple-darwin'50objects:51  - filename: libstatic.a(1.o)52    symbols:53      - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }54...55