File: module-warnings.test

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (53 lines) | stat: -rw-r--r-- 1,788 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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: dsymutil -verify -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: dsymutil -verify -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: dsymutil -verify -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: warning:

---
triple:          'x86_64-apple-darwin'
objects:
  - filename: libstatic.a(1.o)
    symbols:
      - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }
...