aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2020-11-17 14:28:52 -0800
committerErich Keane <erich.keane@intel.com>2020-11-17 14:28:52 -0800
commita72f11ee20fec2df5611c49ec5ec2ce32ab8eb4c (patch)
treecc5ac1911da45b386fd10da1e235024317759401
parentb2613fb2f0f53691dd0211895afbb9413457fca7 (diff)
downloadllvm-a72f11ee20fec2df5611c49ec5ec2ce32ab8eb4c.zip
llvm-a72f11ee20fec2df5611c49ec5ec2ce32ab8eb4c.tar.gz
llvm-a72f11ee20fec2df5611c49ec5ec2ce32ab8eb4c.tar.bz2
Fix a pair of tests that would fail on a win32 box
The tests don't specify a triple in some cases, since they shouldn't be necessary, so I've updated the tests to detect via macro when they are running on win32 to give the slightly altered diagnostic.
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp13
-rw-r--r--clang/test/SemaOpenCLCXX/address-space-lambda.cl25
2 files changed, 28 insertions, 10 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
index 5d3c63f..3e28288 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify=expected,nowin32
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify=expected,win32 -triple i386-windows
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify -triple i386-windows
void defargs() {
auto l1 = [](int i, int j = 17, int k = 18) { return i + j + k; };
@@ -44,9 +44,12 @@ template void defargs_in_template_unused(NoDefaultCtor); // expected-note{{in i
template<typename T>
void defargs_in_template_used() {
auto l1 = [](const T& value = T()) { }; // expected-error{{no matching constructor for initialization of 'NoDefaultCtor'}} \
- // expected-note{{candidate function not viable: requires single argument 'value', but no arguments were provided}} \
- // nowin32-note{{conversion candidate of type 'void (*)(const NoDefaultCtor &)'}}\
- // win32-note{{conversion candidate of type 'void (*)(const NoDefaultCtor &) __attribute__((thiscall))'}}
+ // expected-note{{candidate function not viable: requires single argument 'value', but no arguments were provided}}
+#if defined(_WIN32) && !defined(_WIN64)
+ // expected-note@46{{conversion candidate of type 'void (*)(const NoDefaultCtor &) __attribute__((thiscall))'}}
+#else
+ // expected-note@46{{conversion candidate of type 'void (*)(const NoDefaultCtor &)'}}
+#endif
l1(); // expected-error{{no matching function for call to object of type '(lambda at }}
}
diff --git a/clang/test/SemaOpenCLCXX/address-space-lambda.cl b/clang/test/SemaOpenCLCXX/address-space-lambda.cl
index c9e1ec3..571ea90 100644
--- a/clang/test/SemaOpenCLCXX/address-space-lambda.cl
+++ b/clang/test/SemaOpenCLCXX/address-space-lambda.cl
@@ -1,5 +1,5 @@
-//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify=expected,nowin32 | FileCheck %s
-//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify=expected,win32 -triple i386-windows | FileCheck %s
+//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s
+//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify -triple i386-windows | FileCheck %s
//CHECK: CXXMethodDecl {{.*}} constexpr operator() 'int (__private int){{.*}} const __generic'
auto glambda = [](auto a) { return a; };
@@ -32,12 +32,27 @@ __kernel void test_qual() {
//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __generic'
auto priv2 = []() __generic {};
priv2();
- auto priv3 = []() __global {}; //expected-note{{candidate function not viable: 'this' object is in address space '__private', but method expects object in address space '__global'}} //nowin32-note{{conversion candidate of type 'void (*)()'}}//win32-note{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+ auto priv3 = []() __global {}; //expected-note{{candidate function not viable: 'this' object is in address space '__private', but method expects object in address space '__global'}}
+#if defined(_WIN32) && !defined(_WIN64)
+ //expected-note@35{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+#else
+ //expected-note@35{{conversion candidate of type 'void (*)()'}}
+#endif
priv3(); //expected-error{{no matching function for call to object of type}}
- __constant auto const1 = []() __private{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__private'}} //nowin32-note{{conversion candidate of type 'void (*)()'}} //win32-note{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+ __constant auto const1 = []() __private{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__private'}}
+#if defined(_WIN32) && !defined(_WIN64)
+ //expected-note@43{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+#else
+ //expected-note@43{{conversion candidate of type 'void (*)()'}}
+#endif
const1(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
- __constant auto const2 = []() __generic{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__generic'}} //nowin32-note{{conversion candidate of type 'void (*)()'}} //win32-note{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+ __constant auto const2 = []() __generic{}; //expected-note{{candidate function not viable: 'this' object is in address space '__constant', but method expects object in address space '__generic'}}
+#if defined(_WIN32) && !defined(_WIN64)
+ //expected-note@50{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
+#else
+ //expected-note@50{{conversion candidate of type 'void (*)()'}}
+#endif
const2(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __constant'
__constant auto const3 = []() __constant{};