From 3aa67cd53771a12dc4af87338fec1451fff71839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 17 Jan 2010 08:43:10 +0100 Subject: [PATCH] Added TODO test for better pointer aliasing with memset --- test/testsimplifytokens.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 4fc434ffb..850f4b03e 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -2780,6 +2780,18 @@ private: ASSERT_EQUALS(expected, tok(code)); } + + { + const char code[] = "int a[10];\n" + "int *b = a;\n" + "memset(b,0,sizeof(a));"; + + const char expected[] = "int a [ 10 ] ; " + "int * b ; b = a ; " + "memset ( a , 0 , 40 ) ;"; + + TODO_ASSERT_EQUALS(expected, tok(code)); + } }