blob: baff4ddfc1bada5aaed22f9b83265177d30e6764 [file] [log] [blame]
Daniel Dunbar31fe9c32008-08-13 23:20:05 +00001// RUN: clang -emit-llvm -o %t %s &&
2// 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
5
6/* Should be 3 hello string, two global (of different sizes), the rest
7 are shared. */
8
9void f0() {
10 bar("hello");
11}
12
13void f1() {
14 static char *x = "hello";
15 bar(x);
16}
17
18void f2() {
19 static char x[] = "hello";
20 bar(x);
21}
22
23void f3() {
24 static char x[8] = "hello";
25 bar(x);
26}
27
28void f4() {
29 static struct s {
30 char *name;
31 } x = { "hello" };
32 gaz(&x);
33}
34