llvm-project/clang/test/CodeGenCXX/trivial-constructor-init.cpp
Richard Smith a0e5e54e8d Remove abuse of hasTrivial*, and fix miscompile wherein global arrays with
internal linkage, no uses, trivial construction, and nontrivial destruction
were not emitted.

llvm-svn: 167756
2012-11-12 21:38:00 +00:00

36 lines
461 B
C++

// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 | FileCheck %s
extern "C" int printf(...);
struct S {
S() { printf("S::S\n"); }
};
struct A {
double x;
A() : x(), y(), s() { printf("x = %f y = %x \n", x, y); }
int *y;
S s;
};
A a;
struct B {
B() = default;
B(const B&);
};
// CHECK-NOT: _ZL1b
static B b;
struct C {
~C();
};
// CHECK: _ZL1c
static C c[4];
int main() {
}