[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGenObjC / builtin-constant-p.m
blob16da002377c33ac5da4c183f22d6b5ccf8421f41
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -O3 -disable-llvm-passes -o - %s | FileCheck %s
3 // Test that can call `__builtin_constant_p` with instances of different
4 // Objective-C classes.
5 @class Foo;
6 @class Bar;
8 extern void callee(void);
10 // CHECK-LABEL: define{{.*}} void @test(ptr noundef %foo, ptr noundef %bar)
11 void test(Foo *foo, Bar *bar) {
12   // CHECK: call i1 @llvm.is.constant.p0(ptr %{{.*}})
13   // CHECK: call i1 @llvm.is.constant.p0(ptr %{{.*}})
14   if (__builtin_constant_p(foo) && __builtin_constant_p(bar))
15     callee();
18 // Test other Objective-C types.
19 // CHECK-LABEL: define{{.*}} void @test_more(ptr noundef %object, ptr noundef %klass)
20 void test_more(id object, Class klass) {
21   // CHECK: call i1 @llvm.is.constant.p0(ptr %{{.*}})
22   // CHECK: call i1 @llvm.is.constant.p0(ptr %{{.*}})
23   if (__builtin_constant_p(object) && __builtin_constant_p(klass))
24     callee();