Skip to content

Commit 7c50c1e

Browse files
committed
[clang][x86] Pull out PR51324 / PR60006 test cases into their own codegen test files
1 parent a62a80c commit 7c50c1e

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

clang/test/CodeGen/X86/pr51324.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
2+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
3+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
4+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
5+
6+
7+
#include <immintrin.h>
8+
9+
// Make sure brackets work after macro intrinsics.
10+
float pr51324(__m128 a) {
11+
// CHECK-LABEL: pr51324
12+
// CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 0)
13+
// CHECK: extractelement <4 x float> %{{.*}}, i32 0
14+
return _mm_round_ps(a, 0)[0];
15+
}

clang/test/CodeGen/X86/pr60006.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s
2+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
3+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -emit-llvm -o - -Wall -Werror | FileCheck %s --check-prefixes=CHECK
4+
// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-apple-darwin -target-feature +sse4.1 -fno-signed-char -emit-llvm -o - -Wall -Werror | FileCheck %s
5+
6+
7+
#include <immintrin.h>
8+
9+
// Ensure _mm_test_all_ones macro doesn't reuse argument
10+
__m128i expensive_call();
11+
int pr60006() {
12+
// CHECK-LABEL: pr60006
13+
// CHECK: call {{.*}} @expensive_call
14+
// CHECK-NOT: call {{.*}} @expensive_call
15+
// CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
16+
return _mm_test_all_ones(expensive_call());
17+
}

clang/test/CodeGen/X86/sse41-builtins.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -400,20 +400,3 @@ int test_mm_testz_si128(__m128i x, __m128i y) {
400400
return _mm_testz_si128(x, y);
401401
}
402402

403-
// Make sure brackets work after macro intrinsics.
404-
float pr51324(__m128 a) {
405-
// CHECK-LABEL: pr51324
406-
// CHECK: call <4 x float> @llvm.x86.sse41.round.ps(<4 x float> %{{.*}}, i32 0)
407-
// CHECK: extractelement <4 x float> %{{.*}}, i32 0
408-
return _mm_round_ps(a, 0)[0];
409-
}
410-
411-
// Ensure _mm_test_all_ones macro doesn't reuse argument
412-
__m128i expensive_call();
413-
int pr60006() {
414-
// CHECK-LABEL: pr60006
415-
// CHECK: call {{.*}} @expensive_call
416-
// CHECK-NOT: call {{.*}} @expensive_call
417-
// CHECK: call i32 @llvm.x86.sse41.ptestc(<2 x i64> %{{.*}}, <2 x i64> %{{.*}})
418-
return _mm_test_all_ones(expensive_call());
419-
}

0 commit comments

Comments
 (0)