diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:21:42 +0000 |
commit | 4ba675006b5a8edfc48b6a9bd3dcf54a70cc08f2 (patch) | |
tree | 48b44512b5db8ced345df4a1a56b5065cf2a14d9 /test/CodeGenCXX/references.cpp | |
parent | d7279c4c177bca357ef96ff1379fd9bc420bfe83 (diff) |
Diffstat (limited to 'test/CodeGenCXX/references.cpp')
-rw-r--r-- | test/CodeGenCXX/references.cpp | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/test/CodeGenCXX/references.cpp b/test/CodeGenCXX/references.cpp index 6fc610298bd22..d2ad980135538 100644 --- a/test/CodeGenCXX/references.cpp +++ b/test/CodeGenCXX/references.cpp @@ -150,10 +150,9 @@ void f0(s1 a) { s1 b = a; } // PR6024 // CHECK: @_Z2f2v() -// CHECK: alloca -// CHECK: store -// CHECK: load -// CHECK: ret +// CHECK: alloca i32, +// CHECK-NEXT: store +// CHECK-NEXT: ret const int &f2() { return 0; } // Don't constant fold const reference parameters with default arguments to @@ -161,7 +160,7 @@ const int &f2() { return 0; } namespace N1 { const int foo = 1; // CHECK: @_ZN2N14test - int test(const int& arg = foo) { + void test(const int& arg = foo) { // Ensure this array is on the stack where we can set values instead of // being a global constant. // CHECK: %args_array = alloca @@ -225,3 +224,37 @@ namespace N2 { i = 19; } } + +namespace N3 { + +// PR7326 + +struct A { + explicit A(int); + ~A(); +}; + +// CHECK: define internal void @__cxx_global_var_init +// CHECK: call void @_ZN2N31AC1Ei(%"class.N2::X"* @_ZGRN2N35sA123E, i32 123) +// CHECK: call i32 @__cxa_atexit +// CHECK: ret void +const A &sA123 = A(123); +} + +namespace N4 { + +struct A { + A(); + ~A(); +}; + +void f() { + // CHECK: define void @_ZN2N41fEv + // CHECK: call void @_ZN2N41AC1Ev(%"class.N2::X"* @_ZGRZN2N41fEvE2ar) + // CHECK: call i32 @__cxa_atexit + // CHECK: ret void + static const A& ar = A(); + +} +} + |