blob: c537b4140b27834551cc748df0a66b691c9f26af [file] [log] [blame]
Eric Christopherd9832702015-06-29 21:00:05 +00001// RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-linux-gnu -verify %s
2// RUN: %clang_cc1 -fsyntax-only -triple powerpc64le-linux-gnu -verify %s
3
4extern void a(const char *);
5
6extern const char *str;
7
8int main() {
9#ifdef __x86_64__
10 if (__builtin_cpu_supports("ss")) // expected-error {{invalid cpu feature string}}
11 a("sse4.2");
12
13 if (__builtin_cpu_supports(str)) // expected-error {{expression is not a string literal}}
14 a(str);
15#else
16 if (__builtin_cpu_supports("vsx")) // expected-error {{use of unknown builtin}}
17 a("vsx");
18#endif
19
20 return 0;
21}