Skip to content

Commit a72f11e

Browse files
author
Erich Keane
committed
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.
1 parent b2613fb commit a72f11e

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

clang/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify=expected,nowin32
2-
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify=expected,win32 -triple i386-windows
1+
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
2+
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify -triple i386-windows
33

44
void defargs() {
55
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
4444
template<typename T>
4545
void defargs_in_template_used() {
4646
auto l1 = [](const T& value = T()) { }; // expected-error{{no matching constructor for initialization of 'NoDefaultCtor'}} \
47-
// expected-note{{candidate function not viable: requires single argument 'value', but no arguments were provided}} \
48-
// nowin32-note{{conversion candidate of type 'void (*)(const NoDefaultCtor &)'}}\
49-
// win32-note{{conversion candidate of type 'void (*)(const NoDefaultCtor &) __attribute__((thiscall))'}}
47+
// expected-note{{candidate function not viable: requires single argument 'value', but no arguments were provided}}
48+
#if defined(_WIN32) && !defined(_WIN64)
49+
// expected-note@46{{conversion candidate of type 'void (*)(const NoDefaultCtor &) __attribute__((thiscall))'}}
50+
#else
51+
// expected-note@46{{conversion candidate of type 'void (*)(const NoDefaultCtor &)'}}
52+
#endif
5053
l1(); // expected-error{{no matching function for call to object of type '(lambda at }}
5154
}
5255

clang/test/SemaOpenCLCXX/address-space-lambda.cl

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify=expected,nowin32 | FileCheck %s
2-
//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify=expected,win32 -triple i386-windows | FileCheck %s
1+
//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s
2+
//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify -triple i386-windows | FileCheck %s
33

44
//CHECK: CXXMethodDecl {{.*}} constexpr operator() 'int (__private int){{.*}} const __generic'
55
auto glambda = [](auto a) { return a; };
@@ -32,12 +32,27 @@ __kernel void test_qual() {
3232
//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __generic'
3333
auto priv2 = []() __generic {};
3434
priv2();
35-
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))'}}
35+
auto priv3 = []() __global {}; //expected-note{{candidate function not viable: 'this' object is in address space '__private', but method expects object in address space '__global'}}
36+
#if defined(_WIN32) && !defined(_WIN64)
37+
//expected-note@35{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
38+
#else
39+
//expected-note@35{{conversion candidate of type 'void (*)()'}}
40+
#endif
3641
priv3(); //expected-error{{no matching function for call to object of type}}
3742

38-
__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))'}}
43+
__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'}}
44+
#if defined(_WIN32) && !defined(_WIN64)
45+
//expected-note@43{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
46+
#else
47+
//expected-note@43{{conversion candidate of type 'void (*)()'}}
48+
#endif
3949
const1(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
40-
__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))'}}
50+
__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'}}
51+
#if defined(_WIN32) && !defined(_WIN64)
52+
//expected-note@50{{conversion candidate of type 'void (*)() __attribute__((thiscall))'}}
53+
#else
54+
//expected-note@50{{conversion candidate of type 'void (*)()'}}
55+
#endif
4156
const2(); //expected-error{{no matching function for call to object of type '__constant (lambda at}}
4257
//CHECK: |-CXXMethodDecl {{.*}} constexpr operator() 'void () {{.*}}const __constant'
4358
__constant auto const3 = []() __constant{};

0 commit comments

Comments
 (0)