From 1f0efa227050781b3a905643398f07fb959ff02c Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 20 Mar 2007 14:13:20 +0000 Subject: [PATCH] Test handling of structs with multiple variable-sized fields. llvm-svn: 35212 --- test/CFrontend/2007-03-06-VarSizeInStruct1.c | 8 ++++++++ test/CFrontend/2007-03-06-VarSizeInStruct2.c | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/CFrontend/2007-03-06-VarSizeInStruct1.c create mode 100644 test/CFrontend/2007-03-06-VarSizeInStruct2.c diff --git a/test/CFrontend/2007-03-06-VarSizeInStruct1.c b/test/CFrontend/2007-03-06-VarSizeInStruct1.c new file mode 100644 index 00000000000..8d28a1dbd58 --- /dev/null +++ b/test/CFrontend/2007-03-06-VarSizeInStruct1.c @@ -0,0 +1,8 @@ +// RUN: %llvmgcc %s -S -o - +void* p (int n) { + struct f { + char w; char x[n]; char z[]; + } F; + F.x[0]='x'; + return &F; +} diff --git a/test/CFrontend/2007-03-06-VarSizeInStruct2.c b/test/CFrontend/2007-03-06-VarSizeInStruct2.c new file mode 100644 index 00000000000..13bc3aaf9ae --- /dev/null +++ b/test/CFrontend/2007-03-06-VarSizeInStruct2.c @@ -0,0 +1,8 @@ +// RUN: %llvmgcc %s -S -o - +char p (int n) { + struct f { + char w; char x[n]; char y[n]; + } F; + + return F.x[0]; +}