1
1
// RUN: rm -rf %t && mkdir -p %t && %S/../../utils/gyb %s -o %t/main.swift
2
2
// RUN: %S/../../utils/line-directive %t/main.swift -- %target-build-swift -parse -Xfrontend -verify %t/main.swift
3
3
4
- % from SwiftIntTypes import all_numeric_type_names, all_integer_type_names, \
5
- % all_integer_binary_operator_names, all_integer_or_real_binary_operator_names, \
4
+ % from SwiftIntTypes import all_numeric_type_names, numeric_type_names_Macintosh_only, \
5
+ % all_integer_type_names, all_integer_binary_operator_names, all_integer_or_real_binary_operator_names, \
6
6
% all_arithmetic_comparison_operator_names, all_integer_assignment_operator_names, \
7
7
% all_integer_or_real_assignment_operator_names
8
8
9
9
% int_ops = all_integer_binary_operator_names() + all_integer_assignment_operator_names()
10
10
% arith_ops = all_integer_or_real_binary_operator_names() + \
11
11
% all_arithmetic_comparison_operator_names() + all_integer_or_real_assignment_operator_names()
12
12
13
- //TODO: Better error regex, verify the type of the result, Float80 for i386 & x86_64
13
+ //TODO: Verify the type of the result
14
14
15
15
func testIteratedOperations() {
16
16
% for typesToTest, operatorsToTest in zip([all_integer_type_names(), all_numeric_type_names()], \
@@ -20,13 +20,17 @@ func testIteratedOperations() {
20
20
// typesToTest: ${typesToTest}, operatorsToTest: ${operatorsToTest}
21
21
% for T1 in typesToTest:
22
22
% for T2 in typesToTest:
23
+ ${ "\n\n#if arch(i386) || arch(x86_64)\n" if T1 in numeric_type_names_Macintosh_only()
24
+ or T2 in numeric_type_names_Macintosh_only() else "" }
23
25
% for op in operatorsToTest:
24
26
if true {
25
27
var x1_${T1}: ${T1} = 0
26
28
var x2_${T2}: ${T2} = 0
27
29
x1_${T1} ${op} x2_${T2} ${ "// expected-error{{ }}" if T1 != T2 else "" }
28
30
}
29
31
%end
32
+ ${ "\n#endif //arch(i386) || arch(x86_64)\n\n" if T1 in numeric_type_names_Macintosh_only()
33
+ or T2 in numeric_type_names_Macintosh_only() else "" }
30
34
%end
31
35
%end
32
36
%end
0 commit comments