Changeset View
Changeset View
Standalone View
Standalone View
clang/test/OpenMP/distribute_codegen.cpp
Show First 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | |||||
// no templates for now, as these require special handling in target regions and/or declare target | // no templates for now, as these require special handling in target regions and/or declare target | ||||
// HCHECK-LABEL: fint | // HCHECK-LABEL: fint | ||||
// HCHECK: call {{.*}}i32 {{.+}}ftemplate | // HCHECK: call {{.*}}i32 {{.+}}ftemplate | ||||
// HCHECK: ret i32 | // HCHECK: ret i32 | ||||
// HCHECK: load i16, i16* | // HCHECK: load i16, i16* | ||||
// HCHECK: store i16 % | // HCHECK: store i16 % | ||||
// HCHECK: call i32 @__tgt_target_teams( | // HCHECK: call i32 @__tgt_target_teams_mapper( | ||||
// HCHECK: call void @__kmpc_for_static_init_4( | // HCHECK: call void @__kmpc_for_static_init_4( | ||||
template <typename T> | template <typename T> | ||||
T ftemplate() { | T ftemplate() { | ||||
short aa = 0; | short aa = 0; | ||||
#pragma omp target | #pragma omp target | ||||
#pragma omp teams | #pragma omp teams | ||||
#pragma omp distribute dist_schedule(static, aa) | #pragma omp distribute dist_schedule(static, aa) | ||||
for (int i = 0; i < 100; i++) { | for (int i = 0; i < 100; i++) { | ||||
} | } | ||||
return T(); | return T(); | ||||
} | } | ||||
int fint(void) { return ftemplate<int>(); } | int fint(void) { return ftemplate<int>(); } | ||||
#endif | #endif |