aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/global-init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/global-init.cpp')
-rw-r--r--test/CodeGenCXX/global-init.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/test/CodeGenCXX/global-init.cpp b/test/CodeGenCXX/global-init.cpp
index 9bd7390d07..fd8734c5fa 100644
--- a/test/CodeGenCXX/global-init.cpp
+++ b/test/CodeGenCXX/global-init.cpp
@@ -70,6 +70,20 @@ namespace test3 {
const char *test() { return var; }
}
+namespace test6 {
+ struct A {
+ A();
+ };
+ extern int foo();
+
+ // This needs an initialization function and guard variables.
+ // CHECK: load i8* bitcast (i64* @_ZGVN5test61xE
+ // CHECK: [[CALL:%.*]] = call i32 @_ZN5test63fooEv
+ // CHECK-NEXT: store i32 [[CALL]], i32* @_ZN5test61xE
+ // CHECK-NEXT: store i64 1, i64* @_ZGVN5test61xE
+ __attribute__((weak)) int x = foo();
+}
+
namespace PR5974 {
struct A { int a; };
struct B { int b; };
@@ -97,15 +111,6 @@ namespace test5 {
};
}
-namespace test6 {
- struct A {
- A();
- };
- extern int foo();
-
- // This needs an initialization function but not guard variables.
- __attribute__((weak)) int x = foo();
-}
// At the end of the file, we check that y is initialized before z.