29 lines · c
1// RUN: %clang_cfi -lm -o %t1 %s2// RUN: %t1 c 1 2>&1 | FileCheck --check-prefix=CFI %s3// RUN: %t1 s 2 2>&1 | FileCheck --check-prefix=CFI %s4 5// This test uses jump tables containing PC-relative references to external6// 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: darwin9 10#include <stdlib.h>11#include <stdio.h>12#include <math.h>13 14int main(int argc, char **argv) {15 // CFI: 116 fprintf(stderr, "1\n");17 18 double (*fn)(double);19 if (argv[1][0] == 's')20 fn = sin;21 else22 fn = cos;23 24 fn(atof(argv[2]));25 26 // CFI: 227 fprintf(stderr, "2\n");28}29