brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · dc8bd76 Raw
52 lines · plain
1// Test this without pch.2// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only3 4// Test with pch.5// RUN: %clang_cc1 -x cl %S/extension-begin.h -triple spir-unknown-unknown -emit-pch -o %t.pch -pedantic6// RUN: %clang_cc1 %s -triple spir-unknown-unknown -include-pch %t.pch -DIMPLICIT_INCLUDE -DUSE_PCH -fsyntax-only -verify -pedantic7 8// Test with modules9// RUN: rm -rf %t.modules10// RUN: mkdir -p %t.modules11//12// RUN: %clang_cc1 -cl-std=CL1.2 -DIMPLICIT_INCLUDE -include %S/extension-begin.h -triple spir-unknown-unknown -O0 -emit-llvm -o - -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.modules %s -verify -pedantic13//14// RUN: rm -rf %t.modules15// RUN: mkdir -p %t.modules16//17// RUN: %clang_cc1 -cl-std=CL2.0 -DIMPLICIT_INCLUDE -include %S/extension-begin.h -triple spir-unknown-unknown -O0 -emit-llvm -o - -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.modules %s -verify -pedantic18 19#pragma OPENCL EXTENSION my_ext : enable20#ifndef IMPLICIT_INCLUDE21// expected-warning@-2 {{OpenCL extension 'my_ext' unknown or does not require pragma - ignoring}}22// expected-warning@+2 {{OpenCL extension 'my_ext' unknown or does not require pragma - ignoring}}23#endif // IMPLICIT_INCLUDE24#pragma OPENCL EXTENSION my_ext : disable25 26#ifndef IMPLICIT_INCLUDE27#include "extension-begin.h"28#endif // IMPLICIT_INCLUDE29#ifndef USE_PCH30// expected-warning@extension-begin.h:4 {{expected 'disable' - ignoring}}31// expected-warning@extension-begin.h:5 {{expected 'disable' - ignoring}}32#endif // USE_PCH33 34#if defined(IMPLICIT_INCLUDE) && defined(USE_PCH)35//expected-no-diagnostics36#endif37 38// Tests that the pragmas are accepted for backward compatibility.39#pragma OPENCL EXTENSION my_ext : enable40#pragma OPENCL EXTENSION my_ext : disable 41 42#ifndef my_ext43#error "Missing my_ext macro"44#endif45 46// When extension is supported its functionality can be used freely.47void test(void) {48  struct A test_A1;49  f();50  g(0);51}52