summaryrefslogtreecommitdiff
path: root/test cases/common/198 function attributes
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-04-26 16:52:13 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-26 23:39:15 +0100
commite75e3976facda7de244fbb9a02eebf0d043ea1c8 (patch)
treedab22f95b5c837a70b1b4164d97ff351a49ffd81 /test cases/common/198 function attributes
parent53fe7c2f0a51697cd57628753852dd3f8711becf (diff)
downloadmeson-e75e3976facda7de244fbb9a02eebf0d043ea1c8.tar.gz
Condense test directory names.
Diffstat (limited to 'test cases/common/198 function attributes')
-rw-r--r--test cases/common/198 function attributes/meson.build111
-rw-r--r--test cases/common/198 function attributes/meson_options.txt7
-rw-r--r--test cases/common/198 function attributes/test.json10
3 files changed, 0 insertions, 128 deletions
diff --git a/test cases/common/198 function attributes/meson.build b/test cases/common/198 function attributes/meson.build
deleted file mode 100644
index 98173096b..000000000
--- a/test cases/common/198 function attributes/meson.build
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright © 2017-2018 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-project('gcc func attributes', ['c', 'cpp'])
-
-# For msvc these will fail because msvc doesn't support __attribute__, for
-# Clang and GCC, they should pass.
-c = meson.get_compiler('c')
-cpp = meson.get_compiler('cpp')
-
-if c.get_id() == 'pgi'
- error('MESON_SKIP_TEST: PGI supports its own set of features, will need a separate list for PGI to test it.')
-endif
-
-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
-# requires both compiler and libc support, and there isn't a good way to
-# figure that out except by running the code we're trying to test.
-attributes = [
- 'aligned',
- 'always_inline',
- 'cold',
- 'const',
- 'constructor',
- 'constructor_priority',
- 'deprecated',
- 'destructor',
- 'flatten',
- 'format',
- 'format_arg',
- 'gnu_inline',
- 'hot',
- 'malloc',
- 'noinline',
- 'nonnull',
- 'noreturn',
- 'nothrow',
- 'pure',
- 'unused',
- 'used',
- 'warn_unused_result',
- 'weak',
-]
-
-if c.get_id() != 'intel'
- # not supported by icc as of 19.0.0
- attributes += 'weakref'
-endif
-
-# These are unsupported on darwin with apple clang 9.1.0
-if host_machine.system() != 'darwin'
- attributes += 'alias'
- attributes += 'visibility'
- attributes += 'alloc_size'
-endif
-
-if ['gcc', 'intel'].contains(c.get_id())
- # not supported by clang as of 5.0.0 (at least up to 6.0.1)
- attributes += 'artificial'
- attributes += 'error'
- attributes += 'externally_visible'
- attributes += 'leaf'
- attributes += 'noclone'
- attributes += 'optimize'
- attributes += 'warning'
-
- if c.get_id() == 'gcc' and c.version().version_compare('>= 7.0.0')
- attributes += 'fallthrough'
- endif
-endif
-
-if get_option('mode') == 'single'
- foreach a : attributes
- x = c.has_function_attribute(a)
- assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a))
- x = cpp.has_function_attribute(a)
- assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a))
- endforeach
-
- win_expect = ['windows', 'cygwin'].contains(host_machine.system())
- foreach a : ['dllexport', 'dllimport']
- assert(c.has_function_attribute(a) == win_expect,
- '@0@: @1@'.format(c.get_id(), a))
- assert(cpp.has_function_attribute(a) == win_expect,
- '@0@: @1@'.format(cpp.get_id(), a))
- endforeach
-else
- if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id())
- multi_expected = attributes
- else
- multi_expected = []
- endif
-
- multi_check = c.get_supported_function_attributes(attributes)
- assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)')
- multi_check = cpp.get_supported_function_attributes(attributes)
- assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)')
-endif
diff --git a/test cases/common/198 function attributes/meson_options.txt b/test cases/common/198 function attributes/meson_options.txt
deleted file mode 100644
index 4a1d87ce7..000000000
--- a/test cases/common/198 function attributes/meson_options.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-option(
- 'mode',
- type : 'combo',
- choices : ['single', 'parallel'],
- value : 'single',
- description : 'Test the one at a time function or many at a time function.'
-)
diff --git a/test cases/common/198 function attributes/test.json b/test cases/common/198 function attributes/test.json
deleted file mode 100644
index d06a24a00..000000000
--- a/test cases/common/198 function attributes/test.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "matrix": {
- "options": {
- "mode": [
- { "val": "single" },
- { "val": "parallel" }
- ]
- }
- }
-}