From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenCXX/static-mutable.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 clang/test/CodeGenCXX/static-mutable.cpp (limited to 'clang/test/CodeGenCXX/static-mutable.cpp') diff --git a/clang/test/CodeGenCXX/static-mutable.cpp b/clang/test/CodeGenCXX/static-mutable.cpp new file mode 100644 index 0000000..6d51f24 --- /dev/null +++ b/clang/test/CodeGenCXX/static-mutable.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 %s -triple=i686-linux-gnu -emit-llvm -o - | FileCheck %s + +struct S { + mutable int n; +}; +int f() { + // The purpose of this test is to ensure that this variable is a global + // not a constant. + // CHECK: @_ZZ1fvE1s = internal global {{.*}} { i32 12 } + static const S s = { 12 }; + return ++s.n; +} -- cgit v1.2.3