summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commitf23b6fa41fb28f632249ef65754b22116f86f59f (patch)
tree2042fb46e0ceb0450614dc8d0f8c1b908acb07a1 /clang/test
parentf767e44ed6196d43f4a0094df8e778d20dff8497 (diff)
downloadbcm5719-llvm-f23b6fa41fb28f632249ef65754b22116f86f59f.tar.gz
bcm5719-llvm-f23b6fa41fb28f632249ef65754b22116f86f59f.zip
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. llvm-svn: 51259
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/string-init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGen/string-init.c b/clang/test/CodeGen/string-init.c
new file mode 100644
index 00000000000..1d1a740faac
--- /dev/null
+++ b/clang/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" };
+}
+
OpenPOWER on IntegriCloud