blob: 9ca0539e6a22ed15414da9d9a9d8abcc33917fd6 [file] [log] [blame]
Chandler Carruth0d745bc2015-03-14 04:47:43 +00001// RUN: rm -rf %t
2// RUN: cd %S
Adrian Prantlbc068582015-07-08 01:00:30 +00003// REQUIRES: x86-registered-target
Chandler Carruth0d745bc2015-03-14 04:47:43 +00004// RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
5// RUN: -iquote Inputs/merge-target-features \
Richard Smith47972af2015-06-16 00:08:24 +00006// RUN: -fno-implicit-modules \
Chandler Carruth0d745bc2015-03-14 04:47:43 +00007// 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 \
Richard Smith47972af2015-06-16 00:08:24 +000015// RUN: -fno-implicit-modules \
Chandler Carruth0d745bc2015-03-14 04:47:43 +000016// 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
Richard Smith8a308ec2015-11-05 00:54:55 +000023// SUBSET-NOT: error:
Richard Smith95dc57a2015-10-16 23:20:19 +000024// SUBSET: error: {{.*}} configuration mismatch
Richard Smith8a308ec2015-11-05 00:54:55 +000025// SUBSET-NOT: error:
Chandler Carruth0d745bc2015-03-14 04:47:43 +000026//
27// RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
28// RUN: -iquote Inputs/merge-target-features \
Richard Smith47972af2015-06-16 00:08:24 +000029// RUN: -fno-implicit-modules \
Chandler Carruth0d745bc2015-03-14 04:47:43 +000030// 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 \
Richard Smith47972af2015-06-16 00:08:24 +000041// RUN: -fno-implicit-modules \
Chandler Carruth0d745bc2015-03-14 04:47:43 +000042// 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 \
Richard Smith47972af2015-06-16 00:08:24 +000053// RUN: -fno-implicit-modules \
Chandler Carruth0d745bc2015-03-14 04:47:43 +000054// 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
Richard Smith8a308ec2015-11-05 00:54:55 +000061// MISMATCH-NOT: error:
Richard Smith95dc57a2015-10-16 23:20:19 +000062// MISMATCH: error: {{.*}} configuration mismatch
Richard Smith8a308ec2015-11-05 00:54:55 +000063// MISMATCH-NOT: error:
Chandler Carruth0d745bc2015-03-14 04:47:43 +000064
65#include "foo.h"
66
67int test(int x) {
68 return foo(x);
69}