summaryrefslogtreecommitdiff
path: root/test/CFrontend
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-02-27 18:19:26 +0000
committerChris Lattner <sabre@nondot.org>2005-02-27 18:19:26 +0000
commit9e2888609cbee2b693f5b54809d558981006b462 (patch)
treeb95344554b2f0cd12ac72ab38cd3364752101a6f /test/CFrontend
parenteebaf33b5d617981f1c4cffd9b6422e76dce982e (diff)
downloadllvm-9e2888609cbee2b693f5b54809d558981006b462.tar.gz
llvm-9e2888609cbee2b693f5b54809d558981006b462.tar.bz2
llvm-9e2888609cbee2b693f5b54809d558981006b462.tar.xz
Test that a global is marked constant when it can be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CFrontend')
-rw-r--r--test/CFrontend/2005-02-27-MarkGlobalConstant.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/CFrontend/2005-02-27-MarkGlobalConstant.c b/test/CFrontend/2005-02-27-MarkGlobalConstant.c
new file mode 100644
index 0000000000..bf3130bbee
--- /dev/null
+++ b/test/CFrontend/2005-02-27-MarkGlobalConstant.c
@@ -0,0 +1,10 @@
+// RUN: %llvmgcc -xc %s -S -o - | grep 'ctor_.* constant '
+
+// The synthetic global made by the CFE for big initializer should be marked
+// constant.
+
+void bar();
+void foo() {
+ char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
+ bar(Blah);
+}