blob: 24aae9542dbc4274197d955172ad85b58713aaeb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// RUN: %clang_cc1 -fsyntax-only -triple aarch64-linux-gnu -verify %s
int test_aarch64_features(void) {
char * ssbs2;
// expected-error@+1 {{expression is not a string literal}}
if (__builtin_cpu_supports(ssbs2))
return 1;
// expected-error@+1 {{invalid cpu feature string}}
if (__builtin_cpu_supports(""))
return 2;
// expected-error@+1 {{invalid cpu feature string}}
if (__builtin_cpu_supports("pmull128"))
return 3;
// expected-error@+1 {{invalid cpu feature string}}
if (__builtin_cpu_supports("sve2,rpres"))
return 4;
// expected-error@+1 {{invalid cpu feature string}}
if (__builtin_cpu_supports("dgh+sve2-pmull"))
return 5;
// expected-error@+1 {{invalid cpu feature string}}
if (__builtin_cpu_supports("default"))
return 6;
if (__builtin_cpu_supports(" ssbs + bti "))
return 7;
return 0;
}
|