brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · 8eda594 Raw
130 lines · plain
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals2// Check that the CHECK lines are generated for clang-generated functions3// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fopenmp %s -emit-llvm -o - | FileCheck --check-prefix=OMP %s4// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o - | FileCheck --check-prefix=NOOMP %s5 6const int size = 1024 * 1024 * 32;7 8double A[size];9 10void foo(void);11 12//.13// OMP: @A = global [33554432 x double] zeroinitializer, align 1614// OMP: @size = constant i32 33554432, align 415// OMP: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [23 x i8] c"16// OMP: @[[GLOB1:[0-9]+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 514, i32 0, i32 22, ptr @[[GLOB0]] }, align 817// OMP: @[[GLOB2:[0-9]+]] = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @[[GLOB0]] }, align 818//.19// NOOMP: @size = constant i32 33554432, align 420// NOOMP: @A = global [33554432 x double] zeroinitializer, align 1621//.22// OMP-LABEL: @main(23// OMP-NEXT:  entry:24// OMP-NEXT:    [[RETVAL:%.*]] = alloca i32, align 425// OMP-NEXT:    [[I:%.*]] = alloca i32, align 426// OMP-NEXT:    store i32 0, ptr [[RETVAL]], align 427// OMP-NEXT:    store i32 0, ptr [[I]], align 428// OMP-NEXT:    call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 0, ptr @main.omp_outlined)29// OMP-NEXT:    call void @foo()30// OMP-NEXT:    ret i32 031//32// NOOMP-LABEL: @main(33// NOOMP-NEXT:  entry:34// NOOMP-NEXT:    [[RETVAL:%.*]] = alloca i32, align 435// NOOMP-NEXT:    [[I:%.*]] = alloca i32, align 436// NOOMP-NEXT:    store i32 0, ptr [[RETVAL]], align 437// NOOMP-NEXT:    store i32 0, ptr [[I]], align 438// NOOMP-NEXT:    store i32 0, ptr [[I]], align 439// NOOMP-NEXT:    br label [[FOR_COND:%.*]]40// NOOMP:       for.cond:41// NOOMP-NEXT:    [[TMP0:%.*]] = load i32, ptr [[I]], align 442// NOOMP-NEXT:    [[CMP:%.*]] = icmp slt i32 [[TMP0]], 3355443243// NOOMP-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]44// NOOMP:       for.body:45// NOOMP-NEXT:    [[TMP1:%.*]] = load i32, ptr [[I]], align 446// NOOMP-NEXT:    [[IDXPROM:%.*]] = sext i32 [[TMP1]] to i6447// NOOMP-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [33554432 x double], ptr @A, i64 0, i64 [[IDXPROM]]48// NOOMP-NEXT:    store double 0.000000e+00, ptr [[ARRAYIDX]], align 849// NOOMP-NEXT:    br label [[FOR_INC:%.*]]50// NOOMP:       for.inc:51// NOOMP-NEXT:    [[TMP2:%.*]] = load i32, ptr [[I]], align 452// NOOMP-NEXT:    [[INC:%.*]] = add nsw i32 [[TMP2]], 153// NOOMP-NEXT:    store i32 [[INC]], ptr [[I]], align 454// NOOMP-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP2:![0-9]+]]55// NOOMP:       for.end:56// NOOMP-NEXT:    call void @foo()57// NOOMP-NEXT:    ret i32 058//59int main(void) {60  int i = 0;61 62#pragma omp parallel for63  for (i = 0; i < size; ++i) {64    A[i] = 0.0;65  }66 67  foo();68 69  return 0;70}71 72// OMP-LABEL: @foo(73// OMP-NEXT:  entry:74// OMP-NEXT:    [[I:%.*]] = alloca i32, align 475// OMP-NEXT:    store i32 0, ptr [[I]], align 476// OMP-NEXT:    call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 0, ptr @foo.omp_outlined)77// OMP-NEXT:    ret void78//79// NOOMP-LABEL: @foo(80// NOOMP-NEXT:  entry:81// NOOMP-NEXT:    [[I:%.*]] = alloca i32, align 482// NOOMP-NEXT:    store i32 0, ptr [[I]], align 483// NOOMP-NEXT:    store i32 0, ptr [[I]], align 484// NOOMP-NEXT:    br label [[FOR_COND:%.*]]85// NOOMP:       for.cond:86// NOOMP-NEXT:    [[TMP0:%.*]] = load i32, ptr [[I]], align 487// NOOMP-NEXT:    [[CMP:%.*]] = icmp slt i32 [[TMP0]], 3355443288// NOOMP-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]89// NOOMP:       for.body:90// NOOMP-NEXT:    [[TMP1:%.*]] = load i32, ptr [[I]], align 491// NOOMP-NEXT:    [[IDXPROM:%.*]] = sext i32 [[TMP1]] to i6492// NOOMP-NEXT:    [[ARRAYIDX:%.*]] = getelementptr inbounds [33554432 x double], ptr @A, i64 0, i64 [[IDXPROM]]93// NOOMP-NEXT:    store double 1.000000e+00, ptr [[ARRAYIDX]], align 894// NOOMP-NEXT:    br label [[FOR_INC:%.*]]95// NOOMP:       for.inc:96// NOOMP-NEXT:    [[TMP2:%.*]] = load i32, ptr [[I]], align 497// NOOMP-NEXT:    [[INC:%.*]] = add nsw i32 [[TMP2]], 198// NOOMP-NEXT:    store i32 [[INC]], ptr [[I]], align 499// NOOMP-NEXT:    br label [[FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]100// NOOMP:       for.end:101// NOOMP-NEXT:    ret void102//103void foo(void) {104  int i = 0;105 106#pragma omp parallel for107  for (i = 0; i < size; ++i) {108    A[i] = 1.0;109  }110}111//.112// OMP: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }113// OMP: attributes #[[ATTR1:[0-9]+]] = { noinline norecurse nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }114// OMP: attributes #[[ATTR2:[0-9]+]] = { nounwind }115//.116// NOOMP: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }117//.118// OMP: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}119// OMP: [[META1:![0-9]+]] = !{i32 7, !"openmp", i32 51}120// OMP: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}121// OMP: [[META3:![0-9]+]] = !{[[META4:![0-9]+]]}122// OMP: [[META4]] = !{i64 2, i64 -1, i64 -1, i1 true}123//.124// NOOMP: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}125// NOOMP: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}126// NOOMP: [[LOOP2]] = distinct !{[[LOOP2]], [[META3:![0-9]+]]}127// NOOMP: [[META3]] = !{!"llvm.loop.mustprogress"}128// NOOMP: [[LOOP4]] = distinct !{[[LOOP4]], [[META3]]}129//.130