Dario Domizioli | 13a0a38 | 2014-05-23 12:13:25 +0000 | [diff] [blame^] | 1 | // Test this without pch. |
| 2 | // RUN: %clang_cc1 %s -include %s -verify -fsyntax-only |
| 3 | |
| 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 |
| 7 | |
| 8 | // expected-no-diagnostics |
| 9 | |
| 10 | #ifndef HEADER |
| 11 | #define HEADER |
| 12 | #pragma clang optimize off |
| 13 | |
| 14 | #else |
| 15 | |
| 16 | int a; |
| 17 | |
| 18 | void f() { |
| 19 | a = 12345; |
| 20 | } |
| 21 | |
| 22 | // Check that the function is decorated with optnone |
| 23 | |
| 24 | // CHECK-DAG: @f() [[ATTRF:#[0-9]+]] |
| 25 | // CHECK-DAG: attributes [[ATTRF]] = { {{.*}}noinline{{.*}}optnone{{.*}} } |
| 26 | |
| 27 | #endif |