From 8f426fa9fca022201fc0944d6c1cb2cf9918db7d Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 20 Apr 2009 03:21:44 +0000 Subject: PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type. Adapted from patch by Tim Northover. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69566 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/variable-array.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test/CodeGen/variable-array.c (limited to 'test/CodeGen/variable-array.c') diff --git a/test/CodeGen/variable-array.c b/test/CodeGen/variable-array.c new file mode 100644 index 0000000000..280539fa89 --- /dev/null +++ b/test/CodeGen/variable-array.c @@ -0,0 +1,7 @@ +// RUN: clang-cc -emit-llvm < %s | grep puts + +int a(int x) +{ + int (*y)[x]; + return sizeof(*(puts("asdf"),y)); +} -- cgit v1.2.3-18-g5258