summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-target-mv.cpp
diff options
context:
space:
mode:
authorGeorge Burgess IV <george.burgess.iv@gmail.com>2018-01-16 03:01:50 +0000
committerGeorge Burgess IV <george.burgess.iv@gmail.com>2018-01-16 03:01:50 +0000
commitd74b6a8f64fc88cb33eeecc60d7bf30b31f17fa3 (patch)
tree4d75340b21261357897f8c3ac2241924add1c89e /clang/test/SemaCXX/attr-target-mv.cpp
parentd57c03ddca1cc2d8ceb8c299f58e70f97a60102c (diff)
downloadbcm5719-llvm-d74b6a8f64fc88cb33eeecc60d7bf30b31f17fa3.tar.gz
bcm5719-llvm-d74b6a8f64fc88cb33eeecc60d7bf30b31f17fa3.zip
[Sema] Fix a crash on invalid features in multiversioning
We were trying to emit a diag::err_bad_multiversion_option diagnostic, which expects an int as its first argument, with a string argument. As it happens, the string `Feature` that was causing this was shadowing an int `Feature` from the surrounding scope. :) llvm-svn: 322530
Diffstat (limited to 'clang/test/SemaCXX/attr-target-mv.cpp')
-rw-r--r--clang/test/SemaCXX/attr-target-mv.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-target-mv.cpp b/clang/test/SemaCXX/attr-target-mv.cpp
index 18ec1bf7ca5..cc2d4f16c3f 100644
--- a/clang/test/SemaCXX/attr-target-mv.cpp
+++ b/clang/test/SemaCXX/attr-target-mv.cpp
@@ -1,4 +1,11 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify -fexceptions -fcxx-exceptions %s -std=c++14
+void __attribute__((target("default"))) invalid_features(void);
+//expected-error@+2 {{function multiversioning doesn't support feature 'hello_world'}}
+//expected-warning@+1 {{ignoring unsupported 'hello_world' in the target attribute string}}
+void __attribute__((target("hello_world"))) invalid_features(void);
+//expected-error@+1 {{function multiversioning doesn't support feature 'no-sse4.2'}}
+void __attribute__((target("no-sse4.2"))) invalid_features(void);
+
void __attribute__((target("sse4.2"))) no_default(void);
void __attribute__((target("arch=sandybridge"))) no_default(void);
OpenPOWER on IntegriCloud