[PATCH] D121962: [clang] [OpenMP] Extend OpenMP variant declaration tests.
Tom Honermann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 21 10:40:36 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8ff8c3ac0dd6: [clang] [OpenMP] Extend OpenMP variant declaration tests. (authored by tahonermann).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121962/new/
https://reviews.llvm.org/D121962
Files:
clang/test/OpenMP/declare_variant_messages.c
Index: clang/test/OpenMP/declare_variant_messages.c
===================================================================
--- clang/test/OpenMP/declare_variant_messages.c
+++ clang/test/OpenMP/declare_variant_messages.c
@@ -142,6 +142,30 @@
#pragma omp declare variant(diff_ret_variant) match(xxx={}) // expected-error {{variant in '#pragma omp declare variant' with type 'int (void)' is incompatible with type 'void (void)'}} expected-warning {{'xxx' is not a valid context set in a `declare variant`; set ignored}} expected-note {{context set options are: 'construct' 'device' 'implementation' 'user'}} expected-note {{the ignored set spans until here}}
void diff_ret(void);
+void incompat_attr_variant(void);
+
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((cpu_dispatch(generic))) void incompat_attr_cpu_dispatch(void); // expected-error {{'#pragma omp declare variant' is not compatible with any target-specific attributes}}
+
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((cpu_specific(generic))) void incompat_attr_cpu_specific(void); // expected-error {{'#pragma omp declare variant' is not compatible with any target-specific attributes}}
+
+// 'incompat_attr_target' is not a multiversion function until...
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((target("mmx"))) void incompat_attr_target(void); // expected-error {{'#pragma omp declare variant' is not compatible with any target-specific attributes}}
+
+// This declaration makes it one.
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((target("sse"))) void incompat_attr_target(void); // expected-error {{'#pragma omp declare variant' is not compatible with any target-specific attributes}}
+
+// 'incompat_attr_target_default' is always a multiversion function.
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((target("default"))) void incompat_attr_target_default(void); // expected-error {{'#pragma omp declare variant' is not compatible with any target-specific attributes}}
+
+// FIXME: No diagnostics are produced for use of the 'target_clones' attribute in an OMP variant declaration.
+#pragma omp declare variant(incompat_attr_variant) match(implementation={vendor(llvm)})
+__attribute__((target_clones("sse,default"))) void incompat_attr_target_clones(void);
+
void marked(void);
void not_marked(void);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121962.417021.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220321/c9cabbcc/attachment-0001.bin>
More information about the cfe-commits
mailing list