|
| 1 | +// Requires a specific target as the "module file has a different size than expected" is not reliable on all architectures. |
| 2 | +// REQUIRES: x86-registered-target |
| 3 | + |
1 | 4 | // RUN: rm -rf %t
|
2 | 5 |
|
3 | 6 | // -------------------------------
|
4 | 7 | // Build chained modules A, B, and C
|
5 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 8 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
6 | 9 | // RUN: -fmodule-name=a -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/a.pcm \
|
7 | 10 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
8 | 11 | //
|
9 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 12 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
10 | 13 | // RUN: -fmodule-file=%t/a.pcm \
|
11 | 14 | // RUN: -fmodule-name=b -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/b.pcm \
|
12 | 15 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
13 | 16 | //
|
14 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 17 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
15 | 18 | // RUN: -fmodule-file=%t/b.pcm \
|
16 | 19 | // RUN: -fmodule-name=c -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/c.pcm \
|
17 | 20 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
|
20 | 23 |
|
21 | 24 | // -------------------------------
|
22 | 25 | // Build B with an implicit build of A
|
23 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 26 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
24 | 27 | // RUN: -fmodule-name=b -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/b-not-a.pcm \
|
25 | 28 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-B-NO-A %s
|
26 | 29 | //
|
|
29 | 32 |
|
30 | 33 | // -------------------------------
|
31 | 34 | // Check that we can use the explicitly-built A, B, and C modules.
|
32 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 35 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
33 | 36 | // RUN: -I%S/Inputs/explicit-build \
|
34 | 37 | // RUN: -fmodule-file=%t/a.pcm \
|
35 | 38 | // RUN: -verify %s -DHAVE_A
|
36 | 39 | //
|
37 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 40 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
38 | 41 | // RUN: -I%S/Inputs/explicit-build \
|
39 | 42 | // RUN: -fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
|
40 | 43 | // RUN: -fmodule-file=%t/a.pcm \
|
41 | 44 | // RUN: -verify %s -DHAVE_A
|
42 | 45 | //
|
43 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 46 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
44 | 47 | // RUN: -I%S/Inputs/explicit-build \
|
45 | 48 | // RUN: -fmodule-file=%t/b.pcm \
|
46 | 49 | // RUN: -verify %s -DHAVE_A -DHAVE_B
|
47 | 50 | //
|
48 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 51 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
49 | 52 | // RUN: -I%S/Inputs/explicit-build \
|
50 | 53 | // RUN: -fmodule-file=%t/a.pcm \
|
51 | 54 | // RUN: -fmodule-file=%t/b.pcm \
|
52 | 55 | // RUN: -verify %s -DHAVE_A -DHAVE_B
|
53 | 56 | //
|
54 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 57 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
55 | 58 | // RUN: -I%S/Inputs/explicit-build \
|
56 | 59 | // RUN: -fmodule-file=%t/a.pcm \
|
57 | 60 | // RUN: -fmodule-file=%t/b.pcm \
|
58 | 61 | // RUN: -fmodule-file=%t/c.pcm \
|
59 | 62 | // RUN: -verify %s -DHAVE_A -DHAVE_B -DHAVE_C
|
60 | 63 | //
|
61 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 64 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
62 | 65 | // RUN: -I%S/Inputs/explicit-build \
|
63 | 66 | // RUN: -fmodule-file=%t/a.pcm \
|
64 | 67 | // RUN: -fmodule-file=%t/c.pcm \
|
|
67 | 70 | // -------------------------------
|
68 | 71 | // Check that -fmodule-file= in a module build makes the file transitively
|
69 | 72 | // available even if it's not used.
|
70 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ |
| 73 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ |
71 | 74 | // RUN: -fmodule-file=%t/b.pcm \
|
72 | 75 | // RUN: -fmodule-name=d -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/d.pcm \
|
73 | 76 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
74 | 77 | //
|
75 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ |
| 78 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fno-implicit-modules -Rmodule-build -fno-modules-error-recovery \ |
76 | 79 | // RUN: -I%S/Inputs/explicit-build \
|
77 | 80 | // RUN: -fmodule-file=%t/d.pcm \
|
78 | 81 | // RUN: -verify %s -DHAVE_A -DHAVE_B
|
|
104 | 107 |
|
105 | 108 | // -------------------------------
|
106 | 109 | // Check that we can use a mixture of implicit and explicit modules.
|
107 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 110 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
108 | 111 | // RUN: -I%S/Inputs/explicit-build \
|
109 | 112 | // RUN: -fmodule-file=%t/b-not-a.pcm \
|
110 | 113 | // RUN: -verify %s -DHAVE_A -DHAVE_B
|
111 | 114 |
|
112 | 115 | // -------------------------------
|
113 | 116 | // Try to use two different flavors of the 'a' module.
|
114 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 117 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
115 | 118 | // RUN: -fmodule-file=%t/a.pcm \
|
116 | 119 | // RUN: -fmodule-file=%t/b-not-a.pcm \
|
117 | 120 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS %s
|
118 | 121 | //
|
119 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 122 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
120 | 123 | // RUN: -fmodule-file=%t/a.pcm \
|
121 | 124 | // RUN: -fmodule-file=%t/b-not-a.pcm \
|
122 | 125 | // RUN: -fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
|
123 | 126 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS %s
|
124 | 127 | //
|
125 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 128 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
126 | 129 | // RUN: -fmodule-name=a -emit-module %S/Inputs/explicit-build/module.modulemap -o %t/a-alt.pcm \
|
127 | 130 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
128 | 131 | //
|
129 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 132 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
130 | 133 | // RUN: -fmodule-file=%t/a.pcm \
|
131 | 134 | // RUN: -fmodule-file=%t/a-alt.pcm \
|
132 | 135 | // RUN: -fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
|
133 | 136 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-MULTIPLE-AS %s
|
134 | 137 | //
|
135 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 138 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
136 | 139 | // RUN: -fmodule-file=%t/a-alt.pcm \
|
137 | 140 | // RUN: -fmodule-file=%t/a.pcm \
|
138 | 141 | // RUN: -fmodule-map-file=%S/Inputs/explicit-build/module.modulemap \
|
|
142 | 145 |
|
143 | 146 | // -------------------------------
|
144 | 147 | // Try to import a PCH with -fmodule-file=
|
145 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 148 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
146 | 149 | // RUN: -fmodule-name=a -emit-pch %S/Inputs/explicit-build/a.h -o %t/a.pch -DBUILDING_A_PCH \
|
147 | 150 | // RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-IMPLICIT-BUILD %s --allow-empty
|
148 | 151 | //
|
149 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 152 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
150 | 153 | // RUN: -fmodule-file=%t/a.pch \
|
151 | 154 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-A-AS-PCH %s
|
152 | 155 | //
|
|
157 | 160 | //
|
158 | 161 | // RUN: touch %t/not.pcm
|
159 | 162 | //
|
160 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 163 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
161 | 164 | // RUN: -fmodule-file=%t/not.pcm \
|
162 | 165 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-BAD-FILE %s
|
163 | 166 | //
|
164 | 167 | // CHECK-BAD-FILE: fatal error: file '{{.*}}not.pcm' is not a valid precompiled module file: file too small to contain AST file magic
|
165 | 168 |
|
166 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 169 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
167 | 170 | // RUN: -fmodule-file=%t/nonexistent.pcm \
|
168 | 171 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-FILE %s
|
169 | 172 | //
|
170 | 173 | // CHECK-NO-FILE: fatal error: module file '{{.*}}nonexistent.pcm' not found: module file not found
|
171 | 174 |
|
172 | 175 | // RUN: mv %t/a.pcm %t/a-tmp.pcm
|
173 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 176 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
174 | 177 | // RUN: -I%S/Inputs/explicit-build \
|
175 | 178 | // RUN: -fmodule-file=%t/c.pcm \
|
176 | 179 | // RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-NO-FILE-INDIRECT %s
|
|
185 | 188 | // Check that we don't get upset if B's timestamp is newer than C's.
|
186 | 189 | // RUN: touch %t/b.pcm
|
187 | 190 | //
|
188 |
| -// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 191 | +// RUN: %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
189 | 192 | // RUN: -I%S/Inputs/explicit-build \
|
190 | 193 | // RUN: -fmodule-file=%t/c.pcm \
|
191 | 194 | // RUN: -verify %s -DHAVE_A -DHAVE_B -DHAVE_C
|
|
194 | 197 | //
|
195 | 198 | // RUN: cp %t/b-not-a.pcm %t/b.pcm
|
196 | 199 | //
|
197 |
| -// RUN: not %clang_cc1 -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
| 200 | +// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \ |
198 | 201 | // RUN: -I%S/Inputs/explicit-build \
|
199 | 202 | // RUN: -fmodule-file=%t/c.pcm \
|
200 | 203 | // RUN: %s -DHAVE_A -DHAVE_B -DHAVE_C 2>&1 | FileCheck --check-prefix=CHECK-MISMATCHED-B %s
|
|
0 commit comments