ObjFW  Check-in [c2941ac553]

Overview
Comment:OFInvocationTests: Slightly change __int128 test
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c2941ac5530ea8f56c246efd493d7b3427fbaa58088251797f41b0f46dd08aae
User & Date: js on 2017-09-16 20:37:47
Other Links: manifest | tags
Context
2017-09-17
02:20
invoke-x86_64.m: Change __int128 handling check-in: 15eed89995 user: js tags: trunk
2017-09-16
20:37
OFInvocationTests: Slightly change __int128 test check-in: c2941ac553 user: js tags: trunk
20:20
invoke-x86_64.m: Correctly align __int128 for GCC check-in: c14dfdc8e5 user: js tags: trunk
Changes

Modified tests/OFInvocationTests.m from [23dbe050f2] to [2ee831b079].

101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
	return (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 +
	    d12 + d13 + d14 + d15 + d16) / 16;
}

#ifdef __SIZEOF_INT128__
__extension__
- (__int128)invocationTestMethod5: (__int128)i1
				 : (__int128)i2
				 : (int)i3	 /* to check alignment */
				 : (__int128)i4
				 : (__int128)i5
				 : (__int128)i6
				 : (__int128)i7
				 : (__int128)i8
				 : (__int128)i9
				 : (__int128)i10
				 : (__int128)i11
				 : (__int128)i12
				 : (__int128)i13
				 : (__int128)i14
				 : (__int128)i15
				 : (__int128)i16
{
	__int128 mask = (__int128)0xFFFFFFFFFFFFFFFF << 64;

	OF_ENSURE(i1 == mask + 1);
	OF_ENSURE(i2 == mask + 2);
	OF_ENSURE(i3 == 3);
	OF_ENSURE(i4 == mask + 4);
	OF_ENSURE(i5 == mask + 5);
	OF_ENSURE(i6 == mask + 6);
	OF_ENSURE(i7 == mask + 7);
	OF_ENSURE(i8 == mask + 8);
	OF_ENSURE(i9 == mask + 9);
	OF_ENSURE(i10 == mask + 10);
	OF_ENSURE(i11 == mask + 11);
	OF_ENSURE(i12 == mask + 12);
	OF_ENSURE(i13 == mask + 13);
	OF_ENSURE(i14 == mask + 14);
	OF_ENSURE(i15 == mask + 15);
	OF_ENSURE(i16 == mask + 16);

	return (((int)i1 + (int)i2 + (int)i3 + (int)i4 + (int)i5 + (int)i6 +
	    (int)i7 + (int)i8 + (int)i9 + (int)i10 + (int)i11 + (int)i12 +
	    (int)i13 + (int)i14 + (int)i15 + (int)i16) / 16) + mask;
}
#endif

- (void)invocationTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	SEL selector = @selector(invocationTestMethod1::::);







|

|

|














|



|












|
|
|







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
	return (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10 + d11 +
	    d12 + d13 + d14 + d15 + d16) / 16;
}

#ifdef __SIZEOF_INT128__
__extension__
- (__int128)invocationTestMethod5: (int)i1
				 : (__int128)i2
				 : (int)i3
				 : (__int128)i4
				 : (int)i5
				 : (__int128)i6
				 : (__int128)i7
				 : (__int128)i8
				 : (__int128)i9
				 : (__int128)i10
				 : (__int128)i11
				 : (__int128)i12
				 : (__int128)i13
				 : (__int128)i14
				 : (__int128)i15
				 : (__int128)i16
{
	__int128 mask = (__int128)0xFFFFFFFFFFFFFFFF << 64;

	OF_ENSURE(i1 == 1);
	OF_ENSURE(i2 == mask + 2);
	OF_ENSURE(i3 == 3);
	OF_ENSURE(i4 == mask + 4);
	OF_ENSURE(i5 == 5);
	OF_ENSURE(i6 == mask + 6);
	OF_ENSURE(i7 == mask + 7);
	OF_ENSURE(i8 == mask + 8);
	OF_ENSURE(i9 == mask + 9);
	OF_ENSURE(i10 == mask + 10);
	OF_ENSURE(i11 == mask + 11);
	OF_ENSURE(i12 == mask + 12);
	OF_ENSURE(i13 == mask + 13);
	OF_ENSURE(i14 == mask + 14);
	OF_ENSURE(i15 == mask + 15);
	OF_ENSURE(i16 == mask + 16);

	return ((i1 + (int)i2 + i3 + (int)i4 + i5 + (int)i6 + (int)i7 +
	    (int)i8 + (int)i9 + (int)i10 + (int)i11 + (int)i12 + (int)i13 +
	    (int)i14 + (int)i15 + (int)i16) / 16) + mask;
}
#endif

- (void)invocationTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	SEL selector = @selector(invocationTestMethod1::::);
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
		__extension__ __int128 i128 = 0xFFFFFFFFFFFFFFFF;
		i128 <<= 64;
		i128 |= i;

		if (i == 3)
			[invocation setArgument: &i
					atIndex: i + 1];
		else
			[invocation setArgument: &i128
					atIndex: i + 1];
	}








|







277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
			atIndex: 1];

	for (int i = 1; i <= 16; i++) {
		__extension__ __int128 i128 = 0xFFFFFFFFFFFFFFFF;
		i128 <<= 64;
		i128 |= i;

		if (i == 1 || i == 3 || i == 5)
			[invocation setArgument: &i
					atIndex: i + 1];
		else
			[invocation setArgument: &i128
					atIndex: i + 1];
	}