helper: add get_last_statement_from_expression_stmt() [build fix]
[smatch.git] / validation / c11-alignas.c
blob4b264a5dc2cc8635acc35703dda17106a8501f9e
1 static _Alignas(8) int v;
2 static _Alignas(long) int t;
3 static _Alignas(void *) int p;
4 static _Alignas(int[4]) int a;
5 static _Alignas(0) int z;
6 static _Alignas(3) int bnpow2;
7 static _Alignas(-1) int bneg;
8 static _Alignas(-2) int bnegpow2;
9 static _Alignas(v) int bnc;
10 static _Alignas(+) int bsyn;
12 static int check(void)
14 if (_Alignof(v) != 8)
15 return -1;
16 if (_Alignof(t) != _Alignof(long))
17 return -1;
18 if (_Alignof(p) != _Alignof(void *))
19 return -1;
20 if (_Alignof(a) != _Alignof(int))
21 return -1;
23 return 0;
27 * check-name: c11-alignas
28 * check-command: test-linearize -std=c11 $file
30 * check-error-start
31 c11-alignas.c:6:25: warning: non-power-of-2 alignment
32 c11-alignas.c:7:25: warning: non-positive alignment
33 c11-alignas.c:8:25: warning: non-positive alignment
34 c11-alignas.c:9:17: error: bad constant expression
35 c11-alignas.c:10:17: error: Syntax error in unary expression
36 * check-error-end
38 * check-output-ignore
39 * check-output-contains: ret\\.32 *\$0