summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-04-07 20:47:37 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-04-07 20:47:37 +0000
commita1ddf5e74433b9fbe99d9d26a3297c2f90b1da5e (patch)
treec74ab375527246abe9d2171f0bdb1a3c8019fe63 /clang/test/Modules
parent8c76487ee5526ae81dc442b41abb2a785453c31d (diff)
downloadbcm5719-llvm-a1ddf5e74433b9fbe99d9d26a3297c2f90b1da5e.tar.gz
bcm5719-llvm-a1ddf5e74433b9fbe99d9d26a3297c2f90b1da5e.zip
[modules] Allow differences in flags that only affect preprocessor predefines
(and __has_feature checks) between explicitly-specified module files and the current compilation. llvm-svn: 265718
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/explicit-build-flags.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/test/Modules/explicit-build-flags.cpp b/clang/test/Modules/explicit-build-flags.cpp
index 6ced215a06d..12523fa3dd9 100644
--- a/clang/test/Modules/explicit-build-flags.cpp
+++ b/clang/test/Modules/explicit-build-flags.cpp
@@ -7,8 +7,7 @@
// Can use the module.
// RUN: %clang_cc1 -fmodules -DFOO=1 -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
-// Can use the module if an input file is newer. (This happens on
-// remote file systems.)
+// Can use the module if an input file is newer. (This happens on remote file systems.)
// RUN: sleep 1
// RUN: touch %t/tmp.h
// RUN: %clang_cc1 -fmodules -DFOO=1 -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
@@ -23,6 +22,19 @@
// Can use the module if -I flags change.
// RUN: %clang_cc1 -fmodules -DBAR=2 -I. -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
+// Can use the module if -fPIC/-fPIE flags change.
+// RUN: %clang_cc1 -fmodules -DBAR=2 -pic-level 2 -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
+// RUN: %clang_cc1 -fmodules -DBAR=2 -pie-level 1 -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
+
+// Can use the module if -static flag changes.
+// RUN: %clang_cc1 -fmodules -DBAR=2 -static-define -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
+
+// Can use the module if -fsanitize= flags change.
+// RUN: %clang_cc1 -fmodules -DBAR=2 -fsanitize=address -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
+//
+// RUN: %clang_cc1 -fmodules -DFOO=1 -fsanitize=address -x c++ -fmodule-name=tmp %t/map -emit-module -o %t/tmp-san.pcm
+// RUN: %clang_cc1 -fmodules -DBAR=2 -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp-san.pcm -verify -I%t %s
+
// Can use the module if -O flags change.
// RUN: %clang_cc1 -fmodules -DBAR=2 -Os -x c++ -fmodule-map-file=%t/map -fmodule-file=%t/tmp.pcm -verify -I%t %s
//
OpenPOWER on IntegriCloud