]>
Commit | Line | Data |
---|---|---|
2c00a5a8 XL |
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 --------------------===// | |
5bcae85e SL |
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 | ||
2c00a5a8 | 18 | #include <stdio.h> |
7cac9316 | 19 | |
5bcae85e | 20 | int main (void) { |
2c00a5a8 | 21 | #if defined(i386) || defined(__x86_64__) |
5bcae85e SL |
22 | if(__builtin_cpu_supports("avx2")) |
23 | return 4; | |
24 | else | |
25 | return 3; | |
2c00a5a8 XL |
26 | #else |
27 | printf("skipped\n"); | |
28 | return 0; | |
29 | #endif | |
5bcae85e | 30 | } |