Skip to content

Commit a665f70

Browse files
Improve tests
1 parent e481360 commit a665f70

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ class CIRGenFunction : public CIRGenTypeCache {
15301530
bool ignoreResultAssign = false);
15311531

15321532
mlir::Value emitScalarOrConstFoldImmArg(unsigned iceArguments, unsigned index,
1533-
const Expr *e);
1533+
const Expr *arg);
15341534

15351535
mlir::Value emitScalarPrePostIncDec(const UnaryOperator *e, LValue lv,
15361536
cir::UnaryOpKind kind, bool isPre);

clang/test/CIR/CodeGen/X86/sse-builtins.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -fclangir -emit-llvm -o %t.ll -Wall -Werror
99
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
1010

11+
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG
12+
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG
13+
1114
// This test mimics clang/test/CodeGen/X86/sse-builtins.c, which eventually
1215
// CIR shall be able to support fully.
1316

@@ -17,7 +20,9 @@
1720
void test_mm_sfence(void) {
1821
// CIR-LABEL: test_mm_sfence
1922
// LLVM-LABEL: test_mm_sfence
23+
// OGCG-LABEL: test_mm_sfence
2024
_mm_sfence();
2125
// CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse.sfence" : () -> !void
2226
// LLVM: call void @llvm.x86.sse.sfence()
27+
// OGCG: call void @llvm.x86.sse.sfence()
2328
}
Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse2 -fclangir -emit-cir -o %t.cir -Wall -Werror
2-
// RUN: FileCheck --check-prefixes=CIR-CHECK --input-file=%t.cir %s
2+
// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s
33
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse2 -fno-signed-char -fclangir -emit-cir -o %t.cir -Wall -Werror
4-
// RUN: FileCheck --check-prefixes=CIR-CHECK --input-file=%t.cir %s
4+
// RUN: FileCheck --check-prefixes=CIR --input-file=%t.cir %s
55

66
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse2 -fclangir -emit-llvm -o %t.ll -Wall -Werror
7-
// RUN: FileCheck --check-prefixes=LLVM-CHECK --input-file=%t.ll %s
7+
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
88
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse2 -fno-signed-char -fclangir -emit-llvm -o %t.ll -Wall -Werror
9-
// RUN: FileCheck --check-prefixes=LLVM-CHECK --input-file=%t.ll %s
9+
// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
10+
11+
// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG
12+
// RUN: %clang_cc1 -x c++ -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +sse -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG
1013

1114
// This test mimics clang/test/CodeGen/X86/sse2-builtins.c, which eventually
1215
// CIR shall be able to support fully.
@@ -16,32 +19,40 @@
1619

1720
void test_mm_clflush(void* A) {
1821
// CIR-LABEL: test_mm_clflush
19-
// LLVM-LABEL: teh
22+
// LLVM-LABEL: test_mm_clflush
23+
// OGCG-LABEL: test_mm_clflush
2024
_mm_clflush(A);
21-
// CIR-CHECK: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.clflush" {{%.*}} : (!cir.ptr<!void>) -> !void
22-
// LLVM-CHECK: call void @llvm.x86.sse2.clflush(ptr {{%.*}})
25+
// CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.clflush" {{%.*}} : (!cir.ptr<!void>) -> !void
26+
// LLVM: call void @llvm.x86.sse2.clflush(ptr {{%.*}})
27+
// OGCG: call void @llvm.x86.sse2.clflush(ptr {{%.*}})
2328
}
2429

2530
void test_mm_lfence(void) {
26-
// CIR-CHECK-LABEL: test_mm_lfence
27-
// LLVM-CHECK-LABEL: test_mm_lfence
31+
// CIR-LABEL: test_mm_lfence
32+
// LLVM-LABEL: test_mm_lfence
33+
// OGCG-LABEL: test_mm_lfence
2834
_mm_lfence();
29-
// CIR-CHECK: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.lfence" : () -> !void
30-
// LLVM-CHECK: call void @llvm.x86.sse2.lfence()
35+
// CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.lfence" : () -> !void
36+
// LLVM: call void @llvm.x86.sse2.lfence()
37+
// OGCG: call void @llvm.x86.sse2.lfence()
3138
}
3239

3340
void test_mm_mfence(void) {
34-
// CIR-CHECK-LABEL: test_mm_mfence
35-
// LLVM-CHECK-LABEL: test_mm_mfence
41+
// CIR-LABEL: test_mm_mfence
42+
// LLVM-LABEL: test_mm_mfence
43+
// OGCG-LABEL: test_mm_mfence
3644
_mm_mfence();
37-
// CIR-CHECK: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.mfence" : () -> !void
38-
// LLVM-CHECK: call void @llvm.x86.sse2.mfence()
45+
// CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.mfence" : () -> !void
46+
// LLVM: call void @llvm.x86.sse2.mfence()
47+
// OGCG: call void @llvm.x86.sse2.mfence()
3948
}
4049

4150
void test_mm_pause(void) {
4251
// CIR-LABEL: test_mm_pause
4352
// LLVM-LABEL: test_mm_pause
53+
// OGCG-LABEL: test_mm_pause
4454
_mm_pause();
4555
// CIR: {{%.*}} = cir.call_llvm_intrinsic "x86.sse2.pause" : () -> !void
4656
// LLVM: call void @llvm.x86.sse2.pause()
57+
// OGCG: call void @llvm.x86.sse2.pause()
4758
}

0 commit comments

Comments
 (0)