diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-13 22:58:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-13 22:58:39 +0000 |
commit | e4c9238795d206e22694101d6d727d2ee1f0028d (patch) | |
tree | cd627522716af5a55ae6b919bb08151be3f44ba7 /test/CodeGen/init.c | |
parent | 7ab41f790c17258deaed7378217550b4d7d707d8 (diff) |
Set constant bit on static block vars as well. Patch by Anders Johnson!q
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/init.c')
-rw-r--r-- | test/CodeGen/init.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/CodeGen/init.c b/test/CodeGen/init.c index fa39ba6f5a..b53b81edb8 100644 --- a/test/CodeGen/init.c +++ b/test/CodeGen/init.c @@ -1,4 +1,5 @@ -// RUN: clang -emit-llvm %s -o - +// RUN: clang -triple i386-unknown-unknown -emit-llvm %s -o %t && + void f1() { // Scalars in braces. int a = { 1 }; @@ -20,3 +21,11 @@ void f3() { struct S a[1] = { { foo } }; } +// Constants +// RUN: grep '@g3 = constant i32 10' %t && +// RUN: grep '@f4.g4 = internal constant i32 12' %t +const int g3 = 10; +int f4() { + static const int g4 = 12; + return g4; +} |