Files
clang-p2996/clang/test/CodeGenCXX/pragma-init_seg.cpp
Reid Kleckner d3923aaa6e -fms-extensions: Error out on #pragma init_seg
By ignoring this pragma with a warning, we're essentially miscompiling
the user's program.  WebKit / Blink use this pragma to disable dynamic
initialization and finalization of some static data, and running the
dtors crashes the program.

Error out for now, so that /fallback compiles the TU correctly with
MSVC.  This pragma should be implemented some time this month, and we
can remove this hack.

llvm-svn: 205554
2014-04-03 19:04:24 +00:00

17 lines
456 B
C++

// RUN: not %clang_cc1 %s -triple=i686-pc-win32 -fms-extensions -emit-llvm-only 2>&1 | FileCheck %s
// Reduced from WebKit.
// FIXME: Implement this pragma and test the codegen. We probably want to
// completely skip @llvm.global_ctors and just create global function pointers
// to the initializer with the right section.
// CHECK: '#pragma init_seg' not implemented
#pragma init_seg(".unwantedstaticinits")
struct A {
A();
~A();
int a;
};
A a;