141a6b50cSJoseph Huber // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --include-generated-funcs
2*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -x c++ -O1 -fopenmp-version=45 -disable-llvm-optzns -verify -fopenmp -triple x86_64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK
3*532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -x c++ -O1 -fopenmp-version=45 -disable-llvm-optzns -verify -fopenmp -triple x86_64-unknown-linux -emit-llvm -fno-inline %s -o - | FileCheck %s --check-prefix=CHECK-NOINLINE
441a6b50cSJoseph Huber // expected-no-diagnostics
541a6b50cSJoseph Huber 
641a6b50cSJoseph Huber #ifndef HEADER
741a6b50cSJoseph Huber #define HEADER
841a6b50cSJoseph Huber 
foo()941a6b50cSJoseph Huber void foo() {
1041a6b50cSJoseph Huber #pragma omp parallel if(0)
1141a6b50cSJoseph Huber   ;
124860f6cbSIgor Kirillov #pragma omp parallel
134860f6cbSIgor Kirillov   ;
1441a6b50cSJoseph Huber }
1541a6b50cSJoseph Huber 
1641a6b50cSJoseph Huber #endif
1741a6b50cSJoseph Huber // CHECK: Function Attrs: mustprogress nounwind
1841a6b50cSJoseph Huber // CHECK-LABEL: define {{[^@]+}}@_Z3foov
1941a6b50cSJoseph Huber // CHECK-SAME: () #[[ATTR0:[0-9]+]] {
2041a6b50cSJoseph Huber // CHECK-NEXT:  entry:
2141a6b50cSJoseph Huber // CHECK-NEXT:    [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
2241a6b50cSJoseph Huber // CHECK-NEXT:    [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2341a6b50cSJoseph Huber // CHECK-NEXT:    [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
2441a6b50cSJoseph Huber // CHECK-NEXT:    call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
2541a6b50cSJoseph Huber // CHECK-NEXT:    store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA3:![0-9]+]]
26f7de6962Shsmahesha // CHECK-NEXT:    store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
27ac90dfc4SGiorgis Georgakoudis // CHECK-NEXT:    call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
2841a6b50cSJoseph Huber // CHECK-NEXT:    call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
294860f6cbSIgor Kirillov // CHECK-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
3041a6b50cSJoseph Huber // CHECK-NEXT:    ret void
3141a6b50cSJoseph Huber //
3241a6b50cSJoseph Huber //
3341a6b50cSJoseph Huber // CHECK: Function Attrs: noinline norecurse nounwind
3441a6b50cSJoseph Huber // CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
351b1c8d83Shyeongyu kim // CHECK-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
3641a6b50cSJoseph Huber // CHECK-NEXT:  entry:
3741a6b50cSJoseph Huber // CHECK-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
3841a6b50cSJoseph Huber // CHECK-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
3941a6b50cSJoseph Huber // CHECK-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7:![0-9]+]]
4041a6b50cSJoseph Huber // CHECK-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
4141a6b50cSJoseph Huber // CHECK-NEXT:    ret void
4241a6b50cSJoseph Huber //
434860f6cbSIgor Kirillov //
444860f6cbSIgor Kirillov // CHECK: Function Attrs: alwaysinline norecurse nounwind
454860f6cbSIgor Kirillov // CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
461b1c8d83Shyeongyu kim // CHECK-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
474860f6cbSIgor Kirillov // CHECK-NEXT:  entry:
484860f6cbSIgor Kirillov // CHECK-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
494860f6cbSIgor Kirillov // CHECK-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
504860f6cbSIgor Kirillov // CHECK-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7]]
514860f6cbSIgor Kirillov // CHECK-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
524860f6cbSIgor Kirillov // CHECK-NEXT:    ret void
534860f6cbSIgor Kirillov //
544860f6cbSIgor Kirillov //
554860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: mustprogress noinline nounwind
564860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@_Z3foov
574860f6cbSIgor Kirillov // CHECK-NOINLINE-SAME: () #[[ATTR0:[0-9]+]] {
584860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
594860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
604860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
614860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
624860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
634860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA3:![0-9]+]]
644860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
654860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
664860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
674860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
684860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
694860f6cbSIgor Kirillov //
704860f6cbSIgor Kirillov //
714860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: noinline norecurse nounwind
724860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@.omp_outlined.
731b1c8d83Shyeongyu kim // CHECK-NOINLINE-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
744860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
754860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
764860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
774860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7:![0-9]+]]
784860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
794860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
804860f6cbSIgor Kirillov //
814860f6cbSIgor Kirillov //
824860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: alwaysinline norecurse nounwind
834860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@.omp_outlined..1
841b1c8d83Shyeongyu kim // CHECK-NOINLINE-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
854860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
864860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
874860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
884860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7]]
894860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
904860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
914860f6cbSIgor Kirillov //
92