summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/attr-target-unsupported.c
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2018-02-20 18:44:50 +0000
committerErich Keane <erich.keane@intel.com>2018-02-20 18:44:50 +0000
commit5e5baf59ddc9aecef000350f3207bb686509af01 (patch)
treee5d7e4a676b0e6c7dc24359725916445175c161f /clang/test/Sema/attr-target-unsupported.c
parent2cf3769a7e7fa5aba6a43f3a91f121d6d447762b (diff)
downloadbcm5719-llvm-5e5baf59ddc9aecef000350f3207bb686509af01.tar.gz
bcm5719-llvm-5e5baf59ddc9aecef000350f3207bb686509af01.zip
Correct multiversion unsupported target behavior, add a test.
Multiversioning SEMA failed to set the declaration as invalid on unsupported targets. This patch does that. Additionally, I noticed that there is no test to validate this error message. This patch adds one, and uses 'mips' as the test architecture. llvm-svn: 325610
Diffstat (limited to 'clang/test/Sema/attr-target-unsupported.c')
-rw-r--r--clang/test/Sema/attr-target-unsupported.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Sema/attr-target-unsupported.c b/clang/test/Sema/attr-target-unsupported.c
new file mode 100644
index 00000000000..8e23fcc17eb
--- /dev/null
+++ b/clang/test/Sema/attr-target-unsupported.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple mips-linux-gnu -fsyntax-only -verify %s
+
+void __attribute__((target("arch=mips1")))
+foo(void) {}
+// expected-error@+3 {{function multiversioning is not supported on the current target}}
+// expected-note@-2 {{previous declaration is here}}
+void __attribute__((target("arch=mips2")))
+foo(void) {}
+
+// expected-error@+2 {{function multiversioning is not supported on the current target}}
+void __attribute__((target("default")))
+bar(void){}
OpenPOWER on IntegriCloud