• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: rm -rf %t
2 // RUN: cd %S
3 // REQUIRES: x86-registered-target
4 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
5 // RUN:   -iquote Inputs/merge-target-features \
6 // RUN:   -fno-implicit-modules \
7 // RUN:   -fmodule-map-file-home-is-cwd \
8 // RUN:   -emit-module -fmodule-name=foo -o %t/foo.pcm \
9 // RUN:   -triple i386-unknown-unknown \
10 // RUN:   -target-cpu i386 -target-feature +sse2 \
11 // RUN:   Inputs/merge-target-features/module.modulemap
12 //
13 // RUN: not %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
14 // RUN:   -iquote Inputs/merge-target-features \
15 // RUN:   -fno-implicit-modules \
16 // RUN:   -fmodule-map-file-home-is-cwd \
17 // RUN:   -fmodule-map-file=Inputs/merge-target-features/module.modulemap \
18 // RUN:   -fmodule-file=%t/foo.pcm \
19 // RUN:   -triple i386-unknown-unknown \
20 // RUN:   -target-cpu i386 \
21 // RUN:   -fsyntax-only merge-target-features.cpp 2>&1 \
22 // RUN:   | FileCheck --check-prefix=SUBSET %s
23 // SUBSET-NOT: error:
24 // SUBSET: error: {{.*}} configuration mismatch
25 // SUBSET-NOT: error:
26 //
27 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
28 // RUN:   -iquote Inputs/merge-target-features \
29 // RUN:   -fno-implicit-modules \
30 // RUN:   -fmodule-map-file-home-is-cwd \
31 // RUN:   -fmodule-map-file=Inputs/merge-target-features/module.modulemap \
32 // RUN:   -fmodule-file=%t/foo.pcm \
33 // RUN:   -triple i386-unknown-unknown \
34 // RUN:   -target-cpu i386 -target-feature +sse2 \
35 // RUN:   -fsyntax-only merge-target-features.cpp 2>&1 \
36 // RUN:   | FileCheck --allow-empty --check-prefix=SAME %s
37 // SAME-NOT: error:
38 //
39 // RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
40 // RUN:   -iquote Inputs/merge-target-features \
41 // RUN:   -fno-implicit-modules \
42 // RUN:   -fmodule-map-file-home-is-cwd \
43 // RUN:   -fmodule-map-file=Inputs/merge-target-features/module.modulemap \
44 // RUN:   -fmodule-file=%t/foo.pcm \
45 // RUN:   -triple i386-unknown-unknown \
46 // RUN:   -target-cpu i386 -target-feature +sse2 -target-feature +sse3 \
47 // RUN:   -fsyntax-only merge-target-features.cpp 2>&1 \
48 // RUN:   | FileCheck --allow-empty --check-prefix=SUPERSET %s
49 // SUPERSET-NOT: error:
50 //
51 // RUN: not %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
52 // RUN:   -iquote Inputs/merge-target-features \
53 // RUN:   -fno-implicit-modules \
54 // RUN:   -fmodule-map-file-home-is-cwd \
55 // RUN:   -fmodule-map-file=Inputs/merge-target-features/module.modulemap \
56 // RUN:   -fmodule-file=%t/foo.pcm \
57 // RUN:   -triple i386-unknown-unknown \
58 // RUN:   -target-cpu i386 -target-feature +cx16 \
59 // RUN:   -fsyntax-only merge-target-features.cpp 2>&1 \
60 // RUN:   | FileCheck --check-prefix=MISMATCH %s
61 // MISMATCH-NOT: error:
62 // MISMATCH: error: {{.*}} configuration mismatch
63 // MISMATCH-NOT: error:
64 
65 #include "foo.h"
66 
test(int x)67 int test(int x) {
68   return foo(x);
69 }
70