aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-05-14 00:24:48 +0300
committerGitHub <noreply@github.com>2019-05-14 00:24:48 +0300
commit7b8ef78bc0002d0327626c6218b793f87c2a5eb8 (patch)
tree44ffa3b3c11e8e154615d65e79f9c79f5334648d /test cases
parentb849f6f935787055834ed3745faf7203c22c982b (diff)
parent523c7beefc170395fd3f49cf4609aadb8e986ad1 (diff)
downloadmeson-7b8ef78bc0002d0327626c6218b793f87c2a5eb8.zip
meson-7b8ef78bc0002d0327626c6218b793f87c2a5eb8.tar.gz
meson-7b8ef78bc0002d0327626c6218b793f87c2a5eb8.tar.bz2
Merge pull request #5331 from dcbaker/icl
ICL (Intel for Windows) support
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/1 trivial/meson.build5
-rw-r--r--test cases/common/123 llvm ir and assembly/meson.build5
-rw-r--r--test cases/common/124 cpp and asm/meson.build2
-rw-r--r--test cases/common/132 generated assembly/meson.build2
-rw-r--r--test cases/common/143 C and CPP link/meson.build2
-rw-r--r--test cases/common/2 cpp/meson.build5
-rw-r--r--test cases/common/204 function attributes/meson.build4
-rw-r--r--test cases/common/206 argument syntax/meson.build10
-rw-r--r--test cases/common/40 has function/meson.build2
-rw-r--r--test cases/fortran/1 basic/meson.build2
-rw-r--r--test cases/fortran/14 fortran links c/clib.def2
-rw-r--r--test cases/fortran/14 fortran links c/meson.build2
-rw-r--r--test cases/fortran/9 cpp/meson.build2
13 files changed, 25 insertions, 20 deletions
diff --git a/test cases/common/1 trivial/meson.build b/test cases/common/1 trivial/meson.build
index 67d6ed6..c71d9b0 100644
--- a/test cases/common/1 trivial/meson.build
+++ b/test cases/common/1 trivial/meson.build
@@ -6,9 +6,12 @@ project('trivial test',
#this is a comment
sources = 'trivial.c'
-if meson.get_compiler('c').get_id() == 'intel'
+cc = meson.get_compiler('c')
+if cc.get_id() == 'intel'
# Error out if the -std=xxx option is incorrect
add_project_arguments('-diag-error', '10159', language : 'c')
+elif cc.get_id() == 'intel-cl'
+ add_project_arguments('/Qdiag-error:10159', language : 'c')
endif
if meson.is_cross_build()
diff --git a/test cases/common/123 llvm ir and assembly/meson.build b/test cases/common/123 llvm ir and assembly/meson.build
index a67c6c6..3cc7d5e 100644
--- a/test cases/common/123 llvm ir and assembly/meson.build
+++ b/test cases/common/123 llvm ir and assembly/meson.build
@@ -41,16 +41,17 @@ foreach lang : ['c', 'cpp']
error('MESON_SKIP_TEST: ML (masm) not found')
endif
# Preprocess file (ml doesn't support pre-processing)
+ # Force the intput to be C (/Tc) because ICL otherwise assumes it's an object (.obj) file
preproc_name = lang + square_base + '.i'
square_preproc = custom_target(lang + square_impl + 'preproc',
input : square_impl,
output : preproc_name,
- command : [cl, '/EP', '/P', '/Fi' + preproc_name, '@INPUT@'] + uscore_args)
+ command : [cl, '/nologo', '/EP', '/P', '/Fi' + preproc_name, '/Tc', '@INPUT@'] + uscore_args)
# Use assembled object file instead of the original .S assembly source
square_impl = custom_target(lang + square_impl,
input : square_preproc,
output : lang + square_base + '.obj',
- command : [ml, '/safeseh', '/Fo', '@OUTPUT@', '/c', '@INPUT@'])
+ command : [ml, '/nologo', '/safeseh', '/Fo', '@OUTPUT@', '/c', '@INPUT@'])
endif
if supported_cpus.contains(cpu)
e = executable('square_asm_' + lang, square_impl, 'main.' + lang,
diff --git a/test cases/common/124 cpp and asm/meson.build b/test cases/common/124 cpp and asm/meson.build
index f097084..cf064d0 100644
--- a/test cases/common/124 cpp and asm/meson.build
+++ b/test cases/common/124 cpp and asm/meson.build
@@ -15,7 +15,7 @@ endif
sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it
-if not ['msvc', 'clang-cl'].contains(meson.get_compiler('cpp').get_id())
+if not ['msvc', 'clang-cl', 'intel-cl'].contains(meson.get_compiler('cpp').get_id())
sources += ['retval-' + cpu + '.S']
cpp_args = ['-DUSE_ASM']
message('Using ASM')
diff --git a/test cases/common/132 generated assembly/meson.build b/test cases/common/132 generated assembly/meson.build
index 5fb7429..2837747 100644
--- a/test cases/common/132 generated assembly/meson.build
+++ b/test cases/common/132 generated assembly/meson.build
@@ -2,7 +2,7 @@ project('generated assembly', 'c')
cc = meson.get_compiler('c')
-if ['msvc', 'clang-cl'].contains(cc.get_id())
+if ['msvc', 'clang-cl', 'intel-cl'].contains(cc.get_id())
error('MESON_SKIP_TEST: assembly files cannot be compiled directly by the compiler')
endif
diff --git a/test cases/common/143 C and CPP link/meson.build b/test cases/common/143 C and CPP link/meson.build
index 75281de..a93a981 100644
--- a/test cases/common/143 C and CPP link/meson.build
+++ b/test cases/common/143 C and CPP link/meson.build
@@ -30,6 +30,8 @@ if cxx.get_argument_syntax() == 'msvc'
static_linker = find_program('lib')
elif cxx.get_id() == 'clang-cl'
static_linker = find_program('llvm-lib')
+ elif cxx.get_id() == 'intel-cl'
+ static_linker = find_program('xilib')
else
error('unable to determine static linker to use with this compiler')
endif
diff --git a/test cases/common/2 cpp/meson.build b/test cases/common/2 cpp/meson.build
index 6398382..27c4321 100644
--- a/test cases/common/2 cpp/meson.build
+++ b/test cases/common/2 cpp/meson.build
@@ -1,8 +1,11 @@
project('c++ test', 'cpp')
-if meson.get_compiler('cpp').get_id() == 'intel'
+cpp = meson.get_compiler('cpp')
+if cpp.get_id() == 'intel'
# Error out if the -std=xxx option is incorrect
add_project_arguments('-diag-error', '10159', language : 'cpp')
+elif cpp.get_id() == 'intel-cl'
+ add_project_arguments('/Qdiag-error:10159', language : 'cpp')
endif
exe = executable('trivialprog', 'trivial.cc', extra_files : 'something.txt')
diff --git a/test cases/common/204 function attributes/meson.build b/test cases/common/204 function attributes/meson.build
index 1e93803..58ac7c8 100644
--- a/test cases/common/204 function attributes/meson.build
+++ b/test cases/common/204 function attributes/meson.build
@@ -19,7 +19,7 @@ project('gcc func attributes', ['c', 'cpp'])
c = meson.get_compiler('c')
cpp = meson.get_compiler('cpp')
-expected_result = not ['msvc', 'clang-cl'].contains(c.get_id())
+expected_result = not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id())
# Q: Why is ifunc not in this list or any of the below lists?
# A: It's too damn hard to figure out if you actually support it, since it
@@ -95,7 +95,7 @@ foreach a : ['dllexport', 'dllimport']
endforeach
message('checking get_supported_function_attributes')
-if not ['msvc', 'clang-cl'].contains(c.get_id())
+if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id())
multi_expected = attributes
else
multi_expected = []
diff --git a/test cases/common/206 argument syntax/meson.build b/test cases/common/206 argument syntax/meson.build
index 216da45..b97ca74 100644
--- a/test cases/common/206 argument syntax/meson.build
+++ b/test cases/common/206 argument syntax/meson.build
@@ -5,16 +5,10 @@ project(
cc = meson.get_compiler('c')
-if ['gcc', 'lcc', 'clang'].contains(cc.get_id())
+if ['gcc', 'lcc', 'clang', 'intel'].contains(cc.get_id())
expected = 'gcc'
-elif ['msvc', 'clang-cl'].contains(cc.get_id())
+elif ['msvc', 'clang-cl', 'intel-cl'].contains(cc.get_id())
expected = 'msvc'
-elif cc.get_id() == 'intel'
- if host_machine.system() == 'windows'
- expected = 'msvc'
- else
- expected = 'gcc'
- endif
else
# It's possible that other compilers end up here that shouldn't
expected = 'other'
diff --git a/test cases/common/40 has function/meson.build b/test cases/common/40 has function/meson.build
index eb30acd..539f313 100644
--- a/test cases/common/40 has function/meson.build
+++ b/test cases/common/40 has function/meson.build
@@ -21,7 +21,7 @@ foreach cc : compilers
# not taken from a cache (ie. the check above)
# On MSVC fprintf is defined as an inline function in the header, so it cannot
# be found without the include.
- if cc.get_id() != 'msvc'
+ if not ['msvc', 'intel-cl'].contains(cc.get_id())
assert(cc.has_function('fprintf', args : unit_test_args),
'"fprintf" function not found without include (on !msvc).')
else
diff --git a/test cases/fortran/1 basic/meson.build b/test cases/fortran/1 basic/meson.build
index 042902f..959ad35 100644
--- a/test cases/fortran/1 basic/meson.build
+++ b/test cases/fortran/1 basic/meson.build
@@ -1,7 +1,7 @@
project('simple fortran', 'fortran')
fc = meson.get_compiler('fortran')
-if fc == 'gcc'
+if fc.get_id() == 'gcc'
add_global_arguments('-fbounds-check', language : 'fortran')
endif
diff --git a/test cases/fortran/14 fortran links c/clib.def b/test cases/fortran/14 fortran links c/clib.def
new file mode 100644
index 0000000..4caeb24
--- /dev/null
+++ b/test cases/fortran/14 fortran links c/clib.def
@@ -0,0 +1,2 @@
+EXPORTS
+ hello
diff --git a/test cases/fortran/14 fortran links c/meson.build b/test cases/fortran/14 fortran links c/meson.build
index 163aec6..cd1369d 100644
--- a/test cases/fortran/14 fortran links c/meson.build
+++ b/test cases/fortran/14 fortran links c/meson.build
@@ -5,7 +5,7 @@ if ccid == 'msvc' or ccid == 'clang-cl'
error('MESON_SKIP_TEST: MSVC and GCC do not interoperate like this.')
endif
-c_lib = library('clib', 'clib.c')
+c_lib = library('clib', 'clib.c', vs_module_defs : 'clib.def')
f_call_c = executable('f_call_c', 'f_call_c.f90',
link_with: c_lib,
diff --git a/test cases/fortran/9 cpp/meson.build b/test cases/fortran/9 cpp/meson.build
index ad7d4b2..7f73985 100644
--- a/test cases/fortran/9 cpp/meson.build
+++ b/test cases/fortran/9 cpp/meson.build
@@ -7,7 +7,7 @@ if cpp.get_id() == 'clang'
error('MESON_SKIP_TEST Clang C++ does not find -lgfortran for some reason.')
endif
-if build_machine.system() == 'windows' and cpp.get_id() != 'gnu'
+if build_machine.system() == 'windows' and cpp.get_id() != fc.get_id()
error('MESON_SKIP_TEST mixing gfortran with non-GNU C++ does not work.')
endif