xref: /netbsd-src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements2.c (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 /*	$NetBSD: d_gcc_compound_statements2.c,v 1.3 2021/04/23 20:13:29 rillig Exp $	*/
2 # 3 "d_gcc_compound_statements2.c"
3 
4 /* GCC compound statements with non-expressions */
5 struct cpu_info {
6 	int bar;
7 };
8 
9 int
10 compound_expression_with_decl_and_stmt(void)
11 {
12 	return ({
13 	    struct cpu_info *ci;
14 	    __asm__ volatile("movl %%fs:4,%0":"=r" (ci));
15 	    ci;
16 	})->bar;
17 }
18 
19 int
20 compound_expression_with_only_stmt(void)
21 {
22 	struct cpu_info ci = { 0 };
23 	return ({
24 	    if (ci.bar > 0)
25 	    	ci.bar++;
26 	    ci;
27 	}).bar;
28 }
29