12
12
// RUN: | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
13
13
// RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \
14
14
// RUN: -triple x86_64--linux -emit-llvm %s -o - \
15
- // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-32BIT -LONG
15
+ // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-64BIT -LONG
16
16
// RUN: %clang_cc1 -ffreestanding -fms-extensions \
17
17
// RUN: -triple x86_64--darwin -emit-llvm %s -o - \
18
- // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-32BIT-LONG
19
-
20
- // LP64 targets use 'long' as 'int' for MS intrinsics (-fms-extensions)
21
- #ifdef __LP64__
22
- #define LONG int
23
- #else
24
- #define LONG long
25
- #endif
18
+ // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-64BIT-LONG
26
19
27
20
// rotate left
28
21
@@ -47,12 +40,15 @@ unsigned int test_rotl(unsigned int value, int shift) {
47
40
// CHECK: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 [[X]], i32 [[Y:%.*]])
48
41
// CHECK: ret i32 [[R]]
49
42
50
- unsigned LONG test_lrotl (unsigned LONG value , int shift ) {
43
+ unsigned long test_lrotl (unsigned long value , int shift ) {
51
44
return _lrotl (value , shift );
52
45
}
53
46
// CHECK-32BIT-LONG: i32 @test_lrotl
54
47
// CHECK-32BIT-LONG: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 [[X]], i32 [[Y:%.*]])
55
48
// CHECK-32BIT-LONG: ret i32 [[R]]
49
+ // CHECK-64BIT-LONG: i64 @test_lrotl
50
+ // CHECK-64BIT-LONG: [[R:%.*]] = call i64 @llvm.fshl.i64(i64 [[X:%.*]], i64 [[X]], i64 [[Y:%.*]])
51
+ // CHECK-64BIT-LONG: ret i64 [[R]]
56
52
57
53
unsigned __int64 test_rotl64 (unsigned __int64 value , int shift ) {
58
54
return _rotl64 (value , shift );
@@ -84,12 +80,15 @@ unsigned int test_rotr(unsigned int value, int shift) {
84
80
// CHECK: [[R:%.*]] = call i32 @llvm.fshr.i32(i32 [[X:%.*]], i32 [[X]], i32 [[Y:%.*]])
85
81
// CHECK: ret i32 [[R]]
86
82
87
- unsigned LONG test_lrotr (unsigned LONG value , int shift ) {
83
+ unsigned long test_lrotr (unsigned long value , int shift ) {
88
84
return _lrotr (value , shift );
89
85
}
90
86
// CHECK-32BIT-LONG: i32 @test_lrotr
91
87
// CHECK-32BIT-LONG: [[R:%.*]] = call i32 @llvm.fshr.i32(i32 [[X:%.*]], i32 [[X]], i32 [[Y:%.*]])
92
88
// CHECK-32BIT-LONG: ret i32 [[R]]
89
+ // CHECK-64BIT-LONG: i64 @test_lrotr
90
+ // CHECK-64BIT-LONG: [[R:%.*]] = call i64 @llvm.fshr.i64(i64 [[X:%.*]], i64 [[X]], i64 [[Y:%.*]])
91
+ // CHECK-64BIT-LONG: ret i64 [[R]]
93
92
94
93
unsigned __int64 test_rotr64 (unsigned __int64 value , int shift ) {
95
94
return _rotr64 (value , shift );
0 commit comments