Test that a global is marked constant when it can be.
authorChris Lattner <sabre@nondot.org>
Sun, 27 Feb 2005 18:19:26 +0000 (18:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 27 Feb 2005 18:19:26 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20349 91177308-0d34-0410-b5e6-96231b3b80d8

test/CFrontend/2005-02-27-MarkGlobalConstant.c [new file with mode: 0644]

diff --git a/test/CFrontend/2005-02-27-MarkGlobalConstant.c b/test/CFrontend/2005-02-27-MarkGlobalConstant.c
new file mode 100644 (file)
index 0000000..bf3130b
--- /dev/null
@@ -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);
+}