aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/global-blocks-win32.c18
-rw-r--r--test/SemaCXX/constructor.cpp11
-rw-r--r--test/lit.cfg.py2
3 files changed, 30 insertions, 1 deletions
diff --git a/test/CodeGen/global-blocks-win32.c b/test/CodeGen/global-blocks-win32.c
new file mode 100644
index 000000000000..7a66c924b420
--- /dev/null
+++ b/test/CodeGen/global-blocks-win32.c
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -fblocks -triple i386-pc-windows-msvc %s -emit-llvm -o - -fblocks | FileCheck %s
+
+
+int (^x)(void) = ^() { return 21; };
+
+
+// Check that the block literal is emitted with a null isa pointer
+// CHECK: @__block_literal_global = internal global { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** null,
+
+// Check that _NSConcreteGlobalBlock has the correct dllimport specifier.
+// CHECK: @_NSConcreteGlobalBlock = external dllimport global i8*
+// Check that we create an initialiser pointer in the correct section (early library initialisation).
+// CHECK: @.block_isa_init_ptr = internal constant void ()* @.block_isa_init, section ".CRT$XCLa"
+
+// Check that we emit an initialiser for it.
+// CHECK: define internal void @.block_isa_init() {
+// CHECK: store i8** @_NSConcreteGlobalBlock, i8*** getelementptr inbounds ({ i8**, i32, i32, i8*, %struct.__block_descriptor* }, { i8**, i32, i32, i8*, %struct.__block_descriptor* }* @__block_literal_global, i32 0, i32 0), align 4
+
diff --git a/test/SemaCXX/constructor.cpp b/test/SemaCXX/constructor.cpp
index 105605c6e37b..33ea49663491 100644
--- a/test/SemaCXX/constructor.cpp
+++ b/test/SemaCXX/constructor.cpp
@@ -86,3 +86,14 @@ A::S::operator int() { return 1; }
A::S::~S() {}
+namespace PR38286 {
+ // FIXME: It'd be nice to give more consistent diagnostics for these cases
+ // (but they're all failing for somewhat different reasons...).
+ template<typename> struct A;
+ template<typename T> A<T>::A() {} // expected-error {{incomplete type 'A' named in nested name specifier}}
+ /*FIXME: needed to recover properly from previous error*/;
+ template<typename> struct B;
+ template<typename T> void B<T>::f() {} // expected-error {{out-of-line definition of 'f' from class 'B<type-parameter-0-0>'}}
+ template<typename> struct C;
+ template<typename T> C<T>::~C() {} // expected-error {{no type named 'C' in 'C<type-parameter-0-0>'}}
+}
diff --git a/test/lit.cfg.py b/test/lit.cfg.py
index ad30988c1796..c962b41723e5 100644
--- a/test/lit.cfg.py
+++ b/test/lit.cfg.py
@@ -71,7 +71,7 @@ llvm_config.add_tool_substitutions(tools, tool_dirs)
config.substitutions.append(
('%hmaptool', "'%s' %s" % (config.python_executable,
- os.path.join(config.llvm_tools_dir, 'hmaptool'))))
+ os.path.join(config.clang_tools_dir, 'hmaptool'))))
# Plugins (loadable modules)
# TODO: This should be supplied by Makefile or autoconf.