1 // REQUIRES: powerpc-registered-target 2 // RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s 3 test_eh_return_data_regno()4void test_eh_return_data_regno() 5 { 6 volatile int res; 7 res = __builtin_eh_return_data_regno(0); // CHECK: store volatile i32 3 8 res = __builtin_eh_return_data_regno(1); // CHECK: store volatile i32 4 9 } 10 11 // CHECK-LABEL: define i64 @test_builtin_ppc_get_timebase test_builtin_ppc_get_timebase()12long long test_builtin_ppc_get_timebase() { 13 // CHECK: call i64 @llvm.readcyclecounter() 14 return __builtin_ppc_get_timebase(); 15 } 16 test_builtin_ppc_setrnd()17void test_builtin_ppc_setrnd() { 18 volatile double res; 19 volatile int x = 100; 20 21 // CHECK: call double @llvm.ppc.setrnd(i32 2) 22 res = __builtin_setrnd(2); 23 24 // CHECK: call double @llvm.ppc.setrnd(i32 100) 25 res = __builtin_setrnd(100); 26 27 // CHECK: call double @llvm.ppc.setrnd(i32 %2) 28 res = __builtin_setrnd(x); 29 } 30 test_builtin_ppc_flm()31void test_builtin_ppc_flm() { 32 volatile double res; 33 // CHECK: call double @llvm.ppc.readflm() 34 res = __builtin_readflm(); 35 36 // CHECK: call double @llvm.ppc.setflm(double %1) 37 res = __builtin_setflm(res); 38 } 39 test_builtin_ppc_darn()40void test_builtin_ppc_darn() { 41 volatile long res; 42 volatile int x; 43 // CHECK: call i64 @llvm.ppc.darn() 44 res = __builtin_darn(); 45 46 // CHECK: call i64 @llvm.ppc.darnraw() 47 res = __builtin_darn_raw(); 48 49 // CHECK: call i32 @llvm.ppc.darn32() 50 x = __builtin_darn_32(); 51 } 52