/
redgpu
/
ispc
Обзор
Документация
Войти
/
redgpu
/
ispc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/lit-tests/func_template_3.ispc
16 строк
618 B
Dmitry Babokin
Implementation of template argument deduction rules
28 фев 2023, 09:01
28 фев 2023, 09:01
957fccb
Код
Авторство
О чём код?
// Tests multiple instantiations of templates with same function type (no typenames as parameters or return type). // This verifies temlate name mangling. // RUN: %{ispc} %s --emit-llvm-text --target=host --nostdlib -o - | FileCheck %s // CHECK: define {{.*}} @addTemp___vyi___vyfvyf // CHECK: define {{.*}} @addTemp___vyI___vyfvyf template <typename T> noinline int addTemp(float targ0, float targ1) { return (int)((T)targ0 + (T)targ1); } bool foo(float arg0, float arg1) { int v1 = addTemp<int>(arg0, arg1); int v2 = addTemp<int64>(arg0, arg1); if (v1 == v2) return true; return false; }