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 |
Galina Kistanova | 53ddd72 | 2017-04-04 02:50:40 +0000 | [diff] [blame] | 11 | // REQUIRES: shell |
Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame] | 12 | |
| 13 | void use_constant_string_builtins1(void) { |
| 14 | (void)__builtin___CFStringMakeConstantString(""); |
| 15 | (void)__builtin___NSStringMakeConstantString(""); |
| 16 | } |
| 17 | |
Ben Langmuir | f541674 | 2016-02-04 00:55:24 +0000 | [diff] [blame] | 18 | #include "builtin.h" |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 19 | |
| 20 | int foo() { |
| 21 | return __builtin_object_size(p, 0); |
| 22 | } |
| 23 | |
Ben Langmuir | f541674 | 2016-02-04 00:55:24 +0000 | [diff] [blame] | 24 | #include "builtin_sub.h" |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 25 | |
| 26 | int bar() { |
| 27 | return __builtin_object_size(p, 0); |
| 28 | } |
| 29 | |
Ben Langmuir | b9ad4e6 | 2015-10-28 22:25:37 +0000 | [diff] [blame] | 30 | int baz() { |
| 31 | return IS_CONST(0); |
| 32 | } |
Douglas Gregor | 1519766 | 2013-04-03 23:06:26 +0000 | [diff] [blame] | 33 | |
Quentin Colombet | 043406b | 2016-02-03 22:41:00 +0000 | [diff] [blame] | 34 | void use_constant_string_builtins2(void) { |
| 35 | (void)__builtin___CFStringMakeConstantString(""); |
| 36 | (void)__builtin___NSStringMakeConstantString(""); |
| 37 | } |