1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +rdrnd -target-feature +rdseed -emit-llvm -o - %s | FileCheck %s
2
3 // Don't include mm_malloc.h, it's system specific.
4 #define __MM_MALLOC_H
5
6 #include <x86intrin.h>
7
rdrand16(unsigned short * p)8 int rdrand16(unsigned short *p) {
9 return _rdrand16_step(p);
10 // CHECK: @rdrand16
11 // CHECK: call { i16, i32 } @llvm.x86.rdrand.16
12 // CHECK: store i16
13 }
14
rdrand32(unsigned * p)15 int rdrand32(unsigned *p) {
16 return _rdrand32_step(p);
17 // CHECK: @rdrand32
18 // CHECK: call { i32, i32 } @llvm.x86.rdrand.32
19 // CHECK: store i32
20 }
21
rdrand64(unsigned long long * p)22 int rdrand64(unsigned long long *p) {
23 return _rdrand64_step(p);
24 // CHECK: @rdrand64
25 // CHECK: call { i64, i32 } @llvm.x86.rdrand.64
26 // CHECK: store i64
27 }
28
rdseed16(unsigned short * p)29 int rdseed16(unsigned short *p) {
30 return _rdseed16_step(p);
31 // CHECK: @rdseed16
32 // CHECK: call { i16, i32 } @llvm.x86.rdseed.16
33 // CHECK: store i16
34 }
35
rdseed32(unsigned * p)36 int rdseed32(unsigned *p) {
37 return _rdseed32_step(p);
38 // CHECK: @rdseed32
39 // CHECK: call { i32, i32 } @llvm.x86.rdseed.32
40 // CHECK: store i32
41 }
42
rdseed64(unsigned long long * p)43 int rdseed64(unsigned long long *p) {
44 return _rdseed64_step(p);
45 // CHECK: @rdseed64
46 // CHECK: call { i64, i32 } @llvm.x86.rdseed.64
47 // CHECK: store i64
48 }
49