blob: c5e487aafd6c3347a2fc2b26d948b3362a9c81d1 [file] [log] [blame]
Jim Grosbachf7947052012-07-09 18:34:21 +00001// REQUIRES: arm-registered-target
Rafael Espindolaa71d3c62010-06-08 03:59:28 +00002// RUN: %clang_cc1 -Wall -Werror -triple thumbv7-eabi -target-cpu cortex-a8 -O3 -emit-llvm -o - %s | FileCheck %s
Chris Lattner2752c012010-03-03 19:03:45 +00003
Chris Lattner2752c012010-03-03 19:03:45 +00004void *f0()
5{
6 return __builtin_thread_pointer();
7}
Rafael Espindolaa71d3c62010-06-08 03:59:28 +00008
9void f1(char *a, char *b) {
10 __clear_cache(a,b);
11}
12
Daniel Dunbar10582532010-07-16 00:31:23 +000013// CHECK: call {{.*}} @__clear_cache
Logan Chiena8f7a972013-02-23 04:24:36 +000014
15void test_eh_return_data_regno()
16{
17 volatile int res;
18 res = __builtin_eh_return_data_regno(0); // CHECK: store volatile i32 0
19 res = __builtin_eh_return_data_regno(1); // CHECK: store volatile i32 1
20}
Joey Gouly594e1932013-10-02 10:00:18 +000021
Stephen Hines6bcf27b2014-05-29 04:14:42 -070022void yield() {
23 __yield();
Joey Gouly594e1932013-10-02 10:00:18 +000024}
Stephen Hines6bcf27b2014-05-29 04:14:42 -070025
26// CHECK: call {{.*}} @llvm.arm.hint(i32 1)
27
28void wfe() {
29 __wfe();
30}
31
32// CHECK: call {{.*}} @llvm.arm.hint(i32 2)
33
34void wfi() {
35 __wfi();
36}
37
38// CHECK: call {{.*}} @llvm.arm.hint(i32 3)
39
40void sev() {
41 __sev();
42}
43
44// CHECK: call {{.*}} @llvm.arm.hint(i32 4)
45
46void sevl() {
47 __sevl();
48}
49// CHECK: call {{.*}} @llvm.arm.hint(i32 5)
Weiming Zhao186b26d2013-11-12 21:42:50 +000050
51void test_barrier() {
52 __builtin_arm_dmb(1); //CHECK: call {{.*}} @llvm.arm.dmb(i32 1)
53 __builtin_arm_dsb(2); //CHECK: call {{.*}} @llvm.arm.dsb(i32 2)
54}