Make test more lenient for custom clang version strings
[llvm-project.git] / compiler-rt / test / cfi / icall / external-call.c
blob27c447878164507c49b683e740578c43a73815ca
1 // RUN: %clang_cfi -lm -o %t1 %s
2 // RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s
3 // RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s
5 // This test uses jump tables containing PC-relative references to external
6 // symbols, which the Mach-O object writer does not currently support.
7 // The test passes on i386 Darwin and fails on x86_64, hence unsupported instead of xfail.
8 // UNSUPPORTED: darwin
10 #include <stdlib.h>
11 #include <stdio.h>
12 #include <math.h>
14 int main(int argc, char **argv) {
15 // CFI: 1
16 fprintf(stderr, "1\n");
18 double (*fn)(double);
19 if (argv[1][0] == 's')
20 fn = sin;
21 else
22 fn = cos;
24 fn(atof(argv[2]));
26 // CFI: 2
27 fprintf(stderr, "2\n");