diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp | 4 | ||||
-rw-r--r-- | test/CodeGenCUDA/llvm-used.cu | 8 | ||||
-rw-r--r-- | test/CodeGenCXX/ctor-dtor-alias.cpp | 11 | ||||
-rw-r--r-- | test/CodeGenCXX/debug-info-line.cpp | 27 | ||||
-rw-r--r-- | test/PCH/implicitly-deleted.cpp | 18 | ||||
-rw-r--r-- | test/Parser/cxx0x-lambda-expressions.cpp | 2 | ||||
-rw-r--r-- | test/Parser/objcxx0x-lambda-expressions.mm | 2 | ||||
-rw-r--r-- | test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp | 1 | ||||
-rw-r--r-- | test/SemaCXX/lambda-expressions.cpp | 9 |
9 files changed, 78 insertions, 4 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp index 6be200d..1228c74 100644 --- a/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp @@ -48,7 +48,7 @@ auto bad_init_2 = [a(1, 2)] {}; // expected-error {{initializer for lambda captu auto bad_init_3 = [&a(void_fn())] {}; // expected-error {{cannot form a reference to 'void'}} auto bad_init_4 = [a(void_fn())] {}; // expected-error {{has incomplete type 'void'}} auto bad_init_5 = [a(overload_fn)] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer of type '<overloaded function}} -auto bad_init_6 = [a{overload_fn}] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer list}} +auto bad_init_6 = [a{overload_fn}] {}; // expected-error {{cannot deduce type for lambda capture 'a' from initializer list}} expected-warning {{will change meaning in a future version of Clang}} template<typename...T> void pack_1(T...t) { (void)[a(t...)] {}; } // expected-error {{initializer missing for lambda capture 'a'}} template void pack_1<>(); // expected-note {{instantiation of}} @@ -61,7 +61,7 @@ auto a = [a(4), b = 5, &c = static_cast<const int&&>(0)] { using T = decltype(c); using T = const int &; }; -auto b = [a{0}] {}; // expected-error {{include <initializer_list>}} +auto b = [a{0}] {}; // expected-error {{include <initializer_list>}} expected-warning {{will change meaning in a future version of Clang}} struct S { S(); S(S&&); }; template<typename T> struct remove_reference { typedef T type; }; diff --git a/test/CodeGenCUDA/llvm-used.cu b/test/CodeGenCUDA/llvm-used.cu new file mode 100644 index 0000000..44666a9 --- /dev/null +++ b/test/CodeGenCUDA/llvm-used.cu @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device -triple nvptx64-unknown-unknown | FileCheck %s + + +// Make sure we emit the proper addrspacecast for llvm.used. PR22383 exposed an +// issue where we were generating a bitcast instead of an addrspacecast. + +// CHECK: @llvm.used = appending global [1 x i8*] [i8* addrspacecast (i8 addrspace(1)* bitcast ([0 x i32] addrspace(1)* @a to i8 addrspace(1)*) to i8*)], section "llvm.metadata" +__attribute__((device)) __attribute__((__used__)) int a[] = {}; diff --git a/test/CodeGenCXX/ctor-dtor-alias.cpp b/test/CodeGenCXX/ctor-dtor-alias.cpp index bd60cb8..54dfe87 100644 --- a/test/CodeGenCXX/ctor-dtor-alias.cpp +++ b/test/CodeGenCXX/ctor-dtor-alias.cpp @@ -232,3 +232,14 @@ foo::~foo() {} // CHECK6: @_ZN6test113fooD2Ev = alias {{.*}} @_ZN6test113barD2Ev // CHECK6: @_ZN6test113fooD1Ev = alias {{.*}} @_ZN6test113fooD2Ev } + +namespace test12 { +template <int> +struct foo { + ~foo() { delete this; } +}; + +template class foo<1>; +// CHECK6: @_ZN6test123fooILi1EED1Ev = weak_odr alias {{.*}} @_ZN6test123fooILi1EED2Ev +// CHECK6: define weak_odr void @_ZN6test123fooILi1EED2Ev({{.*}}) {{.*}} comdat($_ZN6test123fooILi1EED5Ev) +} diff --git a/test/CodeGenCXX/debug-info-line.cpp b/test/CodeGenCXX/debug-info-line.cpp index a5cc639..5b84711 100644 --- a/test/CodeGenCXX/debug-info-line.cpp +++ b/test/CodeGenCXX/debug-info-line.cpp @@ -166,6 +166,33 @@ void f13() { F13_IMPL; } +struct f14 { + f14(int); +}; + +// CHECK-LABEL: define +struct f14_use { +// CHECK: call {{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]] +#line 1600 + f14 v + = + 1; + f14_use(); +}; + +f14_use::f14_use() = default; + +// CHECK-LABEL: define + +// CHECK-LABEL: define +int f21_a(int = 0); +void f21_b(int = f21_a()); +void f21() { +// CHECK: call {{.*}}f21_b{{.*}}, !dbg [[DBG_F21:![0-9]*]] +#line 2300 + f21_b(); +} + // CHECK: [[DBG_F1]] = !MDLocation(line: 100, // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200, // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202, diff --git a/test/PCH/implicitly-deleted.cpp b/test/PCH/implicitly-deleted.cpp new file mode 100644 index 0000000..5238fd3 --- /dev/null +++ b/test/PCH/implicitly-deleted.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++11 -x c++-header %s -emit-pch -o %t.pch +// RUN: %clang_cc1 -std=c++11 -x c++ /dev/null -include-pch %t.pch +class move_only { move_only(const move_only&) = delete; move_only(move_only&&); }; +struct sb { + move_only il; + sb(); + sb(sb &&); +}; + +template<typename T> T make(); +template<typename T> void doit(decltype(T(make<const T&>()))*) { T(make<const T&>()); } +template<typename T> void doit(...) { T(make<T&&>()); } +template<typename T> void later() { doit<T>(0); } + +void fn1() { + sb x; + later<sb>(); +} diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp index 6f69d80..c2bf6fd 100644 --- a/test/Parser/cxx0x-lambda-expressions.cpp +++ b/test/Parser/cxx0x-lambda-expressions.cpp @@ -61,7 +61,7 @@ class C { int z; void init_capture() { [n(0)] () mutable -> int { return ++n; }; // expected-warning{{extension}} - [n{0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}} + [n{0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}} expected-warning{{will change meaning in a future version}} [n = 0] { return ++n; }; // expected-error {{captured by copy in a non-mutable}} expected-warning{{extension}} [n = {0}] { return; }; // expected-error {{<initializer_list>}} expected-warning{{extension}} [a([&b = z]{})](){}; // expected-warning 2{{extension}} diff --git a/test/Parser/objcxx0x-lambda-expressions.mm b/test/Parser/objcxx0x-lambda-expressions.mm index bef576a..3954a80 100644 --- a/test/Parser/objcxx0x-lambda-expressions.mm +++ b/test/Parser/objcxx0x-lambda-expressions.mm @@ -21,7 +21,7 @@ class C { [foo(bar)] () {}; [foo = bar] () {}; - [foo{bar}] () {}; // expected-error {{<initializer_list>}} + [foo{bar}] () {}; // expected-error {{<initializer_list>}} expected-warning {{will change meaning}} [foo = {bar}] () {}; // expected-error {{<initializer_list>}} [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}} diff --git a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp index 70f7c64..2405d2a 100644 --- a/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp +++ b/test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp @@ -117,6 +117,7 @@ void argument_deduction() { void auto_deduction() { auto l = {1, 2, 3, 4}; + auto l2 {1, 2, 3, 4}; // expected-warning {{will change meaning in a future version of Clang}} static_assert(same_type<decltype(l), std::initializer_list<int>>::value, ""); auto bl = {1, 2.0}; // expected-error {{cannot deduce}} diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp index cad322a..7911c1b 100644 --- a/test/SemaCXX/lambda-expressions.cpp +++ b/test/SemaCXX/lambda-expressions.cpp @@ -437,3 +437,12 @@ namespace error_in_transform_prototype { f(S()); // expected-note {{requested here}} } } + +namespace PR21857 { + template<typename Fn> struct fun : Fn { + fun() = default; + using Fn::operator(); + }; + template<typename Fn> fun<Fn> wrap(Fn fn); + auto x = wrap([](){}); +} |