[Clang/AMDGPU] Zero sized arrays not allowed in HIP device code. (#113470)
[llvm-project.git] / clang / test / PCH / pragma-optimize.c
blobae5ff10a8d31b02c861dd11b8a213af5dbedbbfa
1 // Test this without pch.
2 // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only
4 // Test with pch.
5 // RUN: %clang_cc1 %s -emit-pch -o %t
6 // RUN: %clang_cc1 %s -emit-llvm -include-pch %t -o - | FileCheck %s
8 // The first run line creates a pch, and since at that point HEADER is not
9 // defined, the only thing contained in the pch is the pragma. The second line
10 // then includes that pch, so HEADER is defined and the actual code is compiled.
11 // The check then makes sure that the pragma is in effect in the file that
12 // includes the pch.
14 // expected-no-diagnostics
16 #ifndef HEADER
17 #define HEADER
18 #pragma clang optimize off
20 #else
22 int a;
24 void f(void) {
25 a = 12345;
28 // Check that the function is decorated with optnone
30 // CHECK-DAG: @f() [[ATTRF:#[0-9]+]]
31 // CHECK-DAG: attributes [[ATTRF]] = { {{.*}}noinline{{.*}}optnone{{.*}} }
33 #endif