141a6b50cSJoseph Huber // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --include-generated-funcs
241a6b50cSJoseph Huber // RUN: %clang_cc1 -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*4860f6cbSIgor Kirillov // RUN: %clang_cc1 -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 
941a6b50cSJoseph Huber void foo() {
1041a6b50cSJoseph Huber #pragma omp parallel if(0)
1141a6b50cSJoseph Huber   ;
12*4860f6cbSIgor Kirillov #pragma omp parallel
13*4860f6cbSIgor 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]])
29*4860f6cbSIgor 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.
35fd9b0999Shyeongyu kim // CHECK-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[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 //
43*4860f6cbSIgor Kirillov //
44*4860f6cbSIgor Kirillov // CHECK: Function Attrs: alwaysinline norecurse nounwind
45*4860f6cbSIgor Kirillov // CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
46*4860f6cbSIgor Kirillov // CHECK-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
47*4860f6cbSIgor Kirillov // CHECK-NEXT:  entry:
48*4860f6cbSIgor Kirillov // CHECK-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
49*4860f6cbSIgor Kirillov // CHECK-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
50*4860f6cbSIgor Kirillov // CHECK-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7]]
51*4860f6cbSIgor Kirillov // CHECK-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
52*4860f6cbSIgor Kirillov // CHECK-NEXT:    ret void
53*4860f6cbSIgor Kirillov //
54*4860f6cbSIgor Kirillov //
55*4860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: mustprogress noinline nounwind
56*4860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@_Z3foov
57*4860f6cbSIgor Kirillov // CHECK-NOINLINE-SAME: () #[[ATTR0:[0-9]+]] {
58*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
59*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
60*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
61*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
62*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
63*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4, !tbaa [[TBAA3:![0-9]+]]
64*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
65*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
66*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
67*4860f6cbSIgor 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*, ...)*))
68*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
69*4860f6cbSIgor Kirillov //
70*4860f6cbSIgor Kirillov //
71*4860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: noinline norecurse nounwind
72*4860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@.omp_outlined.
73*4860f6cbSIgor Kirillov // CHECK-NOINLINE-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
74*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
75*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
76*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
77*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7:![0-9]+]]
78*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
79*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
80*4860f6cbSIgor Kirillov //
81*4860f6cbSIgor Kirillov //
82*4860f6cbSIgor Kirillov // CHECK-NOINLINE: Function Attrs: alwaysinline norecurse nounwind
83*4860f6cbSIgor Kirillov // CHECK-NOINLINE-LABEL: define {{[^@]+}}@.omp_outlined..1
84*4860f6cbSIgor Kirillov // CHECK-NOINLINE-SAME: (i32* noalias [[DOTGLOBAL_TID_:%.*]], i32* noalias [[DOTBOUND_TID_:%.*]]) #[[ATTR3:[0-9]+]] {
85*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:  entry:
86*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
87*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
88*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8, !tbaa [[TBAA7]]
89*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8, !tbaa [[TBAA7]]
90*4860f6cbSIgor Kirillov // CHECK-NOINLINE-NEXT:    ret void
91*4860f6cbSIgor Kirillov //
92