brintos

brintos / llvm-project-archived public Read only

0
0
Text · 704 B · da9d81c Raw
37 lines · plain
1// RUN: %clang_cc1 -emit-pch -o %t %s2// RUN: %clang_cc1 -include-pch %t -fsyntax-only %s 3// RUN: %clang_cc1 -emit-pch -fcuda-is-device -o %t-device %s4// RUN: %clang_cc1 -fcuda-is-device -include-pch %t-device -fsyntax-only %s5 6#ifndef HEADER7#define HEADER8// Header.9 10#include "Inputs/cuda.h"11 12void kcall(void (*kp)()) {13  kp<<<1, 1>>>();14}15 16__global__ void kern() {17}18 19// Make sure that target overloaded functions remain20// available as overloads after PCH deserialization.21__host__ int overloaded_func();22__device__ int overloaded_func();23 24#else25// Using the header.26 27void test() {28  kcall(kern);29  kern<<<1, 1>>>();30  overloaded_func();31}32 33__device__ void test () {34  overloaded_func();35}36#endif37