[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / tools / dsymutil / X86 / modules.m
blob9e417861b9726a424f5b313049d329d55a627606
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    clang -D BAR_H -E -o Bar.h modules.m
13    clang -D FOO_H -E -o Foo.h modules.m
14    clang -D ODR_VIOLATION_C -E -o odr_violation.c modules.m
15    clang -c -fmodules -fmodule-map-file=modules.modulemap \
16      -g -gmodules -fmodules-cache-path=. \
17      -Xclang -fdisable-module-hash modules.m -o 1.o
18    clang -c -g odr_violation.c -o 2.o
21 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/modules \
22 // RUN:   -y %p/dummy-debug-map.map -o - \
23 // RUN:     | llvm-dwarfdump -v --debug-info - | FileCheck %s
25 // RUN: dsymutil -f -oso-prepend-path=%p/../Inputs/modules -y \
26 // RUN:   %p/dummy-debug-map.map -o %t 2>&1 | FileCheck --check-prefix=WARN %s
28 // WARN-NOT: warning: hash mismatch
30 // ---------------------------------------------------------------------
31 #ifdef BAR_H
32 // ---------------------------------------------------------------------
33 // CHECK:            DW_TAG_compile_unit
34 // CHECK-NOT:        DW_TAG
35 // CHECK:              DW_TAG_module
36 // CHECK-NEXT:           DW_AT_name{{.*}}"Bar"
37 // CHECK: 0x0[[BAR:.*]]: DW_TAG_structure_type
38 // CHECK-NOT:              DW_TAG
39 // CHECK:                  DW_AT_name {{.*}}"Bar"
40 // CHECK-NOT:              DW_TAG
41 // CHECK:                  DW_TAG_member
42 // CHECK:                    DW_AT_name {{.*}}"value"
43 // CHECK:                DW_TAG_structure_type
44 // CHECK-NOT:              DW_TAG
45 // CHECK:                  DW_AT_name {{.*}}"PruneMeNot"
47 struct Bar {
48   int value;
51 struct PruneMeNot;
53 #else
54 // ---------------------------------------------------------------------
55 #ifdef FOO_H
56 // ---------------------------------------------------------------------
57 // CHECK:               DW_TAG_compile_unit
58 // CHECK-NOT:             DW_TAG
59 // CHECK: 0x0[[FOO:.*]]:  DW_TAG_module
60 // CHECK-NEXT:              DW_AT_name{{.*}}"Foo"
61 // CHECK-NOT:               DW_TAG
62 // CHECK: 0x0[[BARTD:.*]]: DW_TAG_typedef
63 // CHECK-NOT:                 DW_TAG
64 // CHECK:                     DW_AT_type [DW_FORM_ref_addr] (0x{{0*}}[[BAR]]
65 // CHECK:                   DW_TAG_structure_type
66 // CHECK-NEXT:                DW_AT_name{{.*}}"S"
67 // CHECK-NOT:                 DW_TAG
68 // CHECK: 0x0[[INTERFACE:.*]]: DW_TAG_structure_type
69 // CHECK-NEXT:                DW_AT_name{{.*}}"Foo"
71 @import Bar;
72 typedef struct Bar Bar;
73 struct S {};
75 @interface Foo {
76   int ivar;
78 @end
80 #else
81 // ---------------------------------------------------------------------
82 #ifdef ODR_VIOLATION_C
83 // ---------------------------------------------------------------------
85 struct Bar {
86   int i;
88 typedef struct Bar Bar;
89 Bar odr_violation = { 42 };
91 // ---------------------------------------------------------------------
92 #else
93 // ---------------------------------------------------------------------
95 // CHECK:  DW_TAG_compile_unit
96 // CHECK:    DW_AT_low_pc
97 // CHECK-NOT:  DW_TAG_module
98 // CHECK-NOT:  DW_TAG_typedef
100 // CHECK:   DW_TAG_imported_declaration
101 // CHECK-NOT: DW_TAG
102 // CHECK:     DW_AT_import [DW_FORM_ref_addr] (0x{{0*}}[[FOO]]
104 // CHECK:   DW_TAG_subprogram
105 // CHECK:     DW_AT_name {{.*}}"main"
107 // CHECK:     DW_TAG_variable
108 // CHECK-NOT:   DW_TAG
109 // CHECK:       DW_AT_name{{.*}}"bar"
110 // CHECK-NOT:   DW_TAG
111 // CHECK:       DW_AT_type [DW_FORM_ref_addr] (0x{{0*}}[[BARTD]]
112 // CHECK:     DW_TAG_variable
113 // CHECK-NOT:   DW_TAG
114 // CHECK:       DW_AT_name{{.*}}"foo"
115 // CHECK-NOT:   DW_TAG
116 // CHECK:       DW_AT_type {{.*}}{0x{{0*}}[[PTR:.*]]}
118 // CHECK: 0x{{0*}}[[PTR]]: DW_TAG_pointer_type
119 // FIXME: The next line doesn't work.
120 // CHECK-NEXT   DW_AT_type [DW_FORM_ref_addr] {0x{{0*}}[[INTERFACE]]
121 extern int odr_violation;
123 @import Foo;
124 int main(int argc, char **argv) {
125   Bar bar;
126   Foo *foo = 0;
127   bar.value = odr_violation;
128   return bar.value;
130 #endif
131 #endif
132 #endif
134 // CHECK: DW_TAG_compile_unit
135 // CHECK:   DW_AT_name {{.*}}"odr_violation.c"
136 // CHECK: DW_TAG_variable
137 // CHECK:   DW_AT_name {{.*}}"odr_violation"
138 // CHECK:   DW_AT_type [DW_FORM_ref4] ({{.*}}{0x{{0*}}[[BAR2:.*]]}
139 // CHECK: 0x{{0*}}[[BAR2]]: DW_TAG_typedef
140 // CHECK:   DW_AT_type [DW_FORM_ref4] ({{.*}}{0x{{0*}}[[BAR3:.*]]}
141 // CHECK:   DW_AT_name {{.*}}"Bar"
142 // CHECK: 0x{{0*}}[[BAR3]]: DW_TAG_structure_type
143 // CHECK-NEXT:   DW_AT_name {{.*}}"Bar"