From patchwork Sat May 18 17:52:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=2E_Neusch=C3=A4fer?= X-Patchwork-Id: 2589131 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 31BB03FD85 for ; Sat, 18 May 2013 17:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179Ab3ERRwq (ORCPT ); Sat, 18 May 2013 13:52:46 -0400 Received: from mout.gmx.net ([212.227.15.18]:64688 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718Ab3ERRwq (ORCPT ); Sat, 18 May 2013 13:52:46 -0400 Received: from mailout-de.gmx.net ([10.1.76.10]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0M3PXK-1UM5rp0Qoy-00r1wY for ; Sat, 18 May 2013 19:52:45 +0200 Received: (qmail invoked by alias); 18 May 2013 17:52:44 -0000 Received: from dslb-084-060-248-207.pools.arcor-ip.net (EHLO debian.debian) [84.60.248.207] by mail.gmx.net (mp010) with SMTP; 18 May 2013 19:52:44 +0200 X-Authenticated: #41721828 X-Provags-ID: V01U2FsdGVkX198lu9puyl8fvKy6l2pnisNTBovKfpr3Gr+8cEJqJ IIveLA2OzXE4Xr From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= To: linux-sparse@vger.kernel.org Cc: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Pekka Enberg , Christopher Li , Jeff Garzik , Linus Torvalds , Xi Wang Subject: [PATCH 4/4] sparse, llvm: add a struct access test case Date: Sat, 18 May 2013 19:52:07 +0200 Message-Id: <1368899527-2350-4-git-send-email-j.neuschaefer@gmx.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368899527-2350-1-git-send-email-j.neuschaefer@gmx.net> References: <1368899527-2350-1-git-send-email-j.neuschaefer@gmx.net> MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Cc: Pekka Enberg Cc: Christopher Li Cc: Jeff Garzik Cc: Linus Torvalds Cc: Xi Wang Signed-off-by: Jonathan Neuschäfer --- validation/backend/struct-access.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 validation/backend/struct-access.c diff --git a/validation/backend/struct-access.c b/validation/backend/struct-access.c new file mode 100644 index 0000000..884b470 --- /dev/null +++ b/validation/backend/struct-access.c @@ -0,0 +1,28 @@ +struct st { + int i, *d; +}; + +static int load_i(struct st *st) +{ + return st->i; +} + +static void store_i(struct st *st, int i) +{ + st->i = i; +} + +static int *load_d(struct st *st) +{ + return st->d; +} + +static void store_d(struct st *st, int *d) +{ + st->d = d; +} + +/* + * check-name: struct access code generation + * check-command: ./sparsec -c $file -o tmp.o + */