|
1 |
| -// Global variables of intergal types |
2 |
| -// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-implicit-function-declaration -fclangir -emit-cir -o %t.cir %s |
3 |
| -// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
4 |
| -// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-implicit-function-declaration -fclangir -emit-llvm -o %t.ll %s |
5 |
| -// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
6 |
| - |
7 |
| -void test_mm_clflush(const void* tmp_vCp) { |
8 |
| - // CIR-LABEL: test_mm_clflush |
9 |
| - // LLVM-LABEL: test_mm_clflush |
10 |
| - _mm_clflush(tmp_vCp); |
11 |
| - // CIR: {{%.*}} = cir.llvm.intrinsic "x86.sse2.clflush" {{%.*}} : (!cir.ptr<!void>) -> !void |
12 |
| - // LLVM: call void @llvm.x86.sse2.clflush(ptr {{%.*}}) |
13 |
| -} |
| 1 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-implicit-function-declaration -fclangir -emit-cir -o %t.cir %s |
| 2 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 3 | +// RUN: %clang_cc1 -triple x86_64-unknown-linux -Wno-implicit-function-declaration -fclangir -emit-llvm -o %t.ll %s |
| 4 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 5 | + |
| 6 | +// This test mimics clang/test/CodeGen/builtins-x86.c, which eventually |
| 7 | +// CIR shall be able to support fully. |
| 8 | + |
| 9 | +void test_mm_clflush(const void* tmp_vCp) { |
| 10 | + // CIR-LABEL: test_mm_clflush |
| 11 | + // LLVM-LABEL: test_mm_clflush |
| 12 | + _mm_clflush(tmp_vCp); |
| 13 | + // CIR: {{%.*}} = cir.llvm.intrinsic "x86.sse2.clflush" {{%.*}} : (!cir.ptr<!void>) -> !void |
| 14 | + // LLVM: call void @llvm.x86.sse2.clflush(ptr {{%.*}}) |
| 15 | +} |
| 16 | + |
| 17 | +void test_mm_lfence() { |
| 18 | + // CIR-LABEL: test_mm_lfence |
| 19 | + // LLVM-LABEL: test_mm_lfence |
| 20 | + _mm_lfence(); |
| 21 | + // CIR: {{%.*}} = cir.llvm.intrinsic "x86.sse2.lfence" : () -> !void |
| 22 | + // LLVM: call void @llvm.x86.sse2.lfence() |
| 23 | +} |
0 commit comments