1 // FIXME: XFAIL the test because it is expected to return non-zero value.
2 // XFAIL: *
3 // REQUIRES: x86-target-arch
4 // RUN: %clang_builtins %s %librt -o %t && %run %t
5 //===-- cpu_model_test.c - Test __builtin_cpu_supports --------------------===//
6 //
7 //                     The LLVM Compiler Infrastructure
8 //
9 // This file is dual licensed under the MIT and the University of Illinois Open
10 // Source Licenses. See LICENSE.TXT for details.
11 //
12 //===----------------------------------------------------------------------===//
13 //
14 // This file tests __builtin_cpu_supports for the compiler_rt library.
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #include <stdio.h>
19 
20 int main (void) {
21 #if defined(i386) || defined(__x86_64__)
22   if(__builtin_cpu_supports("avx2"))
23     return 4;
24   else
25     return 3;
26 #else
27   printf("skipped\n");
28   return 0;
29 #endif
30 }
31