1 // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm < %s| FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm < %s| FileCheck %s
3 // RUN: %clang_cc1 -triple x86_64-windows -emit-llvm < %s| FileCheck %s
4 // RUN: %clang_cc1 -triple powerpc-unknown-unknown -emit-llvm < %s| FileCheck %s
5 // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -emit-llvm < %s| FileCheck %s
6 // RUN: %clang_cc1 -triple ve-unknown-unknown -emit-llvm < %s | FileCheck %s
8 // RUN: %clang_cc1 -triple aarch64-unknown-unknown -emit-llvm-only -verify %s
9 // RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm-only -verify %s
10 // RUN: %clang_cc1 -triple mips64-unknown-unknown -emit-llvm-only -verify %s
11 // RUN: %clang_cc1 -triple sparc-eabi-unknown -emit-llvm-only -verify %s
13 // Check that __builtin_longjmp and __builtin_setjmp are lowered into
14 // IR intrinsics on those architectures that can handle them.
15 // Check that an error is created otherwise.
17 typedef void *jmp_buf;
20 // CHECK: define{{.*}} void @do_jump()
21 // CHECK: call{{.*}} void @llvm.eh.sjlj.longjmp
23 // CHECK: define{{.*}} void @do_setjmp()
24 // CHECK: call{{.*}} i32 @llvm.eh.sjlj.setjmp
27 __builtin_longjmp(buf
, 1); // expected-error {{__builtin_longjmp is not supported for the current target}}
32 void do_setjmp(void) {
33 if (!__builtin_setjmp(buf
)) // expected-error {{__builtin_setjmp is not supported for the current target}}