Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs %s -verify |
Ben Langmuir | f541674 | 2016-02-04 00:55:24 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x c %s -verify |
| 4 | // RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs -x objective-c++ %s -verify |
Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame] | 5 | |
| 6 | // RUN: rm -rf %t.pch.cache |
| 7 | // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %S/Inputs/use-builtin.h |
| 8 | // RUN: %clang_cc1 -fmodules-cache-path=%t.pch.cache -fmodules -fimplicit-module-maps -I %S/Inputs %s -include-pch %t.pch %s -verify |
| 9 | |
| 10 | // expected-no-diagnostics |
| 11 | |
| 12 | void use_constant_string_builtins1(void) { |
| 13 | (void)__builtin___CFStringMakeConstantString(""); |
| 14 | (void)__builtin___NSStringMakeConstantString(""); |
| 15 | } |
| 16 | |
Ben Langmuir | f541674 | 2016-02-04 00:55:24 +0000 | [diff] [blame] | 17 | #include "builtin.h" |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 18 | |
| 19 | int foo() { |
| 20 | return __builtin_object_size(p, 0); |
| 21 | } |
| 22 | |
Ben Langmuir | f541674 | 2016-02-04 00:55:24 +0000 | [diff] [blame] | 23 | #include "builtin_sub.h" |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 24 | |
| 25 | int bar() { |
| 26 | return __builtin_object_size(p, 0); |
| 27 | } |
| 28 | |
Ben Langmuir | b9ad4e6 | 2015-10-28 22:25:37 +0000 | [diff] [blame] | 29 | int baz() { |
| 30 | return IS_CONST(0); |
| 31 | } |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 32 | |
Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame] | 33 | void use_constant_string_builtins2(void) { |
| 34 | (void)__builtin___CFStringMakeConstantString(""); |
| 35 | (void)__builtin___NSStringMakeConstantString(""); |
| 36 | } |