aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/string-init.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-19 17:51:16 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-19 17:51:16 +0000
commit922696f03ec9637449e2cba260493808b4977cd3 (patch)
tree5428ff69752d31a3722d384d71e3d590cf341577 /test/CodeGen/string-init.c
parentd72d16e6f105deb6fe890225a6251dd0e9001ce7 (diff)
Fix the emission of expressions like char a[10] = "asdf"; previously,
they were causing bad code to be emitted. There are two fixes here: one makes sure we emit a string that is long enough, and one makes sure we properly handle string initialization in init lists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/string-init.c')
-rw-r--r--test/CodeGen/string-init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/string-init.c b/test/CodeGen/string-init.c
new file mode 100644
index 0000000000..1d1a740faa
--- /dev/null
+++ b/test/CodeGen/string-init.c
@@ -0,0 +1,8 @@
+// RUN: clang -emit-llvm %s -o - | not grep "[5 x i8]"
+// RUN: clang -emit-llvm %s -o - | not grep "store"
+
+void test(void) {
+ char a[10] = "asdf";
+ char b[10] = { "asdf" };
+}
+