1 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -cl-std
=clc
++ -verify -fsyntax-only
2 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -cl-std
=clc
++ -verify -fsyntax-only -fexceptions -fcxx-exceptions
4 // This test checks that various C
++ and OpenCL C keywords are not available
7 // Test that exceptions are disabled despite passing -fcxx-exceptions.
8 kernel void test_exceptions
() {
11 // expected-error
@-
1 {{cannot use
'try
' with exceptions disabled
}}
13 // expected-error
@-
1 {{cannot use
'throw
' with exceptions disabled
}}
19 // Test that only __-prefixed address space qualifiers are accepted.
20 struct test_address_space_qualifiers
{
23 int global
; // expected-warning{{declaration does not declare anything}}
27 int local
; // expected-warning{{declaration does not declare anything}}
31 int private
; // expected-warning{{declaration does not declare anything}}
35 int constant
; // expected-warning{{declaration does not declare anything}}
39 int generic
; // expected-warning{{declaration does not declare anything}}
42 // Test that
'private
' can be parsed as an access qualifier and an address space too.
45 private int i
; //expected-error{{field may not be qualified with an address space}}
48 private
::A i
; //expected-error{{program scope variable must reside in global or constant address space}}
50 void foo
(private int i
);
52 private int bar
(); //expected-error{{return type cannot be qualified with address space}}