blob: 4fbeb7b87e225870d9dd124b442d4e39a55f1a62 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -emit-llvm -o %t %s
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: grep "hello" %t | count 3
3// RUN: grep 'c"hello\\00"' %t | count 2
4// RUN: grep 'c"hello\\00\\00\\00"' %t | count 1
Nuno Lopes3998d3f2008-08-13 23:28:57 +00005// RUN: grep 'c"ola"' %t | count 1
Daniel Dunbar61432932008-08-13 23:20:05 +00006
7/* Should be 3 hello string, two global (of different sizes), the rest
8 are shared. */
9
10void f0() {
11 bar("hello");
12}
13
14void f1() {
15 static char *x = "hello";
16 bar(x);
17}
18
19void f2() {
20 static char x[] = "hello";
21 bar(x);
22}
23
24void f3() {
25 static char x[8] = "hello";
26 bar(x);
27}
28
29void f4() {
30 static struct s {
31 char *name;
32 } x = { "hello" };
33 gaz(&x);
34}
35
Nuno Lopes3998d3f2008-08-13 23:28:57 +000036char x[3] = "ola";