aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/annot1.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regression/annot1.c')
-rw-r--r--test/regression/annot1.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/regression/annot1.c b/test/regression/annot1.c
new file mode 100644
index 00000000..42ab826f
--- /dev/null
+++ b/test/regression/annot1.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+
+/* Annotations */
+
+int f(int x, int y)
+{
+ return __builtin_annotation("f(%1,%2)", x, y);
+}
+
+double g(double x)
+{
+ return __builtin_annotation("g(%1 + 1.0)", x + 1.0);
+}
+
+int main()
+{
+ __builtin_annotation("calling f");
+ printf("f returns %d\n", f(12, 34));
+ __builtin_annotation("calling g");
+ printf("f returns %.2f\n", g(3.14));
+ return 0;
+}
+