From cbd141fa3355696c1810bf87c0e15a407a82dc1e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 5 Oct 2004 00:18:21 +0000 Subject: [PATCH] New testcase for PR450 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16670 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../2004-10-04-ExternalGlobalConstant.cpp.tr | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/C++Frontend/2004-10-04-ExternalGlobalConstant.cpp.tr diff --git a/test/C++Frontend/2004-10-04-ExternalGlobalConstant.cpp.tr b/test/C++Frontend/2004-10-04-ExternalGlobalConstant.cpp.tr new file mode 100644 index 00000000000..48e7240ae18 --- /dev/null +++ b/test/C++Frontend/2004-10-04-ExternalGlobalConstant.cpp.tr @@ -0,0 +1,12 @@ +// RUN: %llvmgcc -xc++ -S -o - %s | grep %y | not grep constant + +struct Y { + int A; + Y(); +}; + +// This global cannot be marked 'constant' because the ctor can modify it. +extern const Y y; + +void foo(...); +int bar() { foo(&y); }