[libc] Switch to using the generic `<gpuintrin.h>` implementations (#121810)
[llvm-project.git] / compiler-rt / test / BlocksRuntime / rettypepromotion.c
blob1fc6b9c8bf47d5dfe20b81d5182d027fae6c1617
1 //
2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 /*
7 * rettypepromotion.c
8 * testObjects
10 * Created by Blaine Garst on 11/3/08.
14 // CONFIG error:
15 // C++ and C give different errors so we don't check for an exact match.
16 // The error is that enum's are defined to be ints, always, even if defined with explicit long values
19 #include <stdio.h>
20 #include <stdlib.h>
22 enum { LESS = -1, EQUAL, GREATER };
24 void sortWithBlock(long (^comp)(void *arg1, void *arg2)) {
27 int main(int argc, char *argv[]) {
28 sortWithBlock(^(void *arg1, void *arg2) {
29 if (random()) return LESS;
30 if (random()) return EQUAL;
31 if (random()) return GREATER;
32 });
33 printf("%s: Success\n", argv[0]);
34 return 0;