summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorWarren Ristow <warren.ristow@sony.com>2017-02-02 17:53:34 +0000
committerWarren Ristow <warren.ristow@sony.com>2017-02-02 17:53:34 +0000
commit8d17b4050076c9dea7b68dc0ac208de8f19d9c01 (patch)
tree8fd1acb107836947c199e2bdaa5b6c0c2c6bc6a4 /clang/test
parentfc89bbcc712550d91e018a682e9369df88e80872 (diff)
downloadbcm5719-llvm-8d17b4050076c9dea7b68dc0ac208de8f19d9c01.tar.gz
bcm5719-llvm-8d17b4050076c9dea7b68dc0ac208de8f19d9c01.zip
Prevent ICE in dllexport class with _Atomic data member
Guard against a null pointer dereference that caused Clang to crash when processing a class containing an _Atomic qualified data member, and that is tagged with 'dllexport'. Differential Revision: https://reviews.llvm.org/D29208 llvm-svn: 293911
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/atomic-dllexport.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/atomic-dllexport.cpp b/clang/test/CodeGenCXX/atomic-dllexport.cpp
new file mode 100644
index 00000000000..ae142224316
--- /dev/null
+++ b/clang/test/CodeGenCXX/atomic-dllexport.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple i686-windows-msvc -emit-llvm -std=c++11 -fms-extensions -O0 -o - %s | FileCheck --check-prefix=M32 %s
+// RUN: %clang_cc1 -triple x86_64-windows-msvc -emit-llvm -std=c++11 -fms-extensions -O0 -o - %s | FileCheck --check-prefix=M64 %s
+
+struct __declspec(dllexport) SomeStruct {
+ // Copy assignment operator should be produced, and exported:
+ // M32: define weak_odr dllexport x86_thiscallcc dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QAEAAU0@ABU0@@Z"
+ // M64: define weak_odr dllexport dereferenceable({{[0-9]+}}) %struct.SomeStruct* @"\01??4SomeStruct@@QEAAAEAU0@AEBU0@@Z"
+ _Atomic(int) mData;
+};
OpenPOWER on IntegriCloud