summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/const-init.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-20 20:55:45 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-20 20:55:45 +0000
commitcf4ab0891ddaf8deb03a4b5aeb57b36e05312d39 (patch)
tree5bee0547a82b5464f8371653bbba11e25c5b1130 /clang/test/CodeGen/const-init.c
parentc40c9851b10eb7bc0746f12a794c05bd3e63e33b (diff)
downloadbcm5719-llvm-cf4ab0891ddaf8deb03a4b5aeb57b36e05312d39.tar.gz
bcm5719-llvm-cf4ab0891ddaf8deb03a4b5aeb57b36e05312d39.zip
Fix InitListExpr::isStringLiteralInit so it handles various edge cases correctly. PR13643.
llvm-svn: 162226
Diffstat (limited to 'clang/test/CodeGen/const-init.c')
-rw-r--r--clang/test/CodeGen/const-init.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/const-init.c b/clang/test/CodeGen/const-init.c
index 4f3f7ab5533..5f729b8df42 100644
--- a/clang/test/CodeGen/const-init.c
+++ b/clang/test/CodeGen/const-init.c
@@ -144,3 +144,18 @@ void g28() {
static v12i16 b = (v2f80){1,2};
static v2f80 c = (v12i16){0,0,0,-32768,16383,0,0,0,0,-32768,16384,0};
}
+
+// PR13643
+void g29() {
+ typedef char DCC_PASSWD[2];
+ typedef struct
+ {
+ DCC_PASSWD passwd;
+ } DCC_SRVR_NM;
+ // CHECK: @g29.a = internal global %struct.DCC_SRVR_NM { [2 x i8] c"@\00" }, align 1
+ // CHECK: @g29.b = internal global [1 x i32] [i32 ptrtoint ([5 x i8]* @.str to i32)], align 4
+ // CHECK: @g29.c = internal global [1 x i32] [i32 97], align 4
+ static DCC_SRVR_NM a = { {"@"} };
+ static int b[1] = { "asdf" };
+ static int c[1] = { L"a" };
+}
OpenPOWER on IntegriCloud