[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / lifetime3.cpp
blob37ed5f1938111b2f1e21438d04b6dd6ff42045a6
1 // RUN: %clang_cc1 -S -emit-llvm -o - -O2 -disable-llvm-passes %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" --check-prefixes=CHECK,O2
2 // RUN: %clang_cc1 -S -emit-llvm -o - -O2 -disable-lifetime-markers %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" --check-prefixes=CHECK
3 // RUN: %clang_cc1 -S -emit-llvm -o - -O0 %s | FileCheck %s --implicit-check-not="call void @llvm.lifetime" --check-prefixes=CHECK
5 extern int bar(char *A, int n);
7 // CHECK-LABEL: @no_switch_bypass
8 extern "C" void no_switch_bypass(int n) {
9 // O2: call void @llvm.lifetime.start.p0(i64 4,
10 switch (n += 1; int b=n) {
11 case 1: {
12 // O2: call void @llvm.lifetime.start.p0(i64 1,
13 // O2: call void @llvm.lifetime.end.p0(i64 1,
14 char x;
15 bar(&x, 1);
16 break;
18 case 2:
19 n = n;
20 // O2: call void @llvm.lifetime.start.p0(i64 5,
21 // O2: call void @llvm.lifetime.end.p0(i64 5,
22 char y[5];
23 bar(y, 5);
24 break;
26 // O2: call void @llvm.lifetime.end.p0(i64 4,
29 // CHECK-LABEL: @switch_bypass
30 extern "C" void switch_bypass(int n) {
31 // O2: call void @llvm.lifetime.start.p0(i64 4,
32 // O2: call void @llvm.lifetime.end.p0(i64 4,
33 switch (n += 1; int b=n) {
34 case 1:
35 n = n;
36 char x;
37 bar(&x, 1);
38 break;
39 case 2:
40 bar(&x, 1);
41 break;