lsym_offsetof.c revision 1.4
11.4Srillig/* $NetBSD: lsym_offsetof.c,v 1.4 2022/04/24 08:52:44 rillig Exp $ */
21.1Srillig
31.1Srillig/*
41.1Srillig * Tests for the token lsym_offsetof, which represents the keyword 'offsetof'
51.1Srillig * that starts an expression for computing the offset of a member in a struct.
61.1Srillig */
71.1Srillig
81.1Srillig#indent input
91.2Srilligsize_t		offset = offsetof(struct s, member);
101.1Srillig#indent end
111.1Srillig
121.1Srillig#indent run-equals-input
131.4Srillig
141.2Srillig#indent run-equals-input -bs
151.2Srillig
161.2Srillig/*
171.2Srillig * The option '-pcs' forces a blank after the function name.  That option
181.2Srillig * applies to 'offsetof' as well, even though it is not really a function.
191.2Srillig */
201.2Srillig#indent run -pcs
211.2Srilligsize_t		offset = offsetof (struct s, member);
221.2Srillig#indent end
23